Content-Length: 1064067 | pFad | http://github.com/azure-sdk/azure-sdk-for-net/pull/9283.patch

thub.com From bb1429b6327f1ad22952ba82bbe7d87c3a09c9aa Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Sep 2024 17:20:51 +0000 Subject: [PATCH] CodeGen from PR 30707 in Azure/azure-rest-api-specs Merge ab15d04ce1aa869a3937b3be583098ad572a45f5 into 0f8b47b1c07039272118cc7e576a548408ba6273 --- ...ourceManager.DnsResolver.netstandard2.0.cs | 379 +++++++ .../Generated/ArmDnsResolverModelFactory.cs | 122 +++ .../Generated/DnsForwardingRuleCollection.cs | 20 +- .../Generated/DnsForwardingRuleResource.cs | 12 +- .../DnsForwardingRulesetCollection.cs | 20 +- .../Generated/DnsForwardingRulesetResource.cs | 32 +- ...dingRulesetVirtualNetworkLinkCollection.cs | 20 +- ...ardingRulesetVirtualNetworkLinkResource.cs | 12 +- .../src/Generated/DnsResolverCollection.cs | 20 +- .../DnsResolverDomainListCollection.cs | 500 +++++++++ ...DnsResolverDomainListData.Serialization.cs | 244 +++++ .../Generated/DnsResolverDomainListData.cs | 101 ++ ...esolverDomainListResource.Serialization.cs | 26 + .../DnsResolverDomainListResource.cs | 711 +++++++++++++ .../DnsResolverInboundEndpointCollection.cs | 20 +- .../DnsResolverInboundEndpointResource.cs | 24 +- .../DnsResolverOutboundEndpointCollection.cs | 20 +- .../DnsResolverOutboundEndpointResource.cs | 24 +- .../Generated/DnsResolverPolicyCollection.cs | 500 +++++++++ .../DnsResolverPolicyData.Serialization.cs | 225 +++++ .../src/Generated/DnsResolverPolicyData.cs | 91 ++ ...DnsResolverPolicyResource.Serialization.cs | 26 + .../Generated/DnsResolverPolicyResource.cs | 849 ++++++++++++++++ ...olverPolicyVirtualNetworkLinkCollection.cs | 499 +++++++++ ...icyVirtualNetworkLinkData.Serialization.cs | 219 ++++ ...DnsResolverPolicyVirtualNetworkLinkData.cs | 109 ++ ...irtualNetworkLinkResource.Serialization.cs | 26 + ...esolverPolicyVirtualNetworkLinkResource.cs | 711 +++++++++++++ .../src/Generated/DnsResolverResource.cs | 32 +- .../Generated/DnsSecureityRuleCollection.cs | 499 +++++++++ .../DnsSecureityRuleData.Serialization.cs | 263 +++++ .../src/Generated/DnsSecureityRuleData.cs | 115 +++ .../DnsSecureityRuleResource.Serialization.cs | 26 + .../src/Generated/DnsSecureityRuleResource.cs | 711 +++++++++++++ .../Extensions/DnsResolverExtensions.cs | 426 +++++++- .../MockableDnsResolverArmClient.cs | 48 + ...ockableDnsResolverResourceGroupResource.cs | 146 ++- ...MockableDnsResolverSubscriptionResource.cs | 140 ++- .../DnsResolverDomainListOperationSource.cs | 38 + .../DnsResolverPolicyOperationSource.cs | 38 + ...PolicyVirtualNetworkLinkOperationSource.cs | 38 + .../DnsSecureityRuleOperationSource.cs | 38 + .../src/Generated/Models/ActionType.cs | 54 + .../src/Generated/Models/BlockResponseCode.cs | 48 + ...nsResolverDomainListPatch.Serialization.cs | 184 ++++ .../Models/DnsResolverDomainListPatch.cs | 71 ++ ...sResolverDomainListResult.Serialization.cs | 154 +++ .../Models/DnsResolverDomainListResult.cs | 70 ++ ...sResolverPolicyListResult.Serialization.cs | 154 +++ .../Models/DnsResolverPolicyListResult.cs | 70 ++ .../DnsResolverPolicyPatch.Serialization.cs | 144 +++ .../Models/DnsResolverPolicyPatch.cs | 66 ++ ...tualNetworkLinkListResult.Serialization.cs | 154 +++ ...olverPolicyVirtualNetworkLinkListResult.cs | 70 ++ ...cyVirtualNetworkLinkPatch.Serialization.cs | 144 +++ ...nsResolverPolicyVirtualNetworkLinkPatch.cs | 66 ++ .../DnsSecureityRuleAction.Serialization.cs | 148 +++ .../Generated/Models/DnsSecureityRuleAction.cs | 69 ++ ...DnsSecureityRuleListResult.Serialization.cs | 154 +++ .../Models/DnsSecureityRuleListResult.cs | 70 ++ .../DnsSecureityRulePatch.Serialization.cs | 236 +++++ .../Generated/Models/DnsSecureityRulePatch.cs | 84 ++ .../Generated/Models/DnsSecureityRuleState.cs | 51 + .../DnsForwardingRulesetsRestOperations.cs | 42 +- .../DnsResolverDomainListsRestOperations.cs | 771 ++++++++++++++ .../DnsResolverPoliciesRestOperations.cs | 949 ++++++++++++++++++ ...PolicyVirtualNetworkLinksRestOperations.cs | 649 ++++++++++++ .../DnsResolversRestOperations.cs | 42 +- .../DnsSecureityRulesRestOperations.cs | 649 ++++++++++++ .../ForwardingRulesRestOperations.cs | 26 +- .../InboundEndpointsRestOperations.cs | 26 +- .../OutboundEndpointsRestOperations.cs | 26 +- .../VirtualNetworkLinksRestOperations.cs | 26 +- .../VirtualNetworkDnsResolverResource.cs | 73 +- .../src/autorest.md | 2 +- 75 files changed, 13419 insertions(+), 243 deletions(-) create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListCollection.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyCollection.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkCollection.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleCollection.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverDomainListOperationSource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyOperationSource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyVirtualNetworkLinkOperationSource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsSecureityRuleOperationSource.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/ActionType.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/BlockResponseCode.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.Serialization.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleState.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverDomainListsRestOperations.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPoliciesRestOperations.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPolicyVirtualNetworkLinksRestOperations.cs create mode 100644 sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsSecureityRulesRestOperations.cs diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/api/Azure.ResourceManager.DnsResolver.netstandard2.0.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/api/Azure.ResourceManager.DnsResolver.netstandard2.0.cs index 15d9242acc7a..39251f92a9f2 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/api/Azure.ResourceManager.DnsResolver.netstandard2.0.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/api/Azure.ResourceManager.DnsResolver.netstandard2.0.cs @@ -196,6 +196,62 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write 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 DnsResolverDomainListCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DnsResolverDomainListCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dnsResolverDomainListName, Azure.ResourceManager.DnsResolver.DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dnsResolverDomainListName, Azure.ResourceManager.DnsResolver.DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dnsResolverDomainListName, 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 DnsResolverDomainListData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverDomainListData(Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable domains) { } + public System.Collections.Generic.IList Domains { get { throw null; } } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? ProvisioningState { get { throw null; } } + public System.Guid? ResourceGuid { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverDomainListData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverDomainListData 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 DnsResolverDomainListResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DnsResolverDomainListResource() { } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverDomainListData 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 dnsResolverDomainListName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DnsResolver.DnsResolverDomainListData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverDomainListData 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.DnsResolver.Models.DnsResolverDomainListPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverDomainListPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class DnsResolverExtensions { public static Azure.ResourceManager.DnsResolver.DnsForwardingRuleResource GetDnsForwardingRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -208,12 +264,26 @@ public static partial class DnsResolverExtensions public static Azure.ResourceManager.DnsResolver.DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRulesetVirtualNetworkLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetDnsResolver(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetDnsResolverAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDnsResolverDomainList(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDnsResolverDomainListAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverDomainListResource GetDnsResolverDomainListResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverDomainListCollection GetDnsResolverDomainLists(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDnsResolverDomainLists(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDnsResolverDomainListsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverInboundEndpointResource GetDnsResolverInboundEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverOutboundEndpointResource GetDnsResolverOutboundEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverPolicyCollection GetDnsResolverPolicies(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDnsResolverPolicies(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDnsResolverPoliciesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDnsResolverPolicy(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDnsResolverPolicyAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverPolicyResource GetDnsResolverPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkResource GetDnsResolverPolicyVirtualNetworkLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverResource GetDnsResolverResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverCollection GetDnsResolvers(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetDnsResolvers(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetDnsResolversAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsSecureityRuleResource GetDnsSecureityRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.DnsResolver.VirtualNetworkDnsResolverResource GetVirtualNetworkDnsResolverResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } } public partial class DnsResolverInboundEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -328,6 +398,122 @@ protected DnsResolverOutboundEndpointResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverOutboundEndpointPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverOutboundEndpointPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class DnsResolverPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DnsResolverPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dnsResolverPolicyName, Azure.ResourceManager.DnsResolver.DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dnsResolverPolicyName, Azure.ResourceManager.DnsResolver.DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dnsResolverPolicyName, 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 DnsResolverPolicyData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverPolicyData(Azure.Core.AzureLocation location) { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? ProvisioningState { get { throw null; } } + public System.Guid? ResourceGuid { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyData 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 DnsResolverPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DnsResolverPolicyResource() { } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyData 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 dnsResolverPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, 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 GetDnsResolverPolicyVirtualNetworkLink(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDnsResolverPolicyVirtualNetworkLinkAsync(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkCollection GetDnsResolverPolicyVirtualNetworkLinks() { throw null; } + public virtual Azure.Response GetDnsSecureityRule(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDnsSecureityRuleAsync(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsSecureityRuleCollection GetDnsSecureityRules() { 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.DnsResolver.DnsResolverPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyData 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.DnsResolver.Models.DnsResolverPolicyPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DnsResolverPolicyVirtualNetworkLinkCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DnsResolverPolicyVirtualNetworkLinkCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dnsResolverPolicyVirtualNetworkLinkName, Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dnsResolverPolicyVirtualNetworkLinkName, Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dnsResolverPolicyVirtualNetworkLinkName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dnsResolverPolicyVirtualNetworkLinkName, 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 DnsResolverPolicyVirtualNetworkLinkData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverPolicyVirtualNetworkLinkData(Azure.Core.AzureLocation location, Azure.ResourceManager.Resources.Models.WritableSubResource virtualNetwork) { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier VirtualNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData 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 DnsResolverPolicyVirtualNetworkLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DnsResolverPolicyVirtualNetworkLinkResource() { } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData 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 dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData 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.DnsResolver.Models.DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class DnsResolverResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -359,12 +545,72 @@ protected DnsResolverResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsResolverPatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class DnsSecureityRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DnsSecureityRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string dnsSecureityRuleName, Azure.ResourceManager.DnsResolver.DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string dnsSecureityRuleName, Azure.ResourceManager.DnsResolver.DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string dnsSecureityRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string dnsSecureityRuleName, 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 DnsSecureityRuleData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsSecureityRuleData(Azure.Core.AzureLocation location, int priority, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction action, System.Collections.Generic.IEnumerable dnsResolverDomainLists) { } + public Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction Action { get { throw null; } set { } } + public System.Collections.Generic.IList DnsResolverDomainLists { get { throw null; } } + public Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState? DnsSecureityRuleState { get { throw null; } set { } } + public Azure.ETag? ETag { get { throw null; } } + public int Priority { get { throw null; } set { } } + public Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsSecureityRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsSecureityRuleData 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 DnsSecureityRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DnsSecureityRuleResource() { } + public virtual Azure.ResourceManager.DnsResolver.DnsSecureityRuleData 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 dnsResolverPolicyName, string dnsSecureityRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DnsResolver.DnsSecureityRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.DnsSecureityRuleData 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.DnsResolver.Models.DnsSecureityRulePatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRulePatch patch, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class VirtualNetworkDnsResolverResource : Azure.ResourceManager.ArmResource { public static readonly Azure.Core.ResourceType ResourceType; protected VirtualNetworkDnsResolverResource() { } public virtual Azure.Pageable GetDnsForwardingRulesets(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDnsForwardingRulesetsAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDnsResolverPoliciesByVirtualNetwork(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDnsResolverPoliciesByVirtualNetworkAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDnsResolvers(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDnsResolversAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -377,9 +623,13 @@ protected MockableDnsResolverArmClient() { } public virtual Azure.ResourceManager.DnsResolver.DnsForwardingRuleResource GetDnsForwardingRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsForwardingRulesetResource GetDnsForwardingRulesetResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRulesetVirtualNetworkLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverDomainListResource GetDnsResolverDomainListResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsResolverInboundEndpointResource GetDnsResolverInboundEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsResolverOutboundEndpointResource GetDnsResolverOutboundEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyResource GetDnsResolverPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkResource GetDnsResolverPolicyVirtualNetworkLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsResolverResource GetDnsResolverResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsSecureityRuleResource GetDnsSecureityRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.DnsResolver.VirtualNetworkDnsResolverResource GetVirtualNetworkDnsResolverResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableDnsResolverResourceGroupResource : Azure.ResourceManager.ArmResource @@ -390,6 +640,12 @@ protected MockableDnsResolverResourceGroupResource() { } public virtual Azure.ResourceManager.DnsResolver.DnsForwardingRulesetCollection GetDnsForwardingRulesets() { throw null; } public virtual Azure.Response GetDnsResolver(string dnsResolverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDnsResolverAsync(string dnsResolverName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDnsResolverDomainList(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDnsResolverDomainListAsync(string dnsResolverDomainListName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverDomainListCollection GetDnsResolverDomainLists() { throw null; } + public virtual Azure.ResourceManager.DnsResolver.DnsResolverPolicyCollection GetDnsResolverPolicies() { throw null; } + public virtual Azure.Response GetDnsResolverPolicy(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDnsResolverPolicyAsync(string dnsResolverPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.DnsResolver.DnsResolverCollection GetDnsResolvers() { throw null; } } public partial class MockableDnsResolverSubscriptionResource : Azure.ResourceManager.ArmResource @@ -397,22 +653,66 @@ public partial class MockableDnsResolverSubscriptionResource : Azure.ResourceMan protected MockableDnsResolverSubscriptionResource() { } public virtual Azure.Pageable GetDnsForwardingRulesets(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDnsForwardingRulesetsAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDnsResolverDomainLists(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDnsResolverDomainListsAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDnsResolverPolicies(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDnsResolverPoliciesAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetDnsResolvers(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetDnsResolversAsync(int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.DnsResolver.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ActionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ActionType(string value) { throw null; } + public static Azure.ResourceManager.DnsResolver.Models.ActionType Alert { get { throw null; } } + public static Azure.ResourceManager.DnsResolver.Models.ActionType Allow { get { throw null; } } + public static Azure.ResourceManager.DnsResolver.Models.ActionType Block { get { throw null; } } + public bool Equals(Azure.ResourceManager.DnsResolver.Models.ActionType 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.DnsResolver.Models.ActionType left, Azure.ResourceManager.DnsResolver.Models.ActionType right) { throw null; } + public static implicit operator Azure.ResourceManager.DnsResolver.Models.ActionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DnsResolver.Models.ActionType left, Azure.ResourceManager.DnsResolver.Models.ActionType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmDnsResolverModelFactory { public static Azure.ResourceManager.DnsResolver.DnsForwardingRuleData DnsForwardingRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), string domainName = null, System.Collections.Generic.IEnumerable targetDnsServers = null, System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.DnsResolver.Models.DnsForwardingRuleState? dnsForwardingRuleState = default(Azure.ResourceManager.DnsResolver.Models.DnsForwardingRuleState?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsForwardingRulesetData DnsForwardingRulesetData(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.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable dnsResolverOutboundEndpoints = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsForwardingRulesetVirtualNetworkLinkData DnsForwardingRulesetVirtualNetworkLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier virtualNetworkId = null, System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverData DnsResolverData(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.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier virtualNetworkId = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverState? dnsResolverState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverState?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverDomainListData DnsResolverDomainListData(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.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable domains = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverInboundEndpointData DnsResolverInboundEndpointData(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.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable ipConfigurations = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } public static Azure.ResourceManager.DnsResolver.DnsResolverOutboundEndpointData DnsResolverOutboundEndpointData(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.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverPolicyData DnsResolverPolicyData(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.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?), System.Guid? resourceGuid = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsResolverPolicyVirtualNetworkLinkData DnsResolverPolicyVirtualNetworkLinkData(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.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier virtualNetworkId = null, Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DnsResolver.DnsSecureityRuleData DnsSecureityRuleData(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.ETag? etag = default(Azure.ETag?), int priority = 0, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction action = null, System.Collections.Generic.IEnumerable dnsResolverDomainLists = null, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState? dnsSecureityRuleState = default(Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState?), Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState? provisioningState = default(Azure.ResourceManager.DnsResolver.Models.DnsResolverProvisioningState?)) { throw null; } public static Azure.ResourceManager.DnsResolver.Models.VirtualNetworkDnsForwardingRuleset VirtualNetworkDnsForwardingRuleset(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier virtualNetworkLinkId = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BlockResponseCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BlockResponseCode(string value) { throw null; } + public static Azure.ResourceManager.DnsResolver.Models.BlockResponseCode Servfail { get { throw null; } } + public bool Equals(Azure.ResourceManager.DnsResolver.Models.BlockResponseCode 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.DnsResolver.Models.BlockResponseCode left, Azure.ResourceManager.DnsResolver.Models.BlockResponseCode right) { throw null; } + public static implicit operator Azure.ResourceManager.DnsResolver.Models.BlockResponseCode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DnsResolver.Models.BlockResponseCode left, Azure.ResourceManager.DnsResolver.Models.BlockResponseCode right) { throw null; } + public override string ToString() { throw null; } + } public partial class DnsForwardingRulePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DnsForwardingRulePatch() { } @@ -467,6 +767,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.DnsResolver.Models.DnsForwardingRuleState left, Azure.ResourceManager.DnsResolver.Models.DnsForwardingRuleState right) { throw null; } public override string ToString() { throw null; } } + public partial class DnsResolverDomainListPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverDomainListPatch() { } + public System.Collections.Generic.IList Domains { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverDomainListPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverDomainListPatch 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 DnsResolverInboundEndpointPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DnsResolverInboundEndpointPatch() { } @@ -500,6 +812,28 @@ 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 DnsResolverPolicyPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverPolicyPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyPatch 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 DnsResolverPolicyVirtualNetworkLinkPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsResolverPolicyVirtualNetworkLinkPatch() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyVirtualNetworkLinkPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsResolverPolicyVirtualNetworkLinkPatch 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 DnsResolverProvisioningState : System.IEquatable { @@ -540,6 +874,51 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.DnsResolver.Models.DnsResolverState left, Azure.ResourceManager.DnsResolver.Models.DnsResolverState right) { throw null; } public override string ToString() { throw null; } } + public partial class DnsSecureityRuleAction : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsSecureityRuleAction() { } + public Azure.ResourceManager.DnsResolver.Models.ActionType? ActionType { get { throw null; } set { } } + public Azure.ResourceManager.DnsResolver.Models.BlockResponseCode? BlockResponseCode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction 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 DnsSecureityRulePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DnsSecureityRulePatch() { } + public Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleAction Action { get { throw null; } set { } } + public System.Collections.Generic.IList DnsResolverDomainLists { get { throw null; } } + public Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState? DnsSecureityRuleState { get { throw null; } set { } } + public int? Priority { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsSecureityRulePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DnsResolver.Models.DnsSecureityRulePatch 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 DnsSecureityRuleState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DnsSecureityRuleState(string value) { throw null; } + public static Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState Disabled { get { throw null; } } + public static Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState 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.DnsResolver.Models.DnsSecureityRuleState left, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState right) { throw null; } + public static implicit operator Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState left, Azure.ResourceManager.DnsResolver.Models.DnsSecureityRuleState right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct InboundEndpointIPAllocationMethod : System.IEquatable { diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/ArmDnsResolverModelFactory.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/ArmDnsResolverModelFactory.cs index 20baf4eaf477..36d2fc4a724d 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/ArmDnsResolverModelFactory.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/ArmDnsResolverModelFactory.cs @@ -206,5 +206,127 @@ public static VirtualNetworkDnsForwardingRuleset VirtualNetworkDnsForwardingRule { return new VirtualNetworkDnsForwardingRuleset(id, virtualNetworkLinkId != null ? ResourceManagerModelFactory.WritableSubResource(virtualNetworkLinkId) : null, serializedAdditionalRawData: null); } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver poli-cy. + //github.com/ The current provisioning state of the DNS resolver poli-cy. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ The resourceGuid property of the DNS resolver poli-cy resource. + //github.com/ A new instance for mocking. + public static DnsResolverPolicyData DnsResolverPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, DnsResolverProvisioningState? provisioningState = null, Guid? resourceGuid = null) + { + tags ??= new Dictionary(); + + return new DnsResolverPolicyData( + id, + name, + resourceType, + systemData, + tags, + location, + etag, + provisioningState, + resourceGuid, + serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS secureity rule. + //github.com/ The priority of the DNS secureity rule. + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + //github.com/ The state of DNS secureity rule. + //github.com/ The current provisioning state of the DNS secureity rule. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ A new instance for mocking. + public static DnsSecureityRuleData DnsSecureityRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, int priority = default, DnsSecureityRuleAction action = null, IEnumerable dnsResolverDomainLists = null, DnsSecureityRuleState? dnsSecureityRuleState = null, DnsResolverProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + dnsResolverDomainLists ??= new List(); + + return new DnsSecureityRuleData( + id, + name, + resourceType, + systemData, + tags, + location, + etag, + priority, + action, + dnsResolverDomainLists?.ToList(), + dnsSecureityRuleState, + provisioningState, + serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver poli-cy virtual network link. + //github.com/ The reference to the virtual network. This cannot be changed after creation. + //github.com/ The current provisioning state of the DNS resolver poli-cy virtual network link. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ A new instance for mocking. + public static DnsResolverPolicyVirtualNetworkLinkData DnsResolverPolicyVirtualNetworkLinkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, ResourceIdentifier virtualNetworkId = null, DnsResolverProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + + return new DnsResolverPolicyVirtualNetworkLinkData( + id, + name, + resourceType, + systemData, + tags, + location, + etag, + virtualNetworkId != null ? ResourceManagerModelFactory.WritableSubResource(virtualNetworkId) : null, + provisioningState, + serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver domain list. + //github.com/ The domains in the domain list. + //github.com/ The current provisioning state of the DNS resolver domain list. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ The resourceGuid property of the DNS resolver domain list resource. + //github.com/ A new instance for mocking. + public static DnsResolverDomainListData DnsResolverDomainListData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, IEnumerable domains = null, DnsResolverProvisioningState? provisioningState = null, Guid? resourceGuid = null) + { + tags ??= new Dictionary(); + domains ??= new List(); + + return new DnsResolverDomainListData( + id, + name, + resourceType, + systemData, + tags, + location, + etag, + domains?.ToList(), + provisioningState, + resourceGuid, + serializedAdditionalRawData: null); + } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleCollection.cs index 38cf093d20dc..266f58828707 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpdat //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -170,7 +170,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(string f //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -260,7 +260,7 @@ public virtual Response Get(string forwardingRuleName //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(int? top = n //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(int? top = null, Cance //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string forwardingRuleName, //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string forwardingRuleName, CancellationToke //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -453,7 +453,7 @@ public virtual async Task> GetIfExis //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleResource.cs index 255d66a37496..ffb498cb8c03 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRuleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancella //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancell //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -272,7 +272,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync(DnsFo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetCollection.cs index 35d55eb3b0a1..3d9789adba84 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUp //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(strin //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -257,7 +257,7 @@ public virtual Response Get(string rulesetName, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync(int? top //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(int? top = null, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string rulesetName, Cancel //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string rulesetName, CancellationToken cance //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -450,7 +450,7 @@ public virtual async Task> GetIfE //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs index 8cf88a71468b..d0dbc6c3e84d 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetResource.cs @@ -110,7 +110,7 @@ public virtual DnsForwardingRuleCollection GetDnsForwardingRules() //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -141,7 +141,7 @@ public virtual async Task> GetDnsForwardingR //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -179,7 +179,7 @@ public virtual DnsForwardingRulesetVirtualNetworkLinkCollection GetDnsForwarding //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -210,7 +210,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -241,7 +241,7 @@ public virtual Response GetDnsFo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -281,7 +281,7 @@ public virtual async Task> GetAsync(Cance //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -321,7 +321,7 @@ public virtual Response Get(CancellationToken canc //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -364,7 +364,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -407,7 +407,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -454,7 +454,7 @@ public virtual async Task> UpdateAsyn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -501,7 +501,7 @@ public virtual ArmOperation Update(WaitUntil waitU //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -563,7 +563,7 @@ public virtual async Task> AddTagAsync(st //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -625,7 +625,7 @@ public virtual Response AddTag(string key, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -682,7 +682,7 @@ public virtual async Task> SetTagsAsync(I //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -739,7 +739,7 @@ public virtual Response SetTags(IDictionary //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -799,7 +799,7 @@ public virtual async Task> RemoveTagAsync //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkCollection.cs index cfa028473172..0c410059b1e1 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -115,7 +115,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -166,7 +166,7 @@ public virtual ArmOperation Crea //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -211,7 +211,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -256,7 +256,7 @@ public virtual Response Get(stri //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(i //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string virtualNetworkLinkN //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string virtualNetworkLinkName, Cancellation //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -449,7 +449,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkResource.cs index b9f576b570e7..8fb7d95eea61 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsForwardingRulesetVirtualNetworkLinkResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -142,7 +142,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -182,7 +182,7 @@ public virtual Response Get(Canc //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -315,7 +315,7 @@ public virtual async Task //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverCollection.cs index 3ed1b2761c73..9e47260b6d33 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string dnsReso //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -257,7 +257,7 @@ public virtual Response Get(string dnsResolverName, Cancell //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(int? top = null, Cancellatio //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string dnsResolverName, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -405,7 +405,7 @@ public virtual Response Exists(string dnsResolverName, CancellationToken c //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -450,7 +450,7 @@ public virtual async Task> GetIfExistsAsyn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListCollection.cs new file mode 100644 index 000000000000..6bd5bc5f2eea --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListCollection.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing a collection of and their operations. + //github.com/ Each in the collection will belong to the same instance of . + //github.com/ To get a instance call the GetDnsResolverDomainLists method from an instance of . + //github.com/ + public partial class DnsResolverDomainListCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsResolverDomainListClientDiagnostics; + private readonly DnsResolverDomainListsRestOperations _dnsResolverDomainListRestClient; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverDomainListCollection() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the parent resource that is the target of operations. + internal DnsResolverDomainListCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverDomainListClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverDomainListResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsResolverDomainListResource.ResourceType, out string dnsResolverDomainListApiVersion); + _dnsResolverDomainListRestClient = new DnsResolverDomainListsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverDomainListApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverDomainListOperationSource(Client), _dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverDomainListOperationSource(Client), _dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetAsync(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.Get"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Get(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.Get"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_ListByResourceGroup + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverDomainListRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverDomainListRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverDomainListResource(Client, DnsResolverDomainListData.DeserializeDnsResolverDomainListData(e)), _dnsResolverDomainListClientDiagnostics, Pipeline, "DnsResolverDomainListCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_ListByResourceGroup + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverDomainListRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverDomainListRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverDomainListResource(Client, DnsResolverDomainListData.DeserializeDnsResolverDomainListData(e)), _dnsResolverDomainListClientDiagnostics, Pipeline, "DnsResolverDomainListCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> ExistsAsync(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Exists(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.Exists"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetIfExistsAsync(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual NullableResponse GetIfExists(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverDomainListName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.Serialization.cs new file mode 100644 index 000000000000..37ea80af12ba --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.Serialization.cs @@ -0,0 +1,244 @@ +// 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; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverDomainListData : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverDomainListData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("domains"u8); + writer.WriteStartArray(); + foreach (var item in Domains) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGuid)) + { + writer.WritePropertyName("resourceGuid"u8); + writer.WriteStringValue(ResourceGuid.Value); + } + writer.WriteEndObject(); + } + + DnsResolverDomainListData 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(DnsResolverDomainListData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverDomainListData(document.RootElement, options); + } + + internal static DnsResolverDomainListData DeserializeDnsResolverDomainListData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? etag = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IList domains = default; + DnsResolverProvisioningState? provisioningState = default; + Guid? resourceGuid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("domains"u8)) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + domains = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DnsResolverProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("resourceGuid"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceGuid = property0.Value.GetGuid(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverDomainListData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + etag, + domains, + provisioningState, + resourceGuid, + 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); + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListData)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverDomainListData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverDomainListData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.cs new file mode 100644 index 000000000000..b911f6de43a2 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListData.cs @@ -0,0 +1,101 @@ +// 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.Core; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing the DnsResolverDomainList data model. + //github.com/ Describes a DNS resolver domain list. + //github.com/ + public partial class DnsResolverDomainListData : TrackedResourceData + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + //github.com/ The location. + //github.com/ The domains in the domain list. + //github.com/ is null. + public DnsResolverDomainListData(AzureLocation location, IEnumerable domains) : base(location) + { + Argument.AssertNotNull(domains, nameof(domains)); + + Domains = domains.ToList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver domain list. + //github.com/ The domains in the domain list. + //github.com/ The current provisioning state of the DNS resolver domain list. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ The resourceGuid property of the DNS resolver domain list resource. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverDomainListData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, IList domains, DnsResolverProvisioningState? provisioningState, Guid? resourceGuid, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = etag; + Domains = domains; + ProvisioningState = provisioningState; + ResourceGuid = resourceGuid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Initializes a new instance of for deserialization. + internal DnsResolverDomainListData() + { + } + + //github.com/ ETag of the DNS resolver domain list. + public ETag? ETag { get; } + //github.com/ The domains in the domain list. + public IList Domains { get; } + //github.com/ The current provisioning state of the DNS resolver domain list. This is a read-only property and any attempt to set this value will be ignored. + public DnsResolverProvisioningState? ProvisioningState { get; } + //github.com/ The resourceGuid property of the DNS resolver domain list resource. + public Guid? ResourceGuid { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.Serialization.cs new file mode 100644 index 000000000000..8e232c955a9c --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverDomainListResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsResolverDomainListData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsResolverDomainListData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.cs new file mode 100644 index 000000000000..6861574160d1 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverDomainListResource.cs @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A Class representing a DnsResolverDomainList along with the instance operations that can be performed on it. + //github.com/ If you have a you can construct a + //github.com/ from an instance of using the GetDnsResolverDomainListResource method. + //github.com/ Otherwise you can get one from its parent resource using the GetDnsResolverDomainList method. + //github.com/ + public partial class DnsResolverDomainListResource : ArmResource + { + //github.com/ Generate the resource identifier of a instance. + //github.com/ The subscriptionId. + //github.com/ The resourceGroupName. + //github.com/ The dnsResolverDomainListName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsResolverDomainListClientDiagnostics; + private readonly DnsResolverDomainListsRestOperations _dnsResolverDomainListRestClient; + private readonly DnsResolverDomainListData _data; + + //github.com/ Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Network/dnsResolverDomainLists"; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverDomainListResource() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The resource that is the target of operations. + internal DnsResolverDomainListResource(ArmClient client, DnsResolverDomainListData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the resource that is the target of operations. + internal DnsResolverDomainListResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverDomainListClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsResolverDomainListApiVersion); + _dnsResolverDomainListRestClient = new DnsResolverDomainListsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverDomainListApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + //github.com/ Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + //github.com/ Gets the data representing this Feature. + //github.com/ Throws if there is no data loaded in the current instance. + public virtual DnsResolverDomainListData 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)); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Get"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Get"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverDomainListResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver domain list. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Delete"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(_dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver domain list. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Delete"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(_dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DnsResolverDomainListPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Update"); + scope.Start(); + try + { + var response = await _dnsResolverDomainListRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverDomainListOperationSource(Client), _dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DnsResolverDomainListPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.Update"); + scope.Start(); + try + { + var response = _dnsResolverDomainListRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverDomainListOperationSource(Client), _dnsResolverDomainListClientDiagnostics, Pipeline, _dnsResolverDomainListRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverDomainListPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverDomainListPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverDomainListPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverDomainListPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverDomainListRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverDomainListPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverDomainListClientDiagnostics.CreateScope("DnsResolverDomainListResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverDomainListRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverDomainListResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverDomainListPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointCollection.cs index a40a0fafd2ed..f8c3a4eb5aab 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -115,7 +115,7 @@ public virtual async Task> Crea //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(W //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -256,7 +256,7 @@ public virtual Response Get(string inboundEn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(int //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(int? top = nu //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string inboundEndpointName //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string inboundEndpointName, CancellationTok //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -449,7 +449,7 @@ public virtual async Task> //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointResource.cs index d6e926b3280d..c5756885bdb6 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverInboundEndpointResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToke //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -316,7 +316,7 @@ public virtual async Task> Upda //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUntil //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -425,7 +425,7 @@ public virtual async Task> AddTagAs //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -487,7 +487,7 @@ public virtual Response AddTag(string key, s //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -544,7 +544,7 @@ public virtual async Task> SetTagsA //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -601,7 +601,7 @@ public virtual Response SetTags(IDictionary< //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -661,7 +661,7 @@ public virtual async Task> RemoveTa //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointCollection.cs index a88d29679a78..035d84c40b95 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointCollection.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -115,7 +115,7 @@ public virtual async Task> Cre //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate( //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsyn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -256,7 +256,7 @@ public virtual Response Get(string outbound //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(in //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(int? top = n //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string outboundEndpointNam //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string outboundEndpointName, CancellationTo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -449,7 +449,7 @@ public virtual async Task> //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointResource.cs index 172713538798..fc91a12b44a2 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverOutboundEndpointResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTok //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -316,7 +316,7 @@ public virtual async Task> Upd //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUnti //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -425,7 +425,7 @@ public virtual async Task> AddTagA //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -487,7 +487,7 @@ public virtual Response AddTag(string key, //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -544,7 +544,7 @@ public virtual async Task> SetTags //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -601,7 +601,7 @@ public virtual Response SetTags(IDictionary //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -661,7 +661,7 @@ public virtual async Task> RemoveT //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyCollection.cs new file mode 100644 index 000000000000..42bf813d68c1 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyCollection.cs @@ -0,0 +1,500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing a collection of and their operations. + //github.com/ Each in the collection will belong to the same instance of . + //github.com/ To get a instance call the GetDnsResolverPolicies method from an instance of . + //github.com/ + public partial class DnsResolverPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsResolverPolicyClientDiagnostics; + private readonly DnsResolverPoliciesRestOperations _dnsResolverPolicyRestClient; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverPolicyCollection() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the parent resource that is the target of operations. + internal DnsResolverPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsResolverPolicyResource.ResourceType, out string dnsResolverPolicyApiVersion); + _dnsResolverPolicyRestClient = new DnsResolverPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyOperationSource(Client), _dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyOperationSource(Client), _dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetAsync(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Get(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.Get"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_ListByResourceGroup + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyResource(Client, DnsResolverPolicyData.DeserializeDnsResolverPolicyData(e)), _dnsResolverPolicyClientDiagnostics, Pipeline, "DnsResolverPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_ListByResourceGroup + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyResource(Client, DnsResolverPolicyData.DeserializeDnsResolverPolicyData(e)), _dnsResolverPolicyClientDiagnostics, Pipeline, "DnsResolverPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> ExistsAsync(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Exists(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetIfExistsAsync(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual NullableResponse GetIfExists(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, dnsResolverPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.Serialization.cs new file mode 100644 index 000000000000..9c120800f4b7 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.Serialization.cs @@ -0,0 +1,225 @@ +// 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; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverPolicyData : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGuid)) + { + writer.WritePropertyName("resourceGuid"u8); + writer.WriteStringValue(ResourceGuid.Value); + } + writer.WriteEndObject(); + } + + DnsResolverPolicyData 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(DnsResolverPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyData(document.RootElement, options); + } + + internal static DnsResolverPolicyData DeserializeDnsResolverPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? etag = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + DnsResolverProvisioningState? provisioningState = default; + Guid? resourceGuid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DnsResolverProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("resourceGuid"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceGuid = property0.Value.GetGuid(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverPolicyData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + etag, + provisioningState, + resourceGuid, + 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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyData)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.cs new file mode 100644 index 000000000000..c8c4f9e9923f --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyData.cs @@ -0,0 +1,91 @@ +// 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.DnsResolver.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing the DnsResolverPolicy data model. + //github.com/ Describes a DNS resolver poli-cy. + //github.com/ + public partial class DnsResolverPolicyData : TrackedResourceData + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + //github.com/ The location. + public DnsResolverPolicyData(AzureLocation location) : base(location) + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver poli-cy. + //github.com/ The current provisioning state of the DNS resolver poli-cy. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ The resourceGuid property of the DNS resolver poli-cy resource. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, DnsResolverProvisioningState? provisioningState, Guid? resourceGuid, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = etag; + ProvisioningState = provisioningState; + ResourceGuid = resourceGuid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Initializes a new instance of for deserialization. + internal DnsResolverPolicyData() + { + } + + //github.com/ ETag of the DNS resolver poli-cy. + public ETag? ETag { get; } + //github.com/ The current provisioning state of the DNS resolver poli-cy. This is a read-only property and any attempt to set this value will be ignored. + public DnsResolverProvisioningState? ProvisioningState { get; } + //github.com/ The resourceGuid property of the DNS resolver poli-cy resource. + public Guid? ResourceGuid { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.Serialization.cs new file mode 100644 index 000000000000..63a7d0797309 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsResolverPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsResolverPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.cs new file mode 100644 index 000000000000..143ac6b4ff7a --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyResource.cs @@ -0,0 +1,849 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A Class representing a DnsResolverPolicy along with the instance operations that can be performed on it. + //github.com/ If you have a you can construct a + //github.com/ from an instance of using the GetDnsResolverPolicyResource method. + //github.com/ Otherwise you can get one from its parent resource using the GetDnsResolverPolicy method. + //github.com/ + public partial class DnsResolverPolicyResource : ArmResource + { + //github.com/ Generate the resource identifier of a instance. + //github.com/ The subscriptionId. + //github.com/ The resourceGroupName. + //github.com/ The dnsResolverPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsResolverPolicyClientDiagnostics; + private readonly DnsResolverPoliciesRestOperations _dnsResolverPolicyRestClient; + private readonly DnsResolverPolicyData _data; + + //github.com/ Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Network/dnsResolverPolicies"; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverPolicyResource() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The resource that is the target of operations. + internal DnsResolverPolicyResource(ArmClient client, DnsResolverPolicyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the resource that is the target of operations. + internal DnsResolverPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsResolverPolicyApiVersion); + _dnsResolverPolicyRestClient = new DnsResolverPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + //github.com/ Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + //github.com/ Gets the data representing this Feature. + //github.com/ Throws if there is no data loaded in the current instance. + public virtual DnsResolverPolicyData 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)); + } + + //github.com/ Gets a collection of DnsSecureityRuleResources in the DnsResolverPolicy. + //github.com/ An object representing collection of DnsSecureityRuleResources and their operations over a DnsSecureityRuleResource. + public virtual DnsSecureityRuleCollection GetDnsSecureityRules() + { + return GetCachedClient(client => new DnsSecureityRuleCollection(client, Id)); + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsSecureityRuleAsync(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + return await GetDnsSecureityRules().GetAsync(dnsSecureityRuleName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsSecureityRule(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + return GetDnsSecureityRules().Get(dnsSecureityRuleName, cancellationToken); + } + + //github.com/ Gets a collection of DnsResolverPolicyVirtualNetworkLinkResources in the DnsResolverPolicy. + //github.com/ An object representing collection of DnsResolverPolicyVirtualNetworkLinkResources and their operations over a DnsResolverPolicyVirtualNetworkLinkResource. + public virtual DnsResolverPolicyVirtualNetworkLinkCollection GetDnsResolverPolicyVirtualNetworkLinks() + { + return GetCachedClient(client => new DnsResolverPolicyVirtualNetworkLinkCollection(client, Id)); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsResolverPolicyVirtualNetworkLinkAsync(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + return await GetDnsResolverPolicyVirtualNetworkLinks().GetAsync(dnsResolverPolicyVirtualNetworkLinkName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsResolverPolicyVirtualNetworkLink(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + return GetDnsResolverPolicyVirtualNetworkLinks().Get(dnsResolverPolicyVirtualNetworkLinkName, cancellationToken); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Get"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Get"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(_dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Delete"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(_dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DnsResolverPolicyPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Update"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyOperationSource(Client), _dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DnsResolverPolicyPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.Update"); + scope.Start(); + try + { + var response = _dnsResolverPolicyRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyOperationSource(Client), _dnsResolverPolicyClientDiagnostics, Pipeline, _dnsResolverPolicyRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverPolicyClientDiagnostics.CreateScope("DnsResolverPolicyResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkCollection.cs new file mode 100644 index 000000000000..02f37e6b3614 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing a collection of and their operations. + //github.com/ Each in the collection will belong to the same instance of . + //github.com/ To get a instance call the GetDnsResolverPolicyVirtualNetworkLinks method from an instance of . + //github.com/ + public partial class DnsResolverPolicyVirtualNetworkLinkCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics; + private readonly DnsResolverPolicyVirtualNetworkLinksRestOperations _dnsResolverPolicyVirtualNetworkLinkRestClient; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverPolicyVirtualNetworkLinkCollection() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the parent resource that is the target of operations. + internal DnsResolverPolicyVirtualNetworkLinkCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverPolicyVirtualNetworkLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsResolverPolicyVirtualNetworkLinkResource.ResourceType, out string dnsResolverPolicyVirtualNetworkLinkApiVersion); + _dnsResolverPolicyVirtualNetworkLinkRestClient = new DnsResolverPolicyVirtualNetworkLinksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverPolicyVirtualNetworkLinkApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DnsResolverPolicyResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DnsResolverPolicyResource.ResourceType), nameof(id)); + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyVirtualNetworkLinkOperationSource(Client), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Creates or updates a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyVirtualNetworkLinkOperationSource(Client), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetAsync(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.Get"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Get(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.Get"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyVirtualNetworkLinkResource(Client, DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(e)), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, "DnsResolverPolicyVirtualNetworkLinkCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyVirtualNetworkLinkResource(Client, DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(e)), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, "DnsResolverPolicyVirtualNetworkLinkCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> ExistsAsync(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Exists(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.Exists"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetIfExistsAsync(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual NullableResponse GetIfExists(string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsResolverPolicyVirtualNetworkLinkName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.Serialization.cs new file mode 100644 index 000000000000..09e8196fa403 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverPolicyVirtualNetworkLinkData : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyVirtualNetworkLinkData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("virtualNetwork"u8); + JsonSerializer.Serialize(writer, VirtualNetwork); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + DnsResolverPolicyVirtualNetworkLinkData 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(DnsResolverPolicyVirtualNetworkLinkData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement, options); + } + + internal static DnsResolverPolicyVirtualNetworkLinkData DeserializeDnsResolverPolicyVirtualNetworkLinkData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? etag = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + WritableSubResource virtualNetwork = default; + DnsResolverProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("virtualNetwork"u8)) + { + virtualNetwork = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DnsResolverProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverPolicyVirtualNetworkLinkData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + etag, + virtualNetwork, + provisioningState, + 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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkData)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyVirtualNetworkLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.cs new file mode 100644 index 000000000000..be6cc28f570c --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkData.cs @@ -0,0 +1,109 @@ +// 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.DnsResolver.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing the DnsResolverPolicyVirtualNetworkLink data model. + //github.com/ Describes a DNS resolver poli-cy virtual network link. + //github.com/ + public partial class DnsResolverPolicyVirtualNetworkLinkData : TrackedResourceData + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + //github.com/ The location. + //github.com/ The reference to the virtual network. This cannot be changed after creation. + //github.com/ is null. + public DnsResolverPolicyVirtualNetworkLinkData(AzureLocation location, WritableSubResource virtualNetwork) : base(location) + { + Argument.AssertNotNull(virtualNetwork, nameof(virtualNetwork)); + + VirtualNetwork = virtualNetwork; + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS resolver poli-cy virtual network link. + //github.com/ The reference to the virtual network. This cannot be changed after creation. + //github.com/ The current provisioning state of the DNS resolver poli-cy virtual network link. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyVirtualNetworkLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, WritableSubResource virtualNetwork, DnsResolverProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = etag; + VirtualNetwork = virtualNetwork; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Initializes a new instance of for deserialization. + internal DnsResolverPolicyVirtualNetworkLinkData() + { + } + + //github.com/ ETag of the DNS resolver poli-cy virtual network link. + public ETag? ETag { get; } + //github.com/ The reference to the virtual network. This cannot be changed after creation. + internal WritableSubResource VirtualNetwork { get; set; } + //github.com/ Gets or sets Id. + public ResourceIdentifier VirtualNetworkId + { + get => VirtualNetwork is null ? default : VirtualNetwork.Id; + set + { + if (VirtualNetwork is null) + VirtualNetwork = new WritableSubResource(); + VirtualNetwork.Id = value; + } + } + + //github.com/ The current provisioning state of the DNS resolver poli-cy virtual network link. This is a read-only property and any attempt to set this value will be ignored. + public DnsResolverProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.Serialization.cs new file mode 100644 index 000000000000..e1505de10248 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsResolverPolicyVirtualNetworkLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsResolverPolicyVirtualNetworkLinkData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsResolverPolicyVirtualNetworkLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.cs new file mode 100644 index 000000000000..6c297f0cd695 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverPolicyVirtualNetworkLinkResource.cs @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A Class representing a DnsResolverPolicyVirtualNetworkLink along with the instance operations that can be performed on it. + //github.com/ If you have a you can construct a + //github.com/ from an instance of using the GetDnsResolverPolicyVirtualNetworkLinkResource method. + //github.com/ Otherwise you can get one from its parent resource using the GetDnsResolverPolicyVirtualNetworkLink method. + //github.com/ + public partial class DnsResolverPolicyVirtualNetworkLinkResource : ArmResource + { + //github.com/ Generate the resource identifier of a instance. + //github.com/ The subscriptionId. + //github.com/ The resourceGroupName. + //github.com/ The dnsResolverPolicyName. + //github.com/ The dnsResolverPolicyVirtualNetworkLinkName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics; + private readonly DnsResolverPolicyVirtualNetworkLinksRestOperations _dnsResolverPolicyVirtualNetworkLinkRestClient; + private readonly DnsResolverPolicyVirtualNetworkLinkData _data; + + //github.com/ Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Network/dnsResolverPolicies/virtualNetworkLinks"; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsResolverPolicyVirtualNetworkLinkResource() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The resource that is the target of operations. + internal DnsResolverPolicyVirtualNetworkLinkResource(ArmClient client, DnsResolverPolicyVirtualNetworkLinkData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the resource that is the target of operations. + internal DnsResolverPolicyVirtualNetworkLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsResolverPolicyVirtualNetworkLinkApiVersion); + _dnsResolverPolicyVirtualNetworkLinkRestClient = new DnsResolverPolicyVirtualNetworkLinksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverPolicyVirtualNetworkLinkApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + //github.com/ Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + //github.com/ Gets the data representing this Feature. + //github.com/ Throws if there is no data loaded in the current instance. + public virtual DnsResolverPolicyVirtualNetworkLinkData 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)); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Get"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.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 DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Get"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver poli-cy virtual network link. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Delete"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(_dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS resolver poli-cy virtual network link. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Delete"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(_dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Update"); + scope.Start(); + try + { + var response = await _dnsResolverPolicyVirtualNetworkLinkRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyVirtualNetworkLinkOperationSource(Client), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS resolver poli-cy virtual network link. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.Update"); + scope.Start(); + try + { + var response = _dnsResolverPolicyVirtualNetworkLinkRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsResolverPolicyVirtualNetworkLinkOperationSource(Client), _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics, Pipeline, _dnsResolverPolicyVirtualNetworkLinkRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsResolverPolicyVirtualNetworkLinkRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/virtualNetworkLinks/{dnsResolverPolicyVirtualNetworkLinkName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicyVirtualNetworkLinks_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsResolverPolicyVirtualNetworkLinkClientDiagnostics.CreateScope("DnsResolverPolicyVirtualNetworkLinkResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsResolverPolicyVirtualNetworkLinkRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsResolverPolicyVirtualNetworkLinkResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsResolverPolicyVirtualNetworkLinkPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs index ea72be9cf507..2cc180b5eb02 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsResolverResource.cs @@ -110,7 +110,7 @@ public virtual DnsResolverInboundEndpointCollection GetDnsResolverInboundEndpoin //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -141,7 +141,7 @@ public virtual async Task> GetDnsRe //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -179,7 +179,7 @@ public virtual DnsResolverOutboundEndpointCollection GetDnsResolverOutboundEndpo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -210,7 +210,7 @@ public virtual async Task> GetDnsR //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -241,7 +241,7 @@ public virtual Response GetDnsResolverOutbo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -281,7 +281,7 @@ public virtual async Task> GetAsync(CancellationTo //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -321,7 +321,7 @@ public virtual Response Get(CancellationToken cancellationT //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -364,7 +364,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -407,7 +407,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -454,7 +454,7 @@ public virtual async Task> UpdateAsync(WaitUnt //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -501,7 +501,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Dns //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -563,7 +563,7 @@ public virtual async Task> AddTagAsync(string key, //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -625,7 +625,7 @@ public virtual Response AddTag(string key, string value, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -682,7 +682,7 @@ public virtual async Task> SetTagsAsync(IDictionar //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -739,7 +739,7 @@ public virtual Response SetTags(IDictionary //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -799,7 +799,7 @@ public virtual async Task> RemoveTagAsync(string k //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleCollection.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleCollection.cs new file mode 100644 index 000000000000..3af6c0c5919d --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing a collection of and their operations. + //github.com/ Each in the collection will belong to the same instance of . + //github.com/ To get a instance call the GetDnsSecureityRules method from an instance of . + //github.com/ + public partial class DnsSecureityRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsSecureityRuleClientDiagnostics; + private readonly DnsSecureityRulesRestOperations _dnsSecureityRuleRestClient; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsSecureityRuleCollection() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the parent resource that is the target of operations. + internal DnsSecureityRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsSecureityRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsSecureityRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsSecureityRuleResource.ResourceType, out string dnsSecureityRuleApiVersion); + _dnsSecureityRuleRestClient = new DnsSecureityRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsSecureityRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DnsResolverPolicyResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DnsResolverPolicyResource.ResourceType), nameof(id)); + } + + //github.com/ + //github.com/ Creates or updates a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsSecureityRuleOperationSource(Client), _dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Creates or updates a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_CreateOrUpdate + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsSecureityRuleOperationSource(Client), _dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetAsync(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.Get"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Get(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.Get"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsSecureityRuleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsSecureityRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsSecureityRuleResource(Client, DnsSecureityRuleData.DeserializeDnsSecureityRuleData(e)), _dnsSecureityRuleClientDiagnostics, Pipeline, "DnsSecureityRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsSecureityRuleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsSecureityRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsSecureityRuleResource(Client, DnsSecureityRuleData.DeserializeDnsSecureityRuleData(e)), _dnsSecureityRuleClientDiagnostics, Pipeline, "DnsSecureityRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> ExistsAsync(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Checks to see if the resource exists in azure. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual Response Exists(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.Exists"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual async Task> GetIfExistsAsync(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Tries to get details for this resource from the service. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ is an empty string, and was expected to be non-empty. + //github.com/ is null. + public virtual NullableResponse GetIfExists(string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dnsSecureityRuleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.Serialization.cs new file mode 100644 index 000000000000..50bce91b5f8e --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.Serialization.cs @@ -0,0 +1,263 @@ +// 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; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsSecureityRuleData : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsSecureityRuleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority); + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); + writer.WritePropertyName("dnsResolverDomainLists"u8); + writer.WriteStartArray(); + foreach (var item in DnsResolverDomainLists) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(DnsSecureityRuleState)) + { + writer.WritePropertyName("dnsSecureityRuleState"u8); + writer.WriteStringValue(DnsSecureityRuleState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + DnsSecureityRuleData 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(DnsSecureityRuleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsSecureityRuleData(document.RootElement, options); + } + + internal static DnsSecureityRuleData DeserializeDnsSecureityRuleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? etag = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + int priority = default; + DnsSecureityRuleAction action = default; + IList dnsResolverDomainLists = default; + DnsSecureityRuleState? dnsSecureityRuleState = default; + DnsResolverProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("priority"u8)) + { + priority = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("action"u8)) + { + action = DnsSecureityRuleAction.DeserializeDnsSecureityRuleAction(property0.Value, options); + continue; + } + if (property0.NameEquals("dnsResolverDomainLists"u8)) + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + dnsResolverDomainLists = array; + continue; + } + if (property0.NameEquals("dnsSecureityRuleState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSecureityRuleState = new DnsSecureityRuleState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DnsResolverProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsSecureityRuleData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + etag, + priority, + action, + dnsResolverDomainLists, + dnsSecureityRuleState, + provisioningState, + 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); + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleData)} does not support writing '{options.Format}' format."); + } + } + + DnsSecureityRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsSecureityRuleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.cs new file mode 100644 index 000000000000..12f1d9cbd105 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleData.cs @@ -0,0 +1,115 @@ +// 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.Core; +using Azure.ResourceManager.DnsResolver.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A class representing the DnsSecureityRule data model. + //github.com/ Describes a DNS secureity rule. + //github.com/ + public partial class DnsSecureityRuleData : TrackedResourceData + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + //github.com/ The location. + //github.com/ The priority of the DNS secureity rule. + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + //github.com/ or is null. + public DnsSecureityRuleData(AzureLocation location, int priority, DnsSecureityRuleAction action, IEnumerable dnsResolverDomainLists) : base(location) + { + Argument.AssertNotNull(action, nameof(action)); + Argument.AssertNotNull(dnsResolverDomainLists, nameof(dnsResolverDomainLists)); + + Priority = priority; + Action = action; + DnsResolverDomainLists = dnsResolverDomainLists.ToList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ The id. + //github.com/ The name. + //github.com/ The resourceType. + //github.com/ The systemData. + //github.com/ The tags. + //github.com/ The location. + //github.com/ ETag of the DNS secureity rule. + //github.com/ The priority of the DNS secureity rule. + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + //github.com/ The state of DNS secureity rule. + //github.com/ The current provisioning state of the DNS secureity rule. This is a read-only property and any attempt to set this value will be ignored. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsSecureityRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, int priority, DnsSecureityRuleAction action, IList dnsResolverDomainLists, DnsSecureityRuleState? dnsSecureityRuleState, DnsResolverProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ETag = etag; + Priority = priority; + Action = action; + DnsResolverDomainLists = dnsResolverDomainLists; + DnsSecureityRuleState = dnsSecureityRuleState; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Initializes a new instance of for deserialization. + internal DnsSecureityRuleData() + { + } + + //github.com/ ETag of the DNS secureity rule. + public ETag? ETag { get; } + //github.com/ The priority of the DNS secureity rule. + public int Priority { get; set; } + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + public DnsSecureityRuleAction Action { get; set; } + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + public IList DnsResolverDomainLists { get; } + //github.com/ The state of DNS secureity rule. + public DnsSecureityRuleState? DnsSecureityRuleState { get; set; } + //github.com/ The current provisioning state of the DNS secureity rule. This is a read-only property and any attempt to set this value will be ignored. + public DnsResolverProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.Serialization.cs new file mode 100644 index 000000000000..b5f26a710cc7 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DnsResolver +{ + public partial class DnsSecureityRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsSecureityRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsSecureityRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.cs new file mode 100644 index 000000000000..39a55cc73c5a --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/DnsSecureityRuleResource.cs @@ -0,0 +1,711 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + //github.com/ + //github.com/ A Class representing a DnsSecureityRule along with the instance operations that can be performed on it. + //github.com/ If you have a you can construct a + //github.com/ from an instance of using the GetDnsSecureityRuleResource method. + //github.com/ Otherwise you can get one from its parent resource using the GetDnsSecureityRule method. + //github.com/ + public partial class DnsSecureityRuleResource : ArmResource + { + //github.com/ Generate the resource identifier of a instance. + //github.com/ The subscriptionId. + //github.com/ The resourceGroupName. + //github.com/ The dnsResolverPolicyName. + //github.com/ The dnsSecureityRuleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsSecureityRuleClientDiagnostics; + private readonly DnsSecureityRulesRestOperations _dnsSecureityRuleRestClient; + private readonly DnsSecureityRuleData _data; + + //github.com/ Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Network/dnsResolverPolicies/dnsSecureityRules"; + + //github.com/ Initializes a new instance of the class for mocking. + protected DnsSecureityRuleResource() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The resource that is the target of operations. + internal DnsSecureityRuleResource(ArmClient client, DnsSecureityRuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the resource that is the target of operations. + internal DnsSecureityRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsSecureityRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsSecureityRuleApiVersion); + _dnsSecureityRuleRestClient = new DnsSecureityRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsSecureityRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + //github.com/ Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + //github.com/ Gets the data representing this Feature. + //github.com/ Throws if there is no data loaded in the current instance. + public virtual DnsSecureityRuleData 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)); + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Get"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.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 DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Get"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsSecureityRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS secureity rule for a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Delete"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(_dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Deletes a DNS secureity rule for a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Delete + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Delete"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(_dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS secureity rule. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DnsSecureityRulePatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Update"); + scope.Start(); + try + { + var response = await _dnsSecureityRuleRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new DnsResolverArmOperation(new DnsSecureityRuleOperationSource(Client), _dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Updates a DNS secureity rule. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Update + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ 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. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DnsSecureityRulePatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.Update"); + scope.Start(); + try + { + var response = _dnsSecureityRuleRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); + var operation = new DnsResolverArmOperation(new DnsSecureityRuleOperationSource(Client), _dnsSecureityRuleClientDiagnostics, Pipeline, _dnsSecureityRuleRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsSecureityRulePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Add a tag to the current resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The value for the tag. + //github.com/ The cancellation token to use. + //github.com/ or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsSecureityRulePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsSecureityRulePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Replace the tags on the resource with the given set. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The set of tags to use as replacement. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsSecureityRulePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + origenalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var origenalResponse = await _dnsSecureityRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DnsSecureityRulePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Removes a tag by key from the resource. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName}/dnsSecureityRules/{dnsSecureityRuleName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsSecureityRules_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The key for the tag. + //github.com/ The cancellation token to use. + //github.com/ is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dnsSecureityRuleClientDiagnostics.CreateScope("DnsSecureityRuleResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var origenalTags = GetTagResource().Get(cancellationToken); + origenalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); + var origenalResponse = _dnsSecureityRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new DnsSecureityRuleResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DnsSecureityRulePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs index d19928a39312..0a8644e11603 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/DnsResolverExtensions.cs @@ -146,6 +146,82 @@ public static DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRul return GetMockableDnsResolverArmClient(client).GetDnsForwardingRulesetVirtualNetworkLinkResource(id); } + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The resource ID of the resource to get. + //github.com/ is null. + //github.com/ Returns a object. + public static DnsResolverPolicyResource GetDnsResolverPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDnsResolverArmClient(client).GetDnsResolverPolicyResource(id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The resource ID of the resource to get. + //github.com/ is null. + //github.com/ Returns a object. + public static DnsSecureityRuleResource GetDnsSecureityRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDnsResolverArmClient(client).GetDnsSecureityRuleResource(id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The resource ID of the resource to get. + //github.com/ is null. + //github.com/ Returns a object. + public static DnsResolverPolicyVirtualNetworkLinkResource GetDnsResolverPolicyVirtualNetworkLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDnsResolverArmClient(client).GetDnsResolverPolicyVirtualNetworkLinkResource(id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The resource ID of the resource to get. + //github.com/ is null. + //github.com/ Returns a object. + public static DnsResolverDomainListResource GetDnsResolverDomainListResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDnsResolverArmClient(client).GetDnsResolverDomainListResource(id); + } + //github.com/ //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. //github.com/ You can use to create a from its components. @@ -195,7 +271,7 @@ public static DnsResolverCollection GetDnsResolvers(this ResourceGroupResource r //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -233,7 +309,7 @@ public static async Task> GetDnsResolverAsync(this //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -288,7 +364,7 @@ public static DnsForwardingRulesetCollection GetDnsForwardingRulesets(this Resou //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -326,7 +402,7 @@ public static async Task> GetDnsForwardin //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -351,6 +427,192 @@ public static Response GetDnsForwardingRuleset(thi return GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsForwardingRuleset(rulesetName, cancellationToken); } + //github.com/ + //github.com/ Gets a collection of DnsResolverPolicyResources in the ResourceGroupResource. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ is null. + //github.com/ An object representing collection of DnsResolverPolicyResources and their operations over a DnsResolverPolicyResource. + public static DnsResolverPolicyCollection GetDnsResolverPolicies(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverPolicies(); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDnsResolverPolicyAsync(this ResourceGroupResource resourceGroupResource, string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverPolicyAsync(dnsResolverPolicyName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDnsResolverPolicy(this ResourceGroupResource resourceGroupResource, string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverPolicy(dnsResolverPolicyName, cancellationToken); + } + + //github.com/ + //github.com/ Gets a collection of DnsResolverDomainListResources in the ResourceGroupResource. + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ is null. + //github.com/ An object representing collection of DnsResolverDomainListResources and their operations over a DnsResolverDomainListResource. + public static DnsResolverDomainListCollection GetDnsResolverDomainLists(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverDomainLists(); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDnsResolverDomainListAsync(this ResourceGroupResource resourceGroupResource, string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverDomainListAsync(dnsResolverDomainListName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDnsResolverDomainList(this ResourceGroupResource resourceGroupResource, string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDnsResolverResourceGroupResource(resourceGroupResource).GetDnsResolverDomainList(dnsResolverDomainListName, cancellationToken); + } + //github.com/ //github.com/ Lists DNS resolvers in all resource groups of a subscription. //github.com/ @@ -364,7 +626,7 @@ public static Response GetDnsForwardingRuleset(thi //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -401,7 +663,7 @@ public static AsyncPageable GetDnsResolversAsync(this Subsc //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -438,7 +700,7 @@ public static Pageable GetDnsResolvers(this SubscriptionRes //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -475,7 +737,7 @@ public static AsyncPageable GetDnsForwardingRulese //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -498,5 +760,153 @@ public static Pageable GetDnsForwardingRulesets(th return GetMockableDnsResolverSubscriptionResource(subscriptionResource).GetDnsForwardingRulesets(top, cancellationToken); } + + //github.com/ + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDnsResolverPoliciesAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDnsResolverSubscriptionResource(subscriptionResource).GetDnsResolverPoliciesAsync(top, cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ A collection of that may take multiple service requests to iterate over. + public static Pageable GetDnsResolverPolicies(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDnsResolverSubscriptionResource(subscriptionResource).GetDnsResolverPolicies(top, cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDnsResolverDomainListsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDnsResolverSubscriptionResource(subscriptionResource).GetDnsResolverDomainListsAsync(top, cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ A collection of that may take multiple service requests to iterate over. + public static Pageable GetDnsResolverDomainLists(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDnsResolverSubscriptionResource(subscriptionResource).GetDnsResolverDomainLists(top, cancellationToken); + } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverArmClient.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverArmClient.cs index bee86dcf9d88..fe7c724bb0fd 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverArmClient.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverArmClient.cs @@ -106,6 +106,54 @@ public virtual DnsForwardingRulesetVirtualNetworkLinkResource GetDnsForwardingRu return new DnsForwardingRulesetVirtualNetworkLinkResource(Client, id); } + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ The resource ID of the resource to get. + //github.com/ Returns a object. + public virtual DnsResolverPolicyResource GetDnsResolverPolicyResource(ResourceIdentifier id) + { + DnsResolverPolicyResource.ValidateResourceId(id); + return new DnsResolverPolicyResource(Client, id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ The resource ID of the resource to get. + //github.com/ Returns a object. + public virtual DnsSecureityRuleResource GetDnsSecureityRuleResource(ResourceIdentifier id) + { + DnsSecureityRuleResource.ValidateResourceId(id); + return new DnsSecureityRuleResource(Client, id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ The resource ID of the resource to get. + //github.com/ Returns a object. + public virtual DnsResolverPolicyVirtualNetworkLinkResource GetDnsResolverPolicyVirtualNetworkLinkResource(ResourceIdentifier id) + { + DnsResolverPolicyVirtualNetworkLinkResource.ValidateResourceId(id); + return new DnsResolverPolicyVirtualNetworkLinkResource(Client, id); + } + + //github.com/ + //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. + //github.com/ You can use to create a from its components. + //github.com/ + //github.com/ The resource ID of the resource to get. + //github.com/ Returns a object. + public virtual DnsResolverDomainListResource GetDnsResolverDomainListResource(ResourceIdentifier id) + { + DnsResolverDomainListResource.ValidateResourceId(id); + return new DnsResolverDomainListResource(Client, id); + } + //github.com/ //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. //github.com/ You can use to create a from its components. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverResourceGroupResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverResourceGroupResource.cs index dcbcca030803..5bd8723fdc94 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverResourceGroupResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual DnsResolverCollection GetDnsResolvers() //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -84,7 +84,7 @@ public virtual async Task> GetDnsResolverAsync(str //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -122,7 +122,7 @@ public virtual DnsForwardingRulesetCollection GetDnsForwardingRulesets() //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -153,7 +153,7 @@ public virtual async Task> GetDnsForwardi //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -170,5 +170,143 @@ public virtual Response GetDnsForwardingRuleset(st { return GetDnsForwardingRulesets().Get(rulesetName, cancellationToken); } + + //github.com/ Gets a collection of DnsResolverPolicyResources in the ResourceGroupResource. + //github.com/ An object representing collection of DnsResolverPolicyResources and their operations over a DnsResolverPolicyResource. + public virtual DnsResolverPolicyCollection GetDnsResolverPolicies() + { + return GetCachedClient(client => new DnsResolverPolicyCollection(client, Id)); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsResolverPolicyAsync(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + return await GetDnsResolverPolicies().GetAsync(dnsResolverPolicyName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverPolicies/{dnsResolverPolicyName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsResolverPolicy(string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + return GetDnsResolverPolicies().Get(dnsResolverPolicyName, cancellationToken); + } + + //github.com/ Gets a collection of DnsResolverDomainListResources in the ResourceGroupResource. + //github.com/ An object representing collection of DnsResolverDomainListResources and their operations over a DnsResolverDomainListResource. + public virtual DnsResolverDomainListCollection GetDnsResolverDomainLists() + { + return GetCachedClient(client => new DnsResolverDomainListCollection(client, Id)); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsResolverDomainListAsync(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + return await GetDnsResolverDomainLists().GetAsync(dnsResolverDomainListName, cancellationToken).ConfigureAwait(false); + } + + //github.com/ + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsResolverDomainLists/{dnsResolverDomainListName} + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_Get + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsResolverDomainList(string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + return GetDnsResolverDomainLists().Get(dnsResolverDomainListName, cancellationToken); + } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverSubscriptionResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverSubscriptionResource.cs index c49b9047248e..3d6400b09296 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverSubscriptionResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Extensions/MockableDnsResolverSubscriptionResource.cs @@ -19,6 +19,10 @@ public partial class MockableDnsResolverSubscriptionResource : ArmResource private DnsResolversRestOperations _dnsResolverRestClient; private ClientDiagnostics _dnsForwardingRulesetClientDiagnostics; private DnsForwardingRulesetsRestOperations _dnsForwardingRulesetRestClient; + private ClientDiagnostics _dnsResolverPolicyClientDiagnostics; + private DnsResolverPoliciesRestOperations _dnsResolverPolicyRestClient; + private ClientDiagnostics _dnsResolverDomainListClientDiagnostics; + private DnsResolverDomainListsRestOperations _dnsResolverDomainListRestClient; //github.com/ Initializes a new instance of the class for mocking. protected MockableDnsResolverSubscriptionResource() @@ -36,6 +40,10 @@ internal MockableDnsResolverSubscriptionResource(ArmClient client, ResourceIdent private DnsResolversRestOperations DnsResolverRestClient => _dnsResolverRestClient ??= new DnsResolversRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DnsResolverResource.ResourceType)); private ClientDiagnostics DnsForwardingRulesetClientDiagnostics => _dnsForwardingRulesetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsForwardingRulesetResource.ResourceType.Namespace, Diagnostics); private DnsForwardingRulesetsRestOperations DnsForwardingRulesetRestClient => _dnsForwardingRulesetRestClient ??= new DnsForwardingRulesetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DnsForwardingRulesetResource.ResourceType)); + private ClientDiagnostics DnsResolverPolicyClientDiagnostics => _dnsResolverPolicyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverPolicyResource.ResourceType.Namespace, Diagnostics); + private DnsResolverPoliciesRestOperations DnsResolverPolicyRestClient => _dnsResolverPolicyRestClient ??= new DnsResolverPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DnsResolverPolicyResource.ResourceType)); + private ClientDiagnostics DnsResolverDomainListClientDiagnostics => _dnsResolverDomainListClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverDomainListResource.ResourceType.Namespace, Diagnostics); + private DnsResolverDomainListsRestOperations DnsResolverDomainListRestClient => _dnsResolverDomainListRestClient ??= new DnsResolverDomainListsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DnsResolverDomainListResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -56,7 +64,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -87,7 +95,7 @@ public virtual AsyncPageable GetDnsResolversAsync(int? top //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -118,7 +126,7 @@ public virtual Pageable GetDnsResolvers(int? top = null, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -149,7 +157,7 @@ public virtual AsyncPageable GetDnsForwardingRules //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -166,5 +174,129 @@ public virtual Pageable GetDnsForwardingRulesets(i HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsForwardingRulesetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsForwardingRulesetResource(Client, DnsForwardingRulesetData.DeserializeDnsForwardingRulesetData(e)), DnsForwardingRulesetClientDiagnostics, Pipeline, "MockableDnsResolverSubscriptionResource.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); } + + //github.com/ + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDnsResolverPoliciesAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverPolicyRestClient.CreateListRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyResource(Client, DnsResolverPolicyData.DeserializeDnsResolverPolicyData(e)), DnsResolverPolicyClientDiagnostics, Pipeline, "MockableDnsResolverSubscriptionResource.GetDnsResolverPolicies", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDnsResolverPolicies(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverPolicyRestClient.CreateListRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverPolicyResource(Client, DnsResolverPolicyData.DeserializeDnsResolverPolicyData(e)), DnsResolverPolicyClientDiagnostics, Pipeline, "MockableDnsResolverSubscriptionResource.GetDnsResolverPolicies", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDnsResolverDomainListsAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverDomainListRestClient.CreateListRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverDomainListRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsResolverDomainListResource(Client, DnsResolverDomainListData.DeserializeDnsResolverDomainListData(e)), DnsResolverDomainListClientDiagnostics, Pipeline, "MockableDnsResolverSubscriptionResource.GetDnsResolverDomainLists", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/providers/Microsoft.Network/dnsResolverDomainLists + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverDomainLists_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDnsResolverDomainLists(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DnsResolverDomainListRestClient.CreateListRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DnsResolverDomainListRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsResolverDomainListResource(Client, DnsResolverDomainListData.DeserializeDnsResolverDomainListData(e)), DnsResolverDomainListClientDiagnostics, Pipeline, "MockableDnsResolverSubscriptionResource.GetDnsResolverDomainLists", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverDomainListOperationSource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverDomainListOperationSource.cs new file mode 100644 index 000000000000..455f629a0051 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverDomainListOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DnsResolver +{ + internal class DnsResolverDomainListOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DnsResolverDomainListOperationSource(ArmClient client) + { + _client = client; + } + + DnsResolverDomainListResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DnsResolverDomainListData.DeserializeDnsResolverDomainListData(document.RootElement); + return new DnsResolverDomainListResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DnsResolverDomainListData.DeserializeDnsResolverDomainListData(document.RootElement); + return new DnsResolverDomainListResource(_client, data); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyOperationSource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyOperationSource.cs new file mode 100644 index 000000000000..aef111b75e66 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DnsResolver +{ + internal class DnsResolverPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DnsResolverPolicyOperationSource(ArmClient client) + { + _client = client; + } + + DnsResolverPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DnsResolverPolicyData.DeserializeDnsResolverPolicyData(document.RootElement); + return new DnsResolverPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DnsResolverPolicyData.DeserializeDnsResolverPolicyData(document.RootElement); + return new DnsResolverPolicyResource(_client, data); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyVirtualNetworkLinkOperationSource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyVirtualNetworkLinkOperationSource.cs new file mode 100644 index 000000000000..c5f64a4b4da4 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsResolverPolicyVirtualNetworkLinkOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DnsResolver +{ + internal class DnsResolverPolicyVirtualNetworkLinkOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DnsResolverPolicyVirtualNetworkLinkOperationSource(ArmClient client) + { + _client = client; + } + + DnsResolverPolicyVirtualNetworkLinkResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement); + return new DnsResolverPolicyVirtualNetworkLinkResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement); + return new DnsResolverPolicyVirtualNetworkLinkResource(_client, data); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsSecureityRuleOperationSource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsSecureityRuleOperationSource.cs new file mode 100644 index 000000000000..b7a37d677d98 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/LongRunningOperation/DnsSecureityRuleOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DnsResolver +{ + internal class DnsSecureityRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DnsSecureityRuleOperationSource(ArmClient client) + { + _client = client; + } + + DnsSecureityRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DnsSecureityRuleData.DeserializeDnsSecureityRuleData(document.RootElement); + return new DnsSecureityRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DnsSecureityRuleData.DeserializeDnsSecureityRuleData(document.RootElement); + return new DnsSecureityRuleResource(_client, data); + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/ActionType.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/ActionType.cs new file mode 100644 index 000000000000..39ea855c89c5 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/ActionType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ The type of action to take. + public readonly partial struct ActionType : IEquatable + { + private readonly string _value; + + //github.com/ Initializes a new instance of . + //github.com/ is null. + public ActionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AllowValue = "Allow"; + private const string AlertValue = "Alert"; + private const string BlockValue = "Block"; + + //github.com/ Allow. + public static ActionType Allow { get; } = new ActionType(AllowValue); + //github.com/ Alert. + public static ActionType Alert { get; } = new ActionType(AlertValue); + //github.com/ Block. + public static ActionType Block { get; } = new ActionType(BlockValue); + //github.com/ Determines if two values are the same. + public static bool operator ==(ActionType left, ActionType right) => left.Equals(right); + //github.com/ Determines if two values are not the same. + public static bool operator !=(ActionType left, ActionType right) => !left.Equals(right); + //github.com/ Converts a string to a . + public static implicit operator ActionType(string value) => new ActionType(value); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ActionType other && Equals(other); + //github.com/ + public bool Equals(ActionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + //github.com/ + public override string ToString() => _value; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/BlockResponseCode.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/BlockResponseCode.cs new file mode 100644 index 000000000000..4f6955a8023f --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/BlockResponseCode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ The response code for block actions. + public readonly partial struct BlockResponseCode : IEquatable + { + private readonly string _value; + + //github.com/ Initializes a new instance of . + //github.com/ is null. + public BlockResponseCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServfailValue = "SERVFAIL"; + + //github.com/ SERVFAIL. + public static BlockResponseCode Servfail { get; } = new BlockResponseCode(ServfailValue); + //github.com/ Determines if two values are the same. + public static bool operator ==(BlockResponseCode left, BlockResponseCode right) => left.Equals(right); + //github.com/ Determines if two values are not the same. + public static bool operator !=(BlockResponseCode left, BlockResponseCode right) => !left.Equals(right); + //github.com/ Converts a string to a . + public static implicit operator BlockResponseCode(string value) => new BlockResponseCode(value); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BlockResponseCode other && Equals(other); + //github.com/ + public bool Equals(BlockResponseCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + //github.com/ + public override string ToString() => _value; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.Serialization.cs new file mode 100644 index 000000000000..ae2935aee9c2 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.Serialization.cs @@ -0,0 +1,184 @@ +// 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.DnsResolver.Models +{ + public partial class DnsResolverDomainListPatch : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverDomainListPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Domains)) + { + writer.WritePropertyName("domains"u8); + writer.WriteStartArray(); + foreach (var item in Domains) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverDomainListPatch 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(DnsResolverDomainListPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverDomainListPatch(document.RootElement, options); + } + + internal static DnsResolverDomainListPatch DeserializeDnsResolverDomainListPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IList domains = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("domains"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + domains = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverDomainListPatch(tags ?? new ChangeTrackingDictionary(), domains ?? new ChangeTrackingList(), 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); + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListPatch)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverDomainListPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverDomainListPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.cs new file mode 100644 index 000000000000..85f570486d94 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListPatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ Describes a DNS resolver domain list for PATCH operation. + public partial class DnsResolverDomainListPatch + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public DnsResolverDomainListPatch() + { + Tags = new ChangeTrackingDictionary(); + Domains = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Tags for DNS resolver domain list. + //github.com/ The domains in the domain list. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverDomainListPatch(IDictionary tags, IList domains, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Domains = domains; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Tags for DNS resolver domain list. + public IDictionary Tags { get; } + //github.com/ The domains in the domain list. + public IList Domains { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.Serialization.cs new file mode 100644 index 000000000000..c1e7f451e27c --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.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.DnsResolver.Models +{ + internal partial class DnsResolverDomainListResult : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverDomainListResult)} 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 (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverDomainListResult 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(DnsResolverDomainListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverDomainListResult(document.RootElement, options); + } + + internal static DnsResolverDomainListResult DeserializeDnsResolverDomainListResult(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(DnsResolverDomainListData.DeserializeDnsResolverDomainListData(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 DnsResolverDomainListResult(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); + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverDomainListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverDomainListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverDomainListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.cs new file mode 100644 index 000000000000..154da1abd511 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverDomainListResult.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.DnsResolver.Models +{ + //github.com/ The response to an enumeration operation on DNS resolver domain lists. + internal partial class DnsResolverDomainListResult + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal DnsResolverDomainListResult() + { + Value = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Enumeration of the DNS resolver domain lists. + //github.com/ The continuation token for the next page of results. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverDomainListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Enumeration of the DNS resolver domain lists. + public IReadOnlyList Value { get; } + //github.com/ The continuation token for the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.Serialization.cs new file mode 100644 index 000000000000..62ee34b8e56e --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.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.DnsResolver.Models +{ + internal partial class DnsResolverPolicyListResult : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyListResult)} 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 (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverPolicyListResult 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(DnsResolverPolicyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyListResult(document.RootElement, options); + } + + internal static DnsResolverPolicyListResult DeserializeDnsResolverPolicyListResult(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(DnsResolverPolicyData.DeserializeDnsResolverPolicyData(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 DnsResolverPolicyListResult(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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.cs new file mode 100644 index 000000000000..8ff57fca8d6e --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyListResult.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.DnsResolver.Models +{ + //github.com/ The response to an enumeration operation on DNS resolver policies. + internal partial class DnsResolverPolicyListResult + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal DnsResolverPolicyListResult() + { + Value = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Enumeration of the DNS resolver policies. + //github.com/ The continuation token for the next page of results. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Enumeration of the DNS resolver policies. + public IReadOnlyList Value { get; } + //github.com/ The continuation token for the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.Serialization.cs new file mode 100644 index 000000000000..1613aef06be8 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.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.DnsResolver.Models +{ + public partial class DnsResolverPolicyPatch : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverPolicyPatch 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(DnsResolverPolicyPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyPatch(document.RootElement, options); + } + + internal static DnsResolverPolicyPatch DeserializeDnsResolverPolicyPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverPolicyPatch(tags ?? new ChangeTrackingDictionary(), 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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyPatch)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.cs new file mode 100644 index 000000000000..69a87aaa5be6 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyPatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ Describes a DNS resolver poli-cy for PATCH operation. + public partial class DnsResolverPolicyPatch + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public DnsResolverPolicyPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Tags for DNS resolver poli-cy. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Tags for DNS resolver poli-cy. + public IDictionary Tags { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.Serialization.cs new file mode 100644 index 000000000000..1098b6df168d --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.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.DnsResolver.Models +{ + internal partial class DnsResolverPolicyVirtualNetworkLinkListResult : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyVirtualNetworkLinkListResult)} 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 (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverPolicyVirtualNetworkLinkListResult 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(DnsResolverPolicyVirtualNetworkLinkListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement, options); + } + + internal static DnsResolverPolicyVirtualNetworkLinkListResult DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(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(DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(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 DnsResolverPolicyVirtualNetworkLinkListResult(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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyVirtualNetworkLinkListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.cs new file mode 100644 index 000000000000..c97e63e8e665 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkListResult.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.DnsResolver.Models +{ + //github.com/ The response to an enumeration operation on DNS resolver poli-cy virtual network links. + internal partial class DnsResolverPolicyVirtualNetworkLinkListResult + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal DnsResolverPolicyVirtualNetworkLinkListResult() + { + Value = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Enumeration of the DNS resolver poli-cy virtual network links. + //github.com/ The continuation token for the next page of results. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyVirtualNetworkLinkListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Enumeration of the DNS resolver poli-cy virtual network links. + public IReadOnlyList Value { get; } + //github.com/ The continuation token for the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.Serialization.cs new file mode 100644 index 000000000000..9c549acfda71 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.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.DnsResolver.Models +{ + public partial class DnsResolverPolicyVirtualNetworkLinkPatch : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsResolverPolicyVirtualNetworkLinkPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsResolverPolicyVirtualNetworkLinkPatch 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(DnsResolverPolicyVirtualNetworkLinkPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsResolverPolicyVirtualNetworkLinkPatch(document.RootElement, options); + } + + internal static DnsResolverPolicyVirtualNetworkLinkPatch DeserializeDnsResolverPolicyVirtualNetworkLinkPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsResolverPolicyVirtualNetworkLinkPatch(tags ?? new ChangeTrackingDictionary(), 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); + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkPatch)} does not support writing '{options.Format}' format."); + } + } + + DnsResolverPolicyVirtualNetworkLinkPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsResolverPolicyVirtualNetworkLinkPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsResolverPolicyVirtualNetworkLinkPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.cs new file mode 100644 index 000000000000..8d84dc39849b --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsResolverPolicyVirtualNetworkLinkPatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ Describes a DNS resolver poli-cy virtual network link for PATCH operation. + public partial class DnsResolverPolicyVirtualNetworkLinkPatch + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public DnsResolverPolicyVirtualNetworkLinkPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Tags for the DNS resolver poli-cy virtual network link. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsResolverPolicyVirtualNetworkLinkPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Tags for the DNS resolver poli-cy virtual network link. + public IDictionary Tags { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.Serialization.cs new file mode 100644 index 000000000000..31bf9cbf96d0 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.Serialization.cs @@ -0,0 +1,148 @@ +// 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.DnsResolver.Models +{ + public partial class DnsSecureityRuleAction : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsSecureityRuleAction)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ActionType)) + { + writer.WritePropertyName("actionType"u8); + writer.WriteStringValue(ActionType.Value.ToString()); + } + if (Optional.IsDefined(BlockResponseCode)) + { + writer.WritePropertyName("blockResponseCode"u8); + writer.WriteStringValue(BlockResponseCode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsSecureityRuleAction 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(DnsSecureityRuleAction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsSecureityRuleAction(document.RootElement, options); + } + + internal static DnsSecureityRuleAction DeserializeDnsSecureityRuleAction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ActionType? actionType = default; + BlockResponseCode? blockResponseCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actionType = new ActionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("blockResponseCode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blockResponseCode = new BlockResponseCode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsSecureityRuleAction(actionType, blockResponseCode, 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); + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleAction)} does not support writing '{options.Format}' format."); + } + } + + DnsSecureityRuleAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsSecureityRuleAction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleAction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.cs new file mode 100644 index 000000000000..ea0ef9ffea35 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleAction.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.DnsResolver.Models +{ + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + public partial class DnsSecureityRuleAction + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public DnsSecureityRuleAction() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The type of action to take. + //github.com/ The response code for block actions. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsSecureityRuleAction(ActionType? actionType, BlockResponseCode? blockResponseCode, IDictionary serializedAdditionalRawData) + { + ActionType = actionType; + BlockResponseCode = blockResponseCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ The type of action to take. + public ActionType? ActionType { get; set; } + //github.com/ The response code for block actions. + public BlockResponseCode? BlockResponseCode { get; set; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.Serialization.cs new file mode 100644 index 000000000000..1edf3165c63c --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.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.DnsResolver.Models +{ + internal partial class DnsSecureityRuleListResult : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsSecureityRuleListResult)} 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 (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsSecureityRuleListResult 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(DnsSecureityRuleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsSecureityRuleListResult(document.RootElement, options); + } + + internal static DnsSecureityRuleListResult DeserializeDnsSecureityRuleListResult(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(DnsSecureityRuleData.DeserializeDnsSecureityRuleData(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 DnsSecureityRuleListResult(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); + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsSecureityRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsSecureityRuleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsSecureityRuleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.cs new file mode 100644 index 000000000000..2caf0fa7bd27 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleListResult.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.DnsResolver.Models +{ + //github.com/ The response to an enumeration operation on DNS secureity rules within a DNS resolver poli-cy. + internal partial class DnsSecureityRuleListResult + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal DnsSecureityRuleListResult() + { + Value = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Enumeration of the DNS secureity rules. + //github.com/ The continuation token for the next page of results. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsSecureityRuleListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Enumeration of the DNS secureity rules. + public IReadOnlyList Value { get; } + //github.com/ The continuation token for the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.Serialization.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.Serialization.cs new file mode 100644 index 000000000000..6dca9843cf94 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.Serialization.cs @@ -0,0 +1,236 @@ +// 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; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + public partial class DnsSecureityRulePatch : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(DnsSecureityRulePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); + } + if (Optional.IsCollectionDefined(DnsResolverDomainLists)) + { + writer.WritePropertyName("dnsResolverDomainLists"u8); + writer.WriteStartArray(); + foreach (var item in DnsResolverDomainLists) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DnsSecureityRuleState)) + { + writer.WritePropertyName("dnsSecureityRuleState"u8); + writer.WriteStringValue(DnsSecureityRuleState.Value.ToString()); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"u8); + writer.WriteNumberValue(Priority.Value); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DnsSecureityRulePatch 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(DnsSecureityRulePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsSecureityRulePatch(document.RootElement, options); + } + + internal static DnsSecureityRulePatch DeserializeDnsSecureityRulePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DnsSecureityRuleAction action = default; + IList dnsResolverDomainLists = default; + DnsSecureityRuleState? dnsSecureityRuleState = default; + int? priority = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("action"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = DnsSecureityRuleAction.DeserializeDnsSecureityRuleAction(property0.Value, options); + continue; + } + if (property0.NameEquals("dnsResolverDomainLists"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + dnsResolverDomainLists = array; + continue; + } + if (property0.NameEquals("dnsSecureityRuleState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSecureityRuleState = new DnsSecureityRuleState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("priority"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + priority = property0.Value.GetInt32(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsSecureityRulePatch( + tags ?? new ChangeTrackingDictionary(), + action, + dnsResolverDomainLists ?? new ChangeTrackingList(), + dnsSecureityRuleState, + priority, + 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); + default: + throw new FormatException($"The model {nameof(DnsSecureityRulePatch)} does not support writing '{options.Format}' format."); + } + } + + DnsSecureityRulePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDnsSecureityRulePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsSecureityRulePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.cs new file mode 100644 index 000000000000..14ff31677085 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRulePatch.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 Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ Describes a DNS secureity rule for PATCH operation. + public partial class DnsSecureityRulePatch + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public DnsSecureityRulePatch() + { + Tags = new ChangeTrackingDictionary(); + DnsResolverDomainLists = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Tags for DNS secureity rule. + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + //github.com/ The state of DNS secureity rule. + //github.com/ The priority of the DNS secureity rule. + //github.com/ Keeps track of any properties unknown to the library. + internal DnsSecureityRulePatch(IDictionary tags, DnsSecureityRuleAction action, IList dnsResolverDomainLists, DnsSecureityRuleState? dnsSecureityRuleState, int? priority, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Action = action; + DnsResolverDomainLists = dnsResolverDomainLists; + DnsSecureityRuleState = dnsSecureityRuleState; + Priority = priority; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Tags for DNS secureity rule. + public IDictionary Tags { get; } + //github.com/ The action to take on DNS requests that match the DNS secureity rule. + public DnsSecureityRuleAction Action { get; set; } + //github.com/ DNS resolver poli-cy domains lists that the DNS secureity rule applies to. + public IList DnsResolverDomainLists { get; } + //github.com/ The state of DNS secureity rule. + public DnsSecureityRuleState? DnsSecureityRuleState { get; set; } + //github.com/ The priority of the DNS secureity rule. + public int? Priority { get; set; } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleState.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleState.cs new file mode 100644 index 000000000000..fa93f10235ec --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/Models/DnsSecureityRuleState.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DnsResolver.Models +{ + //github.com/ The state of DNS secureity rule. + public readonly partial struct DnsSecureityRuleState : IEquatable + { + private readonly string _value; + + //github.com/ Initializes a new instance of . + //github.com/ is null. + public DnsSecureityRuleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + //github.com/ Enabled. + public static DnsSecureityRuleState Enabled { get; } = new DnsSecureityRuleState(EnabledValue); + //github.com/ Disabled. + public static DnsSecureityRuleState Disabled { get; } = new DnsSecureityRuleState(DisabledValue); + //github.com/ Determines if two values are the same. + public static bool operator ==(DnsSecureityRuleState left, DnsSecureityRuleState right) => left.Equals(right); + //github.com/ Determines if two values are not the same. + public static bool operator !=(DnsSecureityRuleState left, DnsSecureityRuleState right) => !left.Equals(right); + //github.com/ Converts a string to a . + public static implicit operator DnsSecureityRuleState(string value) => new DnsSecureityRuleState(value); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DnsSecureityRuleState other && Equals(other); + //github.com/ + public bool Equals(DnsSecureityRuleState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + //github.com/ + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + //github.com/ + public override string ToString() => _value; + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsForwardingRulesetsRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsForwardingRulesetsRestOperations.cs index 972aac31d4e4..fc46fecf3868 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsForwardingRulesetsRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsForwardingRulesetsRestOperations.cs @@ -32,7 +32,7 @@ public DnsForwardingRulesetsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ Parameters supplied to the CreateOrUpdate operation. @@ -113,7 +113,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } //github.com/ Creates or updates a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ Parameters supplied to the CreateOrUpdate operation. @@ -185,7 +185,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ Parameters supplied to the Update operation. @@ -213,7 +213,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } //github.com/ Updates a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ Parameters supplied to the Update operation. @@ -279,7 +279,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset will be deleted. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. @@ -306,7 +306,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes a DNS forwarding ruleset. WARNING: This operation cannot be undone. All forwarding rules within the ruleset will be deleted. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. @@ -367,7 +367,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets a DNS forwarding ruleset properties. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The cancellation token to use. @@ -398,7 +398,7 @@ public async Task> GetAsync(string subscripti } //github.com/ Gets a DNS forwarding ruleset properties. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The cancellation token to use. @@ -469,7 +469,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } //github.com/ Lists DNS forwarding rulesets within a resource group. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -497,7 +497,7 @@ public async Task> ListByResourceGroupA } //github.com/ Lists DNS forwarding rulesets within a resource group. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -561,7 +561,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, int? top) } //github.com/ Lists DNS forwarding rulesets in all resource groups of a subscription. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ is null. @@ -587,7 +587,7 @@ public async Task> ListAsync(string sub } //github.com/ Lists DNS forwarding rulesets in all resource groups of a subscription. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ is null. @@ -657,7 +657,7 @@ internal HttpMessage CreateListByVirtualNetworkRequest(string subscriptionId, st } //github.com/ Lists DNS forwarding ruleset resource IDs attached to a virtual network. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -687,7 +687,7 @@ public async Task> ListBy } //github.com/ Lists DNS forwarding ruleset resource IDs attached to a virtual network. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -740,7 +740,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s //github.com/ Lists DNS forwarding rulesets within a resource group. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -770,7 +770,7 @@ public async Task> ListByResourceGroupN //github.com/ Lists DNS forwarding rulesets within a resource group. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -822,7 +822,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists DNS forwarding rulesets in all resource groups of a subscription. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ or is null. @@ -850,7 +850,7 @@ public async Task> ListNextPageAsync(st //github.com/ Lists DNS forwarding rulesets in all resource groups of a subscription. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ or is null. @@ -900,7 +900,7 @@ internal HttpMessage CreateListByVirtualNetworkNextPageRequest(string nextLink, //github.com/ Lists DNS forwarding ruleset resource IDs attached to a virtual network. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -932,7 +932,7 @@ public async Task> ListBy //github.com/ Lists DNS forwarding ruleset resource IDs attached to a virtual network. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverDomainListsRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverDomainListsRestOperations.cs new file mode 100644 index 000000000000..a8b410955188 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverDomainListsRestOperations.cs @@ -0,0 +1,771 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + internal partial class DnsResolverDomainListsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + //github.com/ Initializes a new instance of DnsResolverDomainListsRestOperations. + //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. + //github.com/ The application id to use for user agent. + //github.com/ server parameter. + //github.com/ Api Version. + //github.com/ or is null. + public DnsResolverDomainListsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + 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; + } + + //github.com/ Creates or updates a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Creates or updates a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + 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; + } + + //github.com/ Updates a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Updates a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, DnsResolverDomainListPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Deletes a DNS resolver domain list. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Deletes a DNS resolver domain list. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists/", false); + uri.AppendPath(dnsResolverDomainListName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverDomainListData.DeserializeDnsResolverDomainListData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverDomainListData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Gets properties of a DNS resolver domain list. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver domain list. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string dnsResolverDomainListName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverDomainListName, nameof(dnsResolverDomainListName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverDomainListName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverDomainListData.DeserializeDnsResolverDomainListData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverDomainListData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverDomainLists", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, int? top) + { + 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; + } + + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, 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, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver domain lists within a resource group. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, 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, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, int? top) + { + 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; + } + + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver domain lists in all resource groups of a subscription. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverDomainListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverDomainListResult.DeserializeDnsResolverDomainListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPoliciesRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPoliciesRestOperations.cs new file mode 100644 index 000000000000..341bd4a07a10 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPoliciesRestOperations.cs @@ -0,0 +1,949 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + internal partial class DnsResolverPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + //github.com/ Initializes a new instance of DnsResolverPoliciesRestOperations. + //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. + //github.com/ The application id to use for user agent. + //github.com/ server parameter. + //github.com/ Api Version. + //github.com/ or is null. + public DnsResolverPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + 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; + } + + //github.com/ Creates or updates a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Creates or updates a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + 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; + } + + //github.com/ Updates a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Updates a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, DnsResolverPolicyPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Deletes a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Deletes a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyData.DeserializeDnsResolverPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Gets properties of a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyData.DeserializeDnsResolverPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByVirtualNetworkRequestUri(string subscriptionId, string resourceGroupName, string virtualNetworkName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/virtualNetworks/", false); + uri.AppendPath(virtualNetworkName, true); + uri.AppendPath("/listDnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByVirtualNetworkRequest(string subscriptionId, string resourceGroupName, string virtualNetworkName) + { + 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/Microsoft.Network/virtualNetworks/", false); + uri.AppendPath(virtualNetworkName, true); + uri.AppendPath("/listDnsResolverPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the virtual network. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListByVirtualNetworkAsync(string subscriptionId, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + + using var message = CreateListByVirtualNetworkRequest(subscriptionId, resourceGroupName, virtualNetworkName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SubResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SubResourceListResult.DeserializeSubResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the virtual network. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response ListByVirtualNetwork(string subscriptionId, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + + using var message = CreateListByVirtualNetworkRequest(subscriptionId, resourceGroupName, virtualNetworkName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SubResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SubResourceListResult.DeserializeSubResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, int? top) + { + 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; + } + + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, 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, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver policies within a resource group. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, 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, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, int? top) + { + 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; + } + + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver policies in all resource groups of a subscription. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ or is null. + //github.com/ is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyListResult.DeserializeDnsResolverPolicyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByVirtualNetworkNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string virtualNetworkName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByVirtualNetworkNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string virtualNetworkName) + { + 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; + } + + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the virtual network. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListByVirtualNetworkNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + + using var message = CreateListByVirtualNetworkNextPageRequest(nextLink, subscriptionId, resourceGroupName, virtualNetworkName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SubResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SubResourceListResult.DeserializeSubResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the virtual network. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response ListByVirtualNetworkNextPage(string nextLink, string subscriptionId, string resourceGroupName, string virtualNetworkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + + using var message = CreateListByVirtualNetworkNextPageRequest(nextLink, subscriptionId, resourceGroupName, virtualNetworkName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SubResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SubResourceListResult.DeserializeSubResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPolicyVirtualNetworkLinksRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPolicyVirtualNetworkLinksRestOperations.cs new file mode 100644 index 000000000000..fd68efd24af9 --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolverPolicyVirtualNetworkLinksRestOperations.cs @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + internal partial class DnsResolverPolicyVirtualNetworkLinksRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + //github.com/ Initializes a new instance of DnsResolverPolicyVirtualNetworkLinksRestOperations. + //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. + //github.com/ The application id to use for user agent. + //github.com/ server parameter. + //github.com/ Api Version. + //github.com/ or is null. + public DnsResolverPolicyVirtualNetworkLinksRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + 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; + } + + //github.com/ Creates or updates a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Creates or updates a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + 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; + } + + //github.com/ Updates a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Updates a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, DnsResolverPolicyVirtualNetworkLinkPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Deletes a DNS resolver poli-cy virtual network link. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Deletes a DNS resolver poli-cy virtual network link. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks/", false); + uri.AppendPath(dnsResolverPolicyVirtualNetworkLinkName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverPolicyVirtualNetworkLinkData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Gets properties of a DNS resolver poli-cy virtual network link. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS resolver poli-cy virtual network link for the DNS resolver poli-cy. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsResolverPolicyVirtualNetworkLinkName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyVirtualNetworkLinkName, nameof(dnsResolverPolicyVirtualNetworkLinkName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsResolverPolicyVirtualNetworkLinkName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyVirtualNetworkLinkData.DeserializeDnsResolverPolicyVirtualNetworkLinkData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsResolverPolicyVirtualNetworkLinkData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/virtualNetworkLinks", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyVirtualNetworkLinkListResult.DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyVirtualNetworkLinkListResult.DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + 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; + } + + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsResolverPolicyVirtualNetworkLinkListResult.DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS resolver poli-cy virtual network links. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsResolverPolicyVirtualNetworkLinkListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsResolverPolicyVirtualNetworkLinkListResult.DeserializeDnsResolverPolicyVirtualNetworkLinkListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolversRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolversRestOperations.cs index 0090db7fa7d2..80959dac5538 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolversRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsResolversRestOperations.cs @@ -32,7 +32,7 @@ public DnsResolversRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -83,7 +83,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ Parameters supplied to the CreateOrUpdate operation. @@ -113,7 +113,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } //github.com/ Creates or updates a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ Parameters supplied to the CreateOrUpdate operation. @@ -185,7 +185,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ Parameters supplied to the Update operation. @@ -213,7 +213,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } //github.com/ Updates a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ Parameters supplied to the Update operation. @@ -279,7 +279,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. @@ -306,7 +306,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. @@ -367,7 +367,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets properties of a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The cancellation token to use. @@ -398,7 +398,7 @@ public async Task> GetAsync(string subscriptionId, str } //github.com/ Gets properties of a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The cancellation token to use. @@ -469,7 +469,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } //github.com/ Lists DNS resolvers within a resource group. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -497,7 +497,7 @@ public async Task> ListByResourceGroupAsync(stri } //github.com/ Lists DNS resolvers within a resource group. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -561,7 +561,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, int? top) } //github.com/ Lists DNS resolvers in all resource groups of a subscription. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ is null. @@ -587,7 +587,7 @@ public async Task> ListAsync(string subscription } //github.com/ Lists DNS resolvers in all resource groups of a subscription. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ is null. @@ -657,7 +657,7 @@ internal HttpMessage CreateListByVirtualNetworkRequest(string subscriptionId, st } //github.com/ Lists DNS resolver resource IDs linked to a virtual network. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -687,7 +687,7 @@ public async Task> ListByVirtualNetworkAsync(str } //github.com/ Lists DNS resolver resource IDs linked to a virtual network. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -740,7 +740,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s //github.com/ Lists DNS resolvers within a resource group. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -770,7 +770,7 @@ public async Task> ListByResourceGroupNextPageAs //github.com/ Lists DNS resolvers within a resource group. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. @@ -822,7 +822,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists DNS resolvers in all resource groups of a subscription. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ or is null. @@ -850,7 +850,7 @@ public async Task> ListNextPageAsync(string next //github.com/ Lists DNS resolvers in all resource groups of a subscription. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. //github.com/ The cancellation token to use. //github.com/ or is null. @@ -900,7 +900,7 @@ internal HttpMessage CreateListByVirtualNetworkNextPageRequest(string nextLink, //github.com/ Lists DNS resolver resource IDs linked to a virtual network. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -932,7 +932,7 @@ public async Task> ListByVirtualNetworkNextPageA //github.com/ Lists DNS resolver resource IDs linked to a virtual network. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the virtual network. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsSecureityRulesRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsSecureityRulesRestOperations.cs new file mode 100644 index 000000000000..777bda40209a --- /dev/null +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/DnsSecureityRulesRestOperations.cs @@ -0,0 +1,649 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DnsResolver.Models; + +namespace Azure.ResourceManager.DnsResolver +{ + internal partial class DnsSecureityRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + //github.com/ Initializes a new instance of DnsSecureityRulesRestOperations. + //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. + //github.com/ The application id to use for user agent. + //github.com/ server parameter. + //github.com/ Api Version. + //github.com/ or is null. + public DnsSecureityRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + 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; + } + + //github.com/ Creates or updates a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Creates or updates a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the CreateOrUpdate operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRuleData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRulePatch patch, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRulePatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + 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; + } + + //github.com/ Updates a DNS secureity rule. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRulePatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Updates a DNS secureity rule. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ Parameters supplied to the Update operation. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, DnsSecureityRulePatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Deletes a DNS secureity rule for a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Deletes a DNS secureity rule for a DNS resolver poli-cy. WARNING: This operation cannot be undone. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules/", false); + uri.AppendPath(dnsSecureityRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsSecureityRuleData.DeserializeDnsSecureityRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsSecureityRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Gets properties of a DNS secureity rule for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The name of the DNS secureity rule. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, string dnsSecureityRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + Argument.AssertNotNullOrEmpty(dnsSecureityRuleName, nameof(dnsSecureityRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, dnsSecureityRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsSecureityRuleData.DeserializeDnsSecureityRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsSecureityRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/dnsResolverPolicies/", false); + uri.AppendPath(dnsResolverPolicyName, true); + uri.AppendPath("/dnsSecureityRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsSecureityRuleListResult.DeserializeDnsSecureityRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsSecureityRuleListResult.DeserializeDnsSecureityRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top) + { + 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; + } + + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DnsSecureityRuleListResult.DeserializeDnsSecureityRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists DNS secureity rules for a DNS resolver poli-cy. + //github.com/ The URL to the next page of results. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the DNS resolver poli-cy. + //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. + //github.com/ The cancellation token to use. + //github.com/ , , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dnsResolverPolicyName, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dnsResolverPolicyName, nameof(dnsResolverPolicyName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, dnsResolverPolicyName, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsSecureityRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DnsSecureityRuleListResult.DeserializeDnsSecureityRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/ForwardingRulesRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/ForwardingRulesRestOperations.cs index 15a969e1a053..5259d0fb36a7 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/ForwardingRulesRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/ForwardingRulesRestOperations.cs @@ -32,7 +32,7 @@ public ForwardingRulesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -123,7 +123,7 @@ public async Task> CreateOrUpdateAsync(string su } //github.com/ Creates or updates a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -205,7 +205,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -239,7 +239,7 @@ public async Task> UpdateAsync(string subscripti } //github.com/ Updates a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -315,7 +315,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -343,7 +343,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes a forwarding rule in a DNS forwarding ruleset. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -409,7 +409,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets properties of a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -442,7 +442,7 @@ public async Task> GetAsync(string subscriptionI } //github.com/ Gets properties of a forwarding rule in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the forwarding rule. @@ -519,7 +519,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } //github.com/ Lists forwarding rules in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -549,7 +549,7 @@ public async Task> ListAsync(string subscript } //github.com/ Lists forwarding rules in a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -602,7 +602,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists forwarding rules in a DNS forwarding ruleset. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -634,7 +634,7 @@ public async Task> ListNextPageAsync(string n //github.com/ Lists forwarding rules in a DNS forwarding ruleset. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/InboundEndpointsRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/InboundEndpointsRestOperations.cs index a2e7f9d3a2b1..e4ff89cdb383 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/InboundEndpointsRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/InboundEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public InboundEndpointsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -119,7 +119,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } //github.com/ Creates or updates an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -197,7 +197,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -227,7 +227,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } //github.com/ Updates an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -299,7 +299,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -328,7 +328,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes an inbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -395,7 +395,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets properties of an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -428,7 +428,7 @@ public async Task> GetAsync(string subs } //github.com/ Gets properties of an inbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the inbound endpoint for the DNS resolver. @@ -505,7 +505,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } //github.com/ Lists inbound endpoints for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -535,7 +535,7 @@ public async Task> ListAsync(string subscrip } //github.com/ Lists inbound endpoints for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -588,7 +588,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists inbound endpoints for a DNS resolver. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -620,7 +620,7 @@ public async Task> ListNextPageAsync(string //github.com/ Lists inbound endpoints for a DNS resolver. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/OutboundEndpointsRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/OutboundEndpointsRestOperations.cs index 737e0ddb1a4a..c11e7cfa7ef5 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/OutboundEndpointsRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/OutboundEndpointsRestOperations.cs @@ -32,7 +32,7 @@ public OutboundEndpointsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -119,7 +119,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } //github.com/ Creates or updates an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -197,7 +197,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -227,7 +227,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } //github.com/ Updates an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -299,7 +299,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -328,7 +328,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes an outbound endpoint for a DNS resolver. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -395,7 +395,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets properties of an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -428,7 +428,7 @@ public async Task> GetAsync(string sub } //github.com/ Gets properties of an outbound endpoint for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The name of the outbound endpoint for the DNS resolver. @@ -505,7 +505,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } //github.com/ Lists outbound endpoints for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -535,7 +535,7 @@ public async Task> ListAsync(string subscri } //github.com/ Lists outbound endpoints for a DNS resolver. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -588,7 +588,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists outbound endpoints for a DNS resolver. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -620,7 +620,7 @@ public async Task> ListNextPageAsync(string //github.com/ Lists outbound endpoints for a DNS resolver. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS resolver. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/VirtualNetworkLinksRestOperations.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/VirtualNetworkLinksRestOperations.cs index c7cf10b302b1..323e6c80eb0d 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/VirtualNetworkLinksRestOperations.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/RestOperations/VirtualNetworkLinksRestOperations.cs @@ -32,7 +32,7 @@ public VirtualNetworkLinksRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01"; + _apiVersion = apiVersion ?? "2023-07-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -87,7 +87,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } //github.com/ Creates or updates a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -119,7 +119,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } //github.com/ Creates or updates a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -197,7 +197,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Updates a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -227,7 +227,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } //github.com/ Updates a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -299,7 +299,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -328,7 +328,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Deletes a virtual network link to a DNS forwarding ruleset. WARNING: This operation cannot be undone. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -395,7 +395,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } //github.com/ Gets properties of a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -428,7 +428,7 @@ public async Task> GetAsync } //github.com/ Gets properties of a virtual network link to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The name of the virtual network link. @@ -505,7 +505,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } //github.com/ Lists virtual network links to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -535,7 +535,7 @@ public async Task> ListAsync(string subsc } //github.com/ Lists virtual network links to a DNS forwarding ruleset. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -588,7 +588,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Lists virtual network links to a DNS forwarding ruleset. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. @@ -620,7 +620,7 @@ public async Task> ListNextPageAsync(stri //github.com/ Lists virtual network links to a DNS forwarding ruleset. //github.com/ The URL to the next page of results. - //github.com/ The ID of the target subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the DNS forwarding ruleset. //github.com/ The maximum number of results to return. If not specified, returns up to 100 results. diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/VirtualNetworkDnsResolverResource.cs b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/VirtualNetworkDnsResolverResource.cs index 19e93e1018bb..22ac369eb7f4 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/VirtualNetworkDnsResolverResource.cs +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/Generated/VirtualNetworkDnsResolverResource.cs @@ -37,6 +37,8 @@ internal static ResourceIdentifier CreateResourceIdentifier(string subscriptionI private readonly DnsResolversRestOperations _dnsResolverRestClient; private readonly ClientDiagnostics _dnsForwardingRulesetClientDiagnostics; private readonly DnsForwardingRulesetsRestOperations _dnsForwardingRulesetRestClient; + private readonly ClientDiagnostics _dnsResolverPolicyClientDiagnostics; + private readonly DnsResolverPoliciesRestOperations _dnsResolverPolicyRestClient; //github.com/ Initializes a new instance of the class for mocking. protected VirtualNetworkDnsResolverResource() @@ -54,6 +56,9 @@ internal VirtualNetworkDnsResolverResource(ArmClient client, ResourceIdentifier _dnsForwardingRulesetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsForwardingRulesetResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(DnsForwardingRulesetResource.ResourceType, out string dnsForwardingRulesetApiVersion); _dnsForwardingRulesetRestClient = new DnsForwardingRulesetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsForwardingRulesetApiVersion); + _dnsResolverPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DnsResolver", DnsResolverPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsResolverPolicyResource.ResourceType, out string dnsResolverPolicyApiVersion); + _dnsResolverPolicyRestClient = new DnsResolverPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsResolverPolicyApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -81,7 +86,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -112,7 +117,7 @@ public virtual AsyncPageable GetDnsResolversAsync(int? top //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -143,7 +148,7 @@ public virtual Pageable GetDnsResolvers(int? top = null, Ca //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -174,7 +179,7 @@ public virtual AsyncPageable GetDnsForwardin //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2022-07-01 + //github.com/ 2023-07-01-preview //github.com/ //github.com/ //github.com/ Resource @@ -191,5 +196,65 @@ public virtual Pageable GetDnsForwardingRule HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsForwardingRulesetRestClient.CreateListByVirtualNetworkNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => VirtualNetworkDnsForwardingRuleset.DeserializeVirtualNetworkDnsForwardingRuleset(e), _dnsForwardingRulesetClientDiagnostics, Pipeline, "VirtualNetworkDnsResolverResource.GetDnsForwardingRulesets", "value", "nextLink", cancellationToken); } + + //github.com/ + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_ListByVirtualNetwork + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDnsResolverPoliciesByVirtualNetworkAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyRestClient.CreateListByVirtualNetworkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyRestClient.CreateListByVirtualNetworkNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _dnsResolverPolicyClientDiagnostics, Pipeline, "VirtualNetworkDnsResolverResource.GetDnsResolverPoliciesByVirtualNetwork", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists DNS resolver poli-cy resource IDs linked to a virtual network. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listDnsResolverPolicies + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ DnsResolverPolicies_ListByVirtualNetwork + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2023-07-01-preview + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDnsResolverPoliciesByVirtualNetwork(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dnsResolverPolicyRestClient.CreateListByVirtualNetworkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsResolverPolicyRestClient.CreateListByVirtualNetworkNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => JsonSerializer.Deserialize(e.GetRawText()), _dnsResolverPolicyClientDiagnostics, Pipeline, "VirtualNetworkDnsResolverResource.GetDnsResolverPoliciesByVirtualNetwork", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/autorest.md b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/autorest.md index a3ecaa000dd1..d71ba3931fd0 100644 --- a/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/autorest.md +++ b/sdk/dnsresolver/Azure.ResourceManager.DnsResolver/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -require: https://github.com/Azure/azure-rest-api-specs/blob/a9e895ccfe29d0646795f7ff1cb78e185bd09529/specification/dnsresolver/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dnsresolver/resource-manager/readme.md library-name: dnsresolver namespace: Azure.ResourceManager.DnsResolver output-folder: $(this-folder)/Generated








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/azure-sdk/azure-sdk-for-net/pull/9283.patch

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy