From d7a17f3d416feb45986e337284dfac2c8b7944f2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 29 Nov 2022 07:02:29 +0000 Subject: [PATCH] CodeGen from PR 21685 in Azure/azure-rest-api-specs Merge a979dedbe5147846b325ce3914d561c5b5ebb94f into 95903ca4fc97a30c3ac4d535744b0087ebcd8a50 --- ...esourceManager.EventHubs.netstandard2.0.cs | 239 ++++++++ .../Generated/ApplicationGroupCollection.cs | 333 +++++++++++ .../src/Generated/ApplicationGroupData.cs | 58 ++ .../src/Generated/ApplicationGroupResource.cs | 249 ++++++++ .../src/Generated/EventHubsClusterData.cs | 6 +- .../src/Generated/EventHubsNamespaceData.cs | 10 +- .../Generated/EventHubsNamespaceResource.cs | 237 ++++++-- .../Generated/EventHubsNetworkRuleSetData.cs | 4 +- ...ntHubsPrivateEndpointConnectionResource.cs | 4 +- .../EventHubsSchemaGroupCollection.cs | 4 + .../Generated/EventHubsSchemaGroupResource.cs | 6 + .../Extensions/EventHubsExtensions.cs | 75 ++- .../ApplicationGroupData.Serialization.cs | 140 +++++ ...pplicationGroupListResult.Serialization.cs | 47 ++ .../Models/ApplicationGroupListResult.cs | 37 ++ .../ApplicationGroupPolicy.Serialization.cs | 37 ++ .../Models/ApplicationGroupPolicy.cs | 44 ++ .../Models/ApplicationGroupPolicyType.cs | 48 ++ .../EventHubsClusterData.Serialization.cs | 18 +- .../EventHubsNamespaceData.Serialization.cs | 34 +- .../EventHubsPublicNetworkAccessFlag.cs | 5 +- .../src/Generated/Models/MetricId.cs | 57 ++ .../NetworkSecurityPerimeter.Serialization.cs | 46 ++ .../Models/NetworkSecurityPerimeter.cs | 38 ++ ...ityPerimeterConfiguration.Serialization.cs | 185 ++++++ .../NetworkSecurityPerimeterConfiguration.cs | 56 ++ ...erimeterConfigurationList.Serialization.cs | 40 ++ ...tworkSecurityPerimeterConfigurationList.cs | 32 + ...gurationPropertiesProfile.Serialization.cs | 52 ++ ...PerimeterConfigurationPropertiesProfile.cs | 40 ++ ...ertiesResourceAssociation.Serialization.cs | 40 ++ ...figurationPropertiesResourceAssociation.cs | 32 + ...PerimeterConfigurationProvisioningState.cs | 78 +++ .../Models/NspAccessRule.Serialization.cs | 64 ++ .../src/Generated/Models/NspAccessRule.cs | 35 ++ .../Models/NspAccessRuleDirection.cs | 51 ++ .../NspAccessRuleProperties.Serialization.cs | 100 ++++ .../Models/NspAccessRuleProperties.cs | 52 ++ .../Models/ProvisioningIssue.Serialization.cs | 51 ++ .../src/Generated/Models/ProvisioningIssue.cs | 32 + ...ovisioningIssueProperties.Serialization.cs | 35 ++ .../Models/ProvisioningIssueProperties.cs | 32 + .../Generated/Models/PublicNetworkAccess.cs | 54 ++ .../Models/ResourceAssociationAccessMode.cs | 60 ++ .../Models/ThrottlingPolicy.Serialization.cs | 61 ++ .../src/Generated/Models/ThrottlingPolicy.cs | 47 ++ .../src/Generated/Models/TlsVersion.cs | 54 ++ ...ownApplicationGroupPolicy.Serialization.cs | 45 ++ .../Models/UnknownApplicationGroupPolicy.cs | 21 + .../ApplicationGroupRestOperations.cs | 451 ++++++++++++++ .../RestOperations/ClustersRestOperations.cs | 2 +- .../ConfigurationRestOperations.cs | 2 +- .../ConsumerGroupsRestOperations.cs | 2 +- .../DisasterRecoveryConfigsRestOperations.cs | 498 ++++++++-------- .../RestOperations/EventHubsRestOperations.cs | 562 +++++++++--------- .../NamespacesRestOperations.cs | 2 +- ...ityPerimeterConfigurationRestOperations.cs | 119 ++++ ...tyPerimeterConfigurationsRestOperations.cs | 115 ++++ ...rivateEndpointConnectionsRestOperations.cs | 8 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../SchemaRegistryRestOperations.cs | 8 +- .../src/autorest.md | 2 +- 62 files changed, 4284 insertions(+), 614 deletions(-) create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupCollection.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupData.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupResource.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupData.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicyType.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/MetricId.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleDirection.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/PublicNetworkAccess.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ResourceAssociationAccessMode.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/TlsVersion.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.Serialization.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ApplicationGroupRestOperations.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationRestOperations.cs create mode 100644 sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/api/Azure.ResourceManager.EventHubs.netstandard2.0.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/api/Azure.ResourceManager.EventHubs.netstandard2.0.cs index 611550176362..0678e01eb7bb 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/api/Azure.ResourceManager.EventHubs.netstandard2.0.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/api/Azure.ResourceManager.EventHubs.netstandard2.0.cs @@ -1,5 +1,42 @@ namespace Azure.ResourceManager.EventHubs { + public partial class ApplicationGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ApplicationGroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string applicationGroupName, Azure.ResourceManager.EventHubs.ApplicationGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string applicationGroupName, Azure.ResourceManager.EventHubs.ApplicationGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string applicationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string applicationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string applicationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string applicationGroupName, 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 ApplicationGroupData : Azure.ResourceManager.Models.ResourceData + { + public ApplicationGroupData() { } + public string ClientAppGroupIdentifier { get { throw null; } set { } } + public bool? IsEnabled { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public System.Collections.Generic.IList Policies { get { throw null; } } + } + public partial class ApplicationGroupResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ApplicationGroupResource() { } + public virtual Azure.ResourceManager.EventHubs.ApplicationGroupData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.EventHubs.ApplicationGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.EventHubs.ApplicationGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class EventHubAuthorizationRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected EventHubAuthorizationRuleCollection() { } @@ -108,6 +145,7 @@ public EventHubsClusterData(Azure.Core.AzureLocation location) : base (default(A public string MetricId { get { throw null; } } public Azure.ResourceManager.EventHubs.Models.EventHubsClusterSku Sku { get { throw null; } set { } } public string Status { get { throw null; } } + public bool? SupportsScaling { get { throw null; } set { } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } } public partial class EventHubsClusterResource : Azure.ResourceManager.ArmResource @@ -248,6 +286,7 @@ public static partial class EventHubsExtensions { public static Azure.Response CheckEventHubsNamespaceNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EventHubs.Models.EventHubsNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CheckEventHubsNamespaceNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EventHubs.Models.EventHubsNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.EventHubs.ApplicationGroupResource GetApplicationGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetAvailableClusterRegionClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetAvailableClusterRegionClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.EventHubs.EventHubAuthorizationRuleResource GetEventHubAuthorizationRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -333,8 +372,10 @@ public EventHubsNamespaceData(Azure.Core.AzureLocation location) : base (default public bool? KafkaEnabled { get { throw null; } set { } } public int? MaximumThroughputUnits { get { throw null; } set { } } public string MetricId { get { throw null; } } + public Azure.ResourceManager.EventHubs.Models.TlsVersion? MinimumTlsVersion { get { throw null; } set { } } public System.Collections.Generic.IList PrivateEndpointConnections { get { throw null; } } public string ProvisioningState { get { throw null; } } + public Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string ServiceBusEndpoint { get { throw null; } } public Azure.ResourceManager.EventHubs.Models.EventHubsSku Sku { get { throw null; } set { } } public string Status { get { throw null; } } @@ -351,10 +392,15 @@ protected EventHubsNamespaceResource() { } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CheckEventHubsDisasterRecoveryNameAvailability(Azure.ResourceManager.EventHubs.Models.EventHubsNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CheckEventHubsDisasterRecoveryNameAvailabilityAsync(Azure.ResourceManager.EventHubs.Models.EventHubsNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdateNetworkSecurityPerimeterConfiguration(Azure.WaitUntil waitUntil, string resourceAssociationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateNetworkSecurityPerimeterConfigurationAsync(Azure.WaitUntil waitUntil, string resourceAssociationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string namespaceName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetApplicationGroup(string applicationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetApplicationGroupAsync(string applicationGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.EventHubs.ApplicationGroupCollection GetApplicationGroups() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetEventHub(string eventHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetEventHubAsync(string eventHubName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -372,6 +418,8 @@ protected EventHubsNamespaceResource() { } public virtual Azure.Response GetEventHubsSchemaGroup(string schemaGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetEventHubsSchemaGroupAsync(string schemaGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.EventHubs.EventHubsSchemaGroupCollection GetEventHubsSchemaGroups() { throw null; } + public virtual Azure.Pageable GetNetworkSecurityPerimeterConfigurations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetNetworkSecurityPerimeterConfigurationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(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; } @@ -483,6 +531,11 @@ protected EventHubsSchemaGroupResource() { } } namespace Azure.ResourceManager.EventHubs.Models { + public abstract partial class ApplicationGroupPolicy + { + protected ApplicationGroupPolicy(string name) { } + public string Name { get { throw null; } set { } } + } public partial class AvailableCluster { internal AvailableCluster() { } @@ -777,6 +830,7 @@ public EventHubsPrivateLinkServiceConnectionState() { } public EventHubsPublicNetworkAccessFlag(string value) { throw null; } public static Azure.ResourceManager.EventHubs.Models.EventHubsPublicNetworkAccessFlag Disabled { get { throw null; } } public static Azure.ResourceManager.EventHubs.Models.EventHubsPublicNetworkAccessFlag Enabled { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.EventHubsPublicNetworkAccessFlag SecuredByPerimeter { get { throw null; } } public bool Equals(Azure.ResourceManager.EventHubs.Models.EventHubsPublicNetworkAccessFlag other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -875,4 +929,189 @@ public EventHubsSku(Azure.ResourceManager.EventHubs.Models.EventHubsSkuName name public static bool operator !=(Azure.ResourceManager.EventHubs.Models.EventHubsSkuTier left, Azure.ResourceManager.EventHubs.Models.EventHubsSkuTier right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MetricId : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MetricId(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.MetricId IncomingBytes { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.MetricId IncomingMessages { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.MetricId OutgoingBytes { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.MetricId OutgoingMessages { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.MetricId 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.EventHubs.Models.MetricId left, Azure.ResourceManager.EventHubs.Models.MetricId right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.MetricId (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.MetricId left, Azure.ResourceManager.EventHubs.Models.MetricId right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NetworkSecurityPerimeter + { + internal NetworkSecurityPerimeter() { } + public string Id { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public string PerimeterGuid { get { throw null; } } + } + public partial class NetworkSecurityPerimeterConfiguration : Azure.ResourceManager.Models.TrackedResourceData + { + public NetworkSecurityPerimeterConfiguration(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeter NetworkSecurityPerimeter { get { throw null; } } + public Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationPropertiesProfile Profile { get { throw null; } } + public System.Collections.Generic.IList ProvisioningIssues { get { throw null; } } + public Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ResourceAssociation { get { throw null; } } + } + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile + { + internal NetworkSecurityPerimeterConfigurationPropertiesProfile() { } + public System.Collections.Generic.IReadOnlyList AccessRules { get { throw null; } } + public string AccessRulesVersion { get { throw null; } } + public string Name { get { throw null; } } + } + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + { + internal NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation() { } + public Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode? AccessMode { get { throw null; } } + public string Name { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NetworkSecurityPerimeterConfigurationProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState InvalidResponse { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState SucceededWithIssues { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Unknown { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState 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.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState left, Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState left, Azure.ResourceManager.EventHubs.Models.NetworkSecurityPerimeterConfigurationProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NspAccessRule : Azure.ResourceManager.Models.ResourceData + { + internal NspAccessRule() { } + public Azure.ResourceManager.EventHubs.Models.NspAccessRuleProperties Properties { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NspAccessRuleDirection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NspAccessRuleDirection(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection Inbound { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection Outbound { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection 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.EventHubs.Models.NspAccessRuleDirection left, Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection left, Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NspAccessRuleProperties + { + internal NspAccessRuleProperties() { } + public System.Collections.Generic.IReadOnlyList AddressPrefixes { get { throw null; } } + public Azure.ResourceManager.EventHubs.Models.NspAccessRuleDirection? Direction { get { throw null; } } + public System.Collections.Generic.IReadOnlyList FullyQualifiedDomainNames { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NetworkSecurityPerimeters { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Subscriptions { get { throw null; } } + } + public partial class ProvisioningIssue + { + public ProvisioningIssue() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.EventHubs.Models.ProvisioningIssueProperties Properties { get { throw null; } } + } + public partial class ProvisioningIssueProperties + { + internal ProvisioningIssueProperties() { } + public string Description { get { throw null; } } + public string IssueType { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PublicNetworkAccess(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess Disabled { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess Enabled { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess SecuredByPerimeter { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess 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.EventHubs.Models.PublicNetworkAccess left, Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess left, Azure.ResourceManager.EventHubs.Models.PublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceAssociationAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceAssociationAccessMode(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode AuditMode { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode EnforcedMode { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode LearningMode { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode NoAssociationMode { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode UnspecifiedMode { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode 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.EventHubs.Models.ResourceAssociationAccessMode left, Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode left, Azure.ResourceManager.EventHubs.Models.ResourceAssociationAccessMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ThrottlingPolicy : Azure.ResourceManager.EventHubs.Models.ApplicationGroupPolicy + { + public ThrottlingPolicy(string name, long rateLimitThreshold, Azure.ResourceManager.EventHubs.Models.MetricId metricId) : base (default(string)) { } + public Azure.ResourceManager.EventHubs.Models.MetricId MetricId { get { throw null; } set { } } + public long RateLimitThreshold { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TlsVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TlsVersion(string value) { throw null; } + public static Azure.ResourceManager.EventHubs.Models.TlsVersion One0 { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.TlsVersion One1 { get { throw null; } } + public static Azure.ResourceManager.EventHubs.Models.TlsVersion One2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.EventHubs.Models.TlsVersion 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.EventHubs.Models.TlsVersion left, Azure.ResourceManager.EventHubs.Models.TlsVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.EventHubs.Models.TlsVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EventHubs.Models.TlsVersion left, Azure.ResourceManager.EventHubs.Models.TlsVersion right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupCollection.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupCollection.cs new file mode 100644 index 000000000000..b56b6cee336a --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupCollection.cs @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.EventHubs +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetApplicationGroups method from an instance of . + /// + public partial class ApplicationGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _applicationGroupClientDiagnostics; + private readonly ApplicationGroupRestOperations _applicationGroupRestClient; + + /// Initializes a new instance of the class for mocking. + protected ApplicationGroupCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ApplicationGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _applicationGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ApplicationGroupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ApplicationGroupResource.ResourceType, out string applicationGroupApiVersion); + _applicationGroupRestClient = new ApplicationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, applicationGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EventHubsNamespaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EventHubsNamespaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_CreateOrUpdateApplicationGroup + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Application Group name. + /// The ApplicationGroup. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string applicationGroupName, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.CreateOrUpdateApplicationGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, data, cancellationToken).ConfigureAwait(false); + var operation = new EventHubsArmOperation(Response.FromValue(new ApplicationGroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_CreateOrUpdateApplicationGroup + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Application Group name. + /// The ApplicationGroup. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string applicationGroupName, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.CreateOrUpdateApplicationGroup(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, data, cancellationToken); + var operation = new EventHubsArmOperation(Response.FromValue(new ApplicationGroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.Get"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.Get"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a list of application groups for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups + /// Operation Id: ApplicationGroup_ListByNamespace + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.GetAll"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.ListByNamespaceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ApplicationGroupResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.GetAll"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.ListByNamespaceNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ApplicationGroupResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Gets a list of application groups for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups + /// Operation Id: ApplicationGroup_ListByNamespace + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.GetAll"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.ListByNamespace(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ApplicationGroupResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.GetAll"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.ListByNamespaceNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ApplicationGroupResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.Exists"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupCollection.Exists"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationGroupName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupData.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupData.cs new file mode 100644 index 000000000000..a59006c3d3a0 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupData.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.EventHubs.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs +{ + /// A class representing the ApplicationGroup data model. + public partial class ApplicationGroupData : ResourceData + { + /// Initializes a new instance of ApplicationGroupData. + public ApplicationGroupData() + { + Policies = new ChangeTrackingList(); + } + + /// Initializes a new instance of ApplicationGroupData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, all the existing connections of application group gets dropped and no new connections will be allowed. + /// The Unique identifier for application group.Supports SAS(SASKeyName=KeyName) or AAD(AADAppID=Guid). + /// + /// List of group policies that define the behavior of application group. The policies can support resource governance scenarios such as limiting ingress or egress traffic. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// The geo-location where the resource lives. + internal ApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled, string clientAppGroupIdentifier, IList policies, AzureLocation? location) : base(id, name, resourceType, systemData) + { + IsEnabled = isEnabled; + ClientAppGroupIdentifier = clientAppGroupIdentifier; + Policies = policies; + Location = location; + } + + /// Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, all the existing connections of application group gets dropped and no new connections will be allowed. + public bool? IsEnabled { get; set; } + /// The Unique identifier for application group.Supports SAS(SASKeyName=KeyName) or AAD(AADAppID=Guid). + public string ClientAppGroupIdentifier { get; set; } + /// + /// List of group policies that define the behavior of application group. The policies can support resource governance scenarios such as limiting ingress or egress traffic. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public IList Policies { get; } + /// The geo-location where the resource lives. + public AzureLocation? Location { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupResource.cs new file mode 100644 index 000000000000..e89a135aba23 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/ApplicationGroupResource.cs @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.EventHubs +{ + /// + /// A Class representing an ApplicationGroup along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetApplicationGroupResource method. + /// Otherwise you can get one from its parent resource using the GetApplicationGroup method. + /// + public partial class ApplicationGroupResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _applicationGroupClientDiagnostics; + private readonly ApplicationGroupRestOperations _applicationGroupRestClient; + private readonly ApplicationGroupData _data; + + /// Initializes a new instance of the class for mocking. + protected ApplicationGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ApplicationGroupResource(ArmClient client, ApplicationGroupData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ApplicationGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _applicationGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string applicationGroupApiVersion); + _applicationGroupRestClient = new ApplicationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, applicationGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.EventHub/namespaces/applicationGroups"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ApplicationGroupData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Get"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.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 ApplicationGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Get"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ApplicationGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Delete + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Delete"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new EventHubsArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Delete + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Delete"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new EventHubsArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_CreateOrUpdateApplicationGroup + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ApplicationGroup. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Update"); + scope.Start(); + try + { + var response = await _applicationGroupRestClient.CreateOrUpdateApplicationGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new EventHubsArmOperation(Response.FromValue(new ApplicationGroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_CreateOrUpdateApplicationGroup + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ApplicationGroup. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _applicationGroupClientDiagnostics.CreateScope("ApplicationGroupResource.Update"); + scope.Start(); + try + { + var response = _applicationGroupRestClient.CreateOrUpdateApplicationGroup(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new EventHubsArmOperation(Response.FromValue(new ApplicationGroupResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsClusterData.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsClusterData.cs index 0864db17a2f1..bb152d6c6e38 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsClusterData.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsClusterData.cs @@ -34,13 +34,15 @@ public EventHubsClusterData(AzureLocation location) : base(location) /// The UTC time when the Event Hubs Cluster was last updated. /// The metric ID of the cluster resource. Provided by the service and not modifiable by the user. /// Status of the Cluster resource. - internal EventHubsClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, EventHubsClusterSku sku, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string metricId, string status) : base(id, name, resourceType, systemData, tags, location) + /// A value that indicates whether Scaling is Supported. + internal EventHubsClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, EventHubsClusterSku sku, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string metricId, string status, bool? supportsScaling) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; CreatedOn = createdOn; UpdatedOn = updatedOn; MetricId = metricId; Status = status; + SupportsScaling = supportsScaling; } /// Properties of the cluster SKU. @@ -53,5 +55,7 @@ internal EventHubsClusterData(ResourceIdentifier id, string name, ResourceType r public string MetricId { get; } /// Status of the Cluster resource. public string Status { get; } + /// A value that indicates whether Scaling is Supported. + public bool? SupportsScaling { get; set; } } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceData.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceData.cs index 595554ec2fd4..5589a1fac664 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceData.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceData.cs @@ -32,6 +32,7 @@ public EventHubsNamespaceData(AzureLocation location) : base(location) /// The location. /// Properties of sku resource. /// Properties of BYOK Identity description. + /// The minimum TLS version for the cluster to support, e.g. '1.2'. /// Provisioning state of the Namespace. /// Status of the Namespace. /// The time the Namespace was created. @@ -40,6 +41,7 @@ public EventHubsNamespaceData(AzureLocation location) : base(location) /// Cluster ARM ID of the Namespace. /// Identifier for Azure Insights metrics. /// Value that indicates whether AutoInflate is enabled for eventhub namespace. + /// This determines if traffic is allowed over public network. By default it is enabled. /// Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). /// Value that indicates whether Kafka is enabled for eventhub namespace. /// Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. @@ -47,10 +49,11 @@ public EventHubsNamespaceData(AzureLocation location) : base(location) /// List of private endpoint connections. /// This property disables SAS authentication for the Event Hubs namespace. /// Alternate name specified when alias and namespace names are same. - internal EventHubsNamespaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, EventHubsSku sku, ManagedServiceIdentity identity, string provisioningState, string status, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string serviceBusEndpoint, ResourceIdentifier clusterArmId, string metricId, bool? isAutoInflateEnabled, int? maximumThroughputUnits, bool? kafkaEnabled, bool? zoneRedundant, EventHubsEncryption encryption, IList privateEndpointConnections, bool? disableLocalAuth, string alternateName) : base(id, name, resourceType, systemData, tags, location) + internal EventHubsNamespaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, EventHubsSku sku, ManagedServiceIdentity identity, TlsVersion? minimumTlsVersion, string provisioningState, string status, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string serviceBusEndpoint, ResourceIdentifier clusterArmId, string metricId, bool? isAutoInflateEnabled, PublicNetworkAccess? publicNetworkAccess, int? maximumThroughputUnits, bool? kafkaEnabled, bool? zoneRedundant, EventHubsEncryption encryption, IList privateEndpointConnections, bool? disableLocalAuth, string alternateName) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; + MinimumTlsVersion = minimumTlsVersion; ProvisioningState = provisioningState; Status = status; CreatedOn = createdOn; @@ -59,6 +62,7 @@ internal EventHubsNamespaceData(ResourceIdentifier id, string name, ResourceType ClusterArmId = clusterArmId; MetricId = metricId; IsAutoInflateEnabled = isAutoInflateEnabled; + PublicNetworkAccess = publicNetworkAccess; MaximumThroughputUnits = maximumThroughputUnits; KafkaEnabled = kafkaEnabled; ZoneRedundant = zoneRedundant; @@ -72,6 +76,8 @@ internal EventHubsNamespaceData(ResourceIdentifier id, string name, ResourceType public EventHubsSku Sku { get; set; } /// Properties of BYOK Identity description. public ManagedServiceIdentity Identity { get; set; } + /// The minimum TLS version for the cluster to support, e.g. '1.2'. + public TlsVersion? MinimumTlsVersion { get; set; } /// Provisioning state of the Namespace. public string ProvisioningState { get; } /// Status of the Namespace. @@ -88,6 +94,8 @@ internal EventHubsNamespaceData(ResourceIdentifier id, string name, ResourceType public string MetricId { get; } /// Value that indicates whether AutoInflate is enabled for eventhub namespace. public bool? IsAutoInflateEnabled { get; set; } + /// This determines if traffic is allowed over public network. By default it is enabled. + public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 throughput units. ( '0' if AutoInflateEnabled = true). public int? MaximumThroughputUnits { get; set; } /// Value that indicates whether Kafka is enabled for eventhub namespace. diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs index 0d3a9505316a..8c623e687490 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNamespaceResource.cs @@ -38,6 +38,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly NamespacesRestOperations _eventHubsNamespaceNamespacesRestClient; private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; + private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; + private readonly NetworkSecurityPerimeterConfigurationRestOperations _networkSecurityPerimeterConfigurationRestClient; + private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationsClientDiagnostics; + private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationsRestClient; private readonly ClientDiagnostics _disasterRecoveryConfigsClientDiagnostics; private readonly DisasterRecoveryConfigsRestOperations _disasterRecoveryConfigsRestClient; private readonly EventHubsNamespaceData _data; @@ -66,6 +70,10 @@ internal EventHubsNamespaceResource(ArmClient client, ResourceIdentifier id) : b _eventHubsNamespaceNamespacesRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, eventHubsNamespaceNamespacesApiVersion); _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ProviderConstants.DefaultProviderNamespace, Diagnostics); _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _networkSecurityPerimeterConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _networkSecurityPerimeterConfigurationsRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _disasterRecoveryConfigsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EventHubs", ProviderConstants.DefaultProviderNamespace, Diagnostics); _disasterRecoveryConfigsRestClient = new DisasterRecoveryConfigsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG @@ -178,43 +186,6 @@ public virtual Response GetEventHubs return GetEventHubsPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } - /// Gets a collection of EventHubResources in the EventHubsNamespace. - /// An object representing collection of EventHubResources and their operations over a EventHubResource. - public virtual EventHubCollection GetEventHubs() - { - return GetCachedClient(Client => new EventHubCollection(Client, Id)); - } - - /// - /// Gets an Event Hubs description for the specified Event Hub. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} - /// Operation Id: EventHubs_Get - /// - /// The Event Hub name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetEventHubAsync(string eventHubName, CancellationToken cancellationToken = default) - { - return await GetEventHubs().GetAsync(eventHubName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets an Event Hubs description for the specified Event Hub. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} - /// Operation Id: EventHubs_Get - /// - /// The Event Hub name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetEventHub(string eventHubName, CancellationToken cancellationToken = default) - { - return GetEventHubs().Get(eventHubName, cancellationToken); - } - /// Gets a collection of EventHubsDisasterRecoveryResources in the EventHubsNamespace. /// An object representing collection of EventHubsDisasterRecoveryResources and their operations over a EventHubsDisasterRecoveryResource. public virtual EventHubsDisasterRecoveryCollection GetEventHubsDisasterRecoveries() @@ -252,6 +223,43 @@ public virtual Response GetEventHubsDisasterR return GetEventHubsDisasterRecoveries().Get(alias, cancellationToken); } + /// Gets a collection of EventHubResources in the EventHubsNamespace. + /// An object representing collection of EventHubResources and their operations over a EventHubResource. + public virtual EventHubCollection GetEventHubs() + { + return GetCachedClient(Client => new EventHubCollection(Client, Id)); + } + + /// + /// Gets an Event Hubs description for the specified Event Hub. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} + /// Operation Id: EventHubs_Get + /// + /// The Event Hub name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetEventHubAsync(string eventHubName, CancellationToken cancellationToken = default) + { + return await GetEventHubs().GetAsync(eventHubName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Event Hubs description for the specified Event Hub. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName} + /// Operation Id: EventHubs_Get + /// + /// The Event Hub name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetEventHub(string eventHubName, CancellationToken cancellationToken = default) + { + return GetEventHubs().Get(eventHubName, cancellationToken); + } + /// Gets a collection of EventHubsSchemaGroupResources in the EventHubsNamespace. /// An object representing collection of EventHubsSchemaGroupResources and their operations over a EventHubsSchemaGroupResource. public virtual EventHubsSchemaGroupCollection GetEventHubsSchemaGroups() @@ -260,6 +268,7 @@ public virtual EventHubsSchemaGroupCollection GetEventHubsSchemaGroups() } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// @@ -274,6 +283,7 @@ public virtual async Task> GetEventHubsSc } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// @@ -287,6 +297,43 @@ public virtual Response GetEventHubsSchemaGroup(st return GetEventHubsSchemaGroups().Get(schemaGroupName, cancellationToken); } + /// Gets a collection of ApplicationGroupResources in the EventHubsNamespace. + /// An object representing collection of ApplicationGroupResources and their operations over a ApplicationGroupResource. + public virtual ApplicationGroupCollection GetApplicationGroups() + { + return GetCachedClient(Client => new ApplicationGroupCollection(Client, Id)); + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetApplicationGroupAsync(string applicationGroupName, CancellationToken cancellationToken = default) + { + return await GetApplicationGroups().GetAsync(applicationGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an ApplicationGroup for a Namespace. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName} + /// Operation Id: ApplicationGroup_Get + /// + /// The Application Group name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetApplicationGroup(string applicationGroupName, CancellationToken cancellationToken = default) + { + return GetApplicationGroups().Get(applicationGroupName, cancellationToken); + } + /// /// Gets the description of the specified namespace. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName} @@ -493,6 +540,122 @@ Page FirstPageFunc(int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, null); } + /// + /// Gets list of current NetworkSecurityPerimeterConfiguration for Namespace + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations + /// Operation Id: NetworkSecurityPerimeterConfiguration_List + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetNetworkSecurityPerimeterConfigurationsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("EventHubsNamespaceResource.GetNetworkSecurityPerimeterConfigurations"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// Gets list of current NetworkSecurityPerimeterConfiguration for Namespace + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations + /// Operation Id: NetworkSecurityPerimeterConfiguration_List + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetNetworkSecurityPerimeterConfigurations(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("EventHubsNamespaceResource.GetNetworkSecurityPerimeterConfigurations"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + + /// + /// Refreshes any information about the association. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations/{resourceAssociationName}/reconcile + /// Operation Id: NetworkSecurityPerimeterConfigurations_CreateOrUpdate + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ResourceAssociation Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task CreateOrUpdateNetworkSecurityPerimeterConfigurationAsync(WaitUntil waitUntil, string resourceAssociationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceAssociationName, nameof(resourceAssociationName)); + + using var scope = _networkSecurityPerimeterConfigurationsClientDiagnostics.CreateScope("EventHubsNamespaceResource.CreateOrUpdateNetworkSecurityPerimeterConfiguration"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, resourceAssociationName, cancellationToken).ConfigureAwait(false); + var operation = new EventHubsArmOperation(_networkSecurityPerimeterConfigurationsClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, resourceAssociationName).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Refreshes any information about the association. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations/{resourceAssociationName}/reconcile + /// Operation Id: NetworkSecurityPerimeterConfigurations_CreateOrUpdate + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ResourceAssociation Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual ArmOperation CreateOrUpdateNetworkSecurityPerimeterConfiguration(WaitUntil waitUntil, string resourceAssociationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceAssociationName, nameof(resourceAssociationName)); + + using var scope = _networkSecurityPerimeterConfigurationsClientDiagnostics.CreateScope("EventHubsNamespaceResource.CreateOrUpdateNetworkSecurityPerimeterConfiguration"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, resourceAssociationName, cancellationToken); + var operation = new EventHubsArmOperation(_networkSecurityPerimeterConfigurationsClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, resourceAssociationName).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Check the give Namespace name availability. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/disasterRecoveryConfigs/checkNameAvailability diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNetworkRuleSetData.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNetworkRuleSetData.cs index 30c777af63c7..064f8af5499c 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNetworkRuleSetData.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsNetworkRuleSetData.cs @@ -31,7 +31,7 @@ public EventHubsNetworkRuleSetData() /// Default Action for Network Rule Set. /// List VirtualNetwork Rules. /// List of IpRules. - /// This determines if traffic is allowed over public network. By default it is enabled. + /// This determines if traffic is allowed over public network. By default it is enabled. If value is SecuredByPerimeter then Inbound and Outbound communication is controlled by the network security perimeter and profile's access rules. /// The geo-location where the resource lives. internal EventHubsNetworkRuleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? trustedServiceAccessEnabled, EventHubsNetworkRuleSetDefaultAction? defaultAction, IList virtualNetworkRules, IList ipRules, EventHubsPublicNetworkAccessFlag? publicNetworkAccess, AzureLocation? location) : base(id, name, resourceType, systemData) { @@ -51,7 +51,7 @@ internal EventHubsNetworkRuleSetData(ResourceIdentifier id, string name, Resourc public IList VirtualNetworkRules { get; } /// List of IpRules. public IList IPRules { get; } - /// This determines if traffic is allowed over public network. By default it is enabled. + /// This determines if traffic is allowed over public network. By default it is enabled. If value is SecuredByPerimeter then Inbound and Outbound communication is controlled by the network security perimeter and profile's access rules. public EventHubsPublicNetworkAccessFlag? PublicNetworkAccess { get; set; } /// The geo-location where the resource lives. public AzureLocation? Location { get; } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsPrivateEndpointConnectionResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsPrivateEndpointConnectionResource.cs index ce78b1662bc9..76dd95eeb32b 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsPrivateEndpointConnectionResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsPrivateEndpointConnectionResource.cs @@ -135,7 +135,7 @@ public virtual Response Get(Cancella } /// - /// Deletes an existing namespace. This operation also removes all associated resources under the namespace. + /// Deletes a Private Endpoint Connection. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName} /// Operation Id: PrivateEndpointConnections_Delete /// @@ -161,7 +161,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes an existing namespace. This operation also removes all associated resources under the namespace. + /// Deletes a Private Endpoint Connection. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName} /// Operation Id: PrivateEndpointConnections_Delete /// diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupCollection.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupCollection.cs index cd6a30163a44..9fd4290b7de7 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupCollection.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupCollection.cs @@ -54,6 +54,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// + /// Creates or Updates an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_CreateOrUpdate /// @@ -86,6 +87,7 @@ public virtual async Task> CreateOrUp } /// + /// Creates or Updates an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_CreateOrUpdate /// @@ -118,6 +120,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// @@ -146,6 +149,7 @@ public virtual async Task> GetAsync(strin } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupResource.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupResource.cs index 2c2de32833fa..223a635ba4e1 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupResource.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/EventHubsSchemaGroupResource.cs @@ -87,6 +87,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// @@ -110,6 +111,7 @@ public virtual async Task> GetAsync(Cance } /// + /// Gets the details of an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Get /// @@ -133,6 +135,7 @@ public virtual Response Get(CancellationToken canc } /// + /// Deletes an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Delete /// @@ -158,6 +161,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// + /// Deletes an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_Delete /// @@ -183,6 +187,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// + /// Creates or Updates an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_CreateOrUpdate /// @@ -212,6 +217,7 @@ public virtual async Task> UpdateAsyn } /// + /// Creates or Updates an EventHub schema group. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/schemagroups/{schemaGroupName} /// Operation Id: SchemaRegistry_CreateOrUpdate /// diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs index b18d4e1fa066..f475eb0c80d4 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Extensions/EventHubsExtensions.cs @@ -303,39 +303,39 @@ public static EventHubsNamespaceAuthorizationRuleResource GetEventHubsNamespaceA } #endregion - #region EventHubAuthorizationRuleResource + #region EventHubsDisasterRecoveryAuthorizationRuleResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EventHubAuthorizationRuleResource GetEventHubAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EventHubsDisasterRecoveryAuthorizationRuleResource GetEventHubsDisasterRecoveryAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EventHubAuthorizationRuleResource.ValidateResourceId(id); - return new EventHubAuthorizationRuleResource(client, id); + EventHubsDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); + return new EventHubsDisasterRecoveryAuthorizationRuleResource(client, id); } ); } #endregion - #region EventHubsDisasterRecoveryAuthorizationRuleResource + #region EventHubAuthorizationRuleResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EventHubsDisasterRecoveryAuthorizationRuleResource GetEventHubsDisasterRecoveryAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EventHubAuthorizationRuleResource GetEventHubAuthorizationRuleResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EventHubsDisasterRecoveryAuthorizationRuleResource.ValidateResourceId(id); - return new EventHubsDisasterRecoveryAuthorizationRuleResource(client, id); + EventHubAuthorizationRuleResource.ValidateResourceId(id); + return new EventHubAuthorizationRuleResource(client, id); } ); } @@ -360,39 +360,39 @@ public static EventHubsPrivateEndpointConnectionResource GetEventHubsPrivateEndp } #endregion - #region EventHubResource + #region EventHubsDisasterRecoveryResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EventHubResource GetEventHubResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EventHubsDisasterRecoveryResource GetEventHubsDisasterRecoveryResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EventHubResource.ValidateResourceId(id); - return new EventHubResource(client, id); + EventHubsDisasterRecoveryResource.ValidateResourceId(id); + return new EventHubsDisasterRecoveryResource(client, id); } ); } #endregion - #region EventHubsDisasterRecoveryResource + #region EventHubResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EventHubsDisasterRecoveryResource GetEventHubsDisasterRecoveryResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EventHubResource GetEventHubResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EventHubsDisasterRecoveryResource.ValidateResourceId(id); - return new EventHubsDisasterRecoveryResource(client, id); + EventHubResource.ValidateResourceId(id); + return new EventHubResource(client, id); } ); } @@ -435,5 +435,24 @@ public static EventHubsSchemaGroupResource GetEventHubsSchemaGroupResource(this ); } #endregion + + #region ApplicationGroupResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ApplicationGroupResource GetApplicationGroupResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ApplicationGroupResource.ValidateResourceId(id); + return new ApplicationGroupResource(client, id); + } + ); + } + #endregion } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupData.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupData.Serialization.cs new file mode 100644 index 000000000000..925aafb4cc20 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupData.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.EventHubs.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs +{ + public partial class ApplicationGroupData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("isEnabled"); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(ClientAppGroupIdentifier)) + { + writer.WritePropertyName("clientAppGroupIdentifier"); + writer.WriteStringValue(ClientAppGroupIdentifier); + } + if (Optional.IsCollectionDefined(Policies)) + { + writer.WritePropertyName("policies"); + writer.WriteStartArray(); + foreach (var item in Policies) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ApplicationGroupData DeserializeApplicationGroupData(JsonElement element) + { + Optional location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional isEnabled = default; + Optional clientAppGroupIdentifier = default; + Optional> policies = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("isEnabled")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("clientAppGroupIdentifier")) + { + clientAppGroupIdentifier = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("policies")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ApplicationGroupPolicy.DeserializeApplicationGroupPolicy(item)); + } + policies = array; + continue; + } + } + continue; + } + } + return new ApplicationGroupData(id, name, type, systemData.Value, Optional.ToNullable(isEnabled), clientAppGroupIdentifier.Value, Optional.ToList(policies), Optional.ToNullable(location)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.Serialization.cs new file mode 100644 index 000000000000..b6d32b3d6ea7 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.EventHubs; + +namespace Azure.ResourceManager.EventHubs.Models +{ + internal partial class ApplicationGroupListResult + { + internal static ApplicationGroupListResult DeserializeApplicationGroupListResult(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationGroupData.DeserializeApplicationGroupData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ApplicationGroupListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.cs new file mode 100644 index 000000000000..76f1322ff916 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.EventHubs; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// The response from the List Application Groups operation. + internal partial class ApplicationGroupListResult + { + /// Initializes a new instance of ApplicationGroupListResult. + internal ApplicationGroupListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ApplicationGroupListResult. + /// Result of the List Application Groups operation. + /// Link to the next set of results. Not empty if Value contains an incomplete list of Authorization Rules. + internal ApplicationGroupListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Result of the List Application Groups operation. + public IReadOnlyList Value { get; } + /// Link to the next set of results. Not empty if Value contains an incomplete list of Authorization Rules. + public string NextLink { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.Serialization.cs new file mode 100644 index 000000000000..dd898e100ce3 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class ApplicationGroupPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(PolicyType.ToString()); + writer.WriteEndObject(); + } + + internal static ApplicationGroupPolicy DeserializeApplicationGroupPolicy(JsonElement element) + { + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "ThrottlingPolicy": return ThrottlingPolicy.DeserializeThrottlingPolicy(element); + } + } + return UnknownApplicationGroupPolicy.DeserializeUnknownApplicationGroupPolicy(element); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.cs new file mode 100644 index 000000000000..96e9ffe7781f --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicy.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// + /// Properties of the Application Group policy + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class ApplicationGroupPolicy + { + /// Initializes a new instance of ApplicationGroupPolicy. + /// The Name of this policy. + /// is null. + protected ApplicationGroupPolicy(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of ApplicationGroupPolicy. + /// The Name of this policy. + /// Application Group Policy types. + internal ApplicationGroupPolicy(string name, ApplicationGroupPolicyType policyType) + { + Name = name; + PolicyType = policyType; + } + + /// The Name of this policy. + public string Name { get; set; } + /// Application Group Policy types. + internal ApplicationGroupPolicyType PolicyType { get; set; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicyType.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicyType.cs new file mode 100644 index 000000000000..41ab34c74f92 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ApplicationGroupPolicyType.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.EventHubs.Models +{ + /// Application Group Policy types. + internal readonly partial struct ApplicationGroupPolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ApplicationGroupPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ThrottlingPolicyValue = "ThrottlingPolicy"; + + /// ThrottlingPolicy. + public static ApplicationGroupPolicyType ThrottlingPolicy { get; } = new ApplicationGroupPolicyType(ThrottlingPolicyValue); + /// Determines if two values are the same. + public static bool operator ==(ApplicationGroupPolicyType left, ApplicationGroupPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ApplicationGroupPolicyType left, ApplicationGroupPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ApplicationGroupPolicyType(string value) => new ApplicationGroupPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ApplicationGroupPolicyType other && Equals(other); + /// + public bool Equals(ApplicationGroupPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsClusterData.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsClusterData.Serialization.cs index 780c872f9faa..047c6e2057d6 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsClusterData.Serialization.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsClusterData.Serialization.cs @@ -39,6 +39,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"); writer.WriteStartObject(); + if (Optional.IsDefined(SupportsScaling)) + { + writer.WritePropertyName("supportsScaling"); + writer.WriteBooleanValue(SupportsScaling.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -56,6 +61,7 @@ internal static EventHubsClusterData DeserializeEventHubsClusterData(JsonElement Optional updatedAt = default; Optional metricId = default; Optional status = default; + Optional supportsScaling = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) @@ -152,11 +158,21 @@ internal static EventHubsClusterData DeserializeEventHubsClusterData(JsonElement status = property0.Value.GetString(); continue; } + if (property0.NameEquals("supportsScaling")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + supportsScaling = property0.Value.GetBoolean(); + continue; + } } continue; } } - return new EventHubsClusterData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(createdAt), Optional.ToNullable(updatedAt), metricId.Value, status.Value); + return new EventHubsClusterData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(createdAt), Optional.ToNullable(updatedAt), metricId.Value, status.Value, Optional.ToNullable(supportsScaling)); } } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsNamespaceData.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsNamespaceData.Serialization.cs index 659cfc1ad7e9..88018ab49f16 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsNamespaceData.Serialization.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsNamespaceData.Serialization.cs @@ -44,6 +44,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"); writer.WriteStartObject(); + if (Optional.IsDefined(MinimumTlsVersion)) + { + writer.WritePropertyName("minimumTlsVersion"); + writer.WriteStringValue(MinimumTlsVersion.Value.ToString()); + } if (Optional.IsDefined(ClusterArmId)) { writer.WritePropertyName("clusterArmId"); @@ -54,6 +59,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("isAutoInflateEnabled"); writer.WriteBooleanValue(IsAutoInflateEnabled.Value); } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } if (Optional.IsDefined(MaximumThroughputUnits)) { writer.WritePropertyName("maximumThroughputUnits"); @@ -108,6 +118,7 @@ internal static EventHubsNamespaceData DeserializeEventHubsNamespaceData(JsonEle string name = default; ResourceType type = default; Optional systemData = default; + Optional minimumTlsVersion = default; Optional provisioningState = default; Optional status = default; Optional createdAt = default; @@ -116,6 +127,7 @@ internal static EventHubsNamespaceData DeserializeEventHubsNamespaceData(JsonEle Optional clusterArmId = default; Optional metricId = default; Optional isAutoInflateEnabled = default; + Optional publicNetworkAccess = default; Optional maximumThroughputUnits = default; Optional kafkaEnabled = default; Optional zoneRedundant = default; @@ -199,6 +211,16 @@ internal static EventHubsNamespaceData DeserializeEventHubsNamespaceData(JsonEle } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("minimumTlsVersion")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + minimumTlsVersion = new TlsVersion(property0.Value.GetString()); + continue; + } if (property0.NameEquals("provisioningState")) { provisioningState = property0.Value.GetString(); @@ -259,6 +281,16 @@ internal static EventHubsNamespaceData DeserializeEventHubsNamespaceData(JsonEle isAutoInflateEnabled = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("publicNetworkAccess")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString()); + continue; + } if (property0.NameEquals("maximumThroughputUnits")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -333,7 +365,7 @@ internal static EventHubsNamespaceData DeserializeEventHubsNamespaceData(JsonEle continue; } } - return new EventHubsNamespaceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, identity, provisioningState.Value, status.Value, Optional.ToNullable(createdAt), Optional.ToNullable(updatedAt), serviceBusEndpoint.Value, clusterArmId.Value, metricId.Value, Optional.ToNullable(isAutoInflateEnabled), Optional.ToNullable(maximumThroughputUnits), Optional.ToNullable(kafkaEnabled), Optional.ToNullable(zoneRedundant), encryption.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(disableLocalAuth), alternateName.Value); + return new EventHubsNamespaceData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, identity, Optional.ToNullable(minimumTlsVersion), provisioningState.Value, status.Value, Optional.ToNullable(createdAt), Optional.ToNullable(updatedAt), serviceBusEndpoint.Value, clusterArmId.Value, metricId.Value, Optional.ToNullable(isAutoInflateEnabled), Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(maximumThroughputUnits), Optional.ToNullable(kafkaEnabled), Optional.ToNullable(zoneRedundant), encryption.Value, Optional.ToList(privateEndpointConnections), Optional.ToNullable(disableLocalAuth), alternateName.Value); } } } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsPublicNetworkAccessFlag.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsPublicNetworkAccessFlag.cs index 7b4b5ab69852..99e78b059698 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsPublicNetworkAccessFlag.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/EventHubsPublicNetworkAccessFlag.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.EventHubs.Models { - /// This determines if traffic is allowed over public network. By default it is enabled. + /// This determines if traffic is allowed over public network. By default it is enabled. If value is SecuredByPerimeter then Inbound and Outbound communication is controlled by the network security perimeter and profile's access rules. public readonly partial struct EventHubsPublicNetworkAccessFlag : IEquatable { private readonly string _value; @@ -24,11 +24,14 @@ public EventHubsPublicNetworkAccessFlag(string value) private const string EnabledValue = "Enabled"; private const string DisabledValue = "Disabled"; + private const string SecuredByPerimeterValue = "SecuredByPerimeter"; /// Enabled. public static EventHubsPublicNetworkAccessFlag Enabled { get; } = new EventHubsPublicNetworkAccessFlag(EnabledValue); /// Disabled. public static EventHubsPublicNetworkAccessFlag Disabled { get; } = new EventHubsPublicNetworkAccessFlag(DisabledValue); + /// SecuredByPerimeter. + public static EventHubsPublicNetworkAccessFlag SecuredByPerimeter { get; } = new EventHubsPublicNetworkAccessFlag(SecuredByPerimeterValue); /// Determines if two values are the same. public static bool operator ==(EventHubsPublicNetworkAccessFlag left, EventHubsPublicNetworkAccessFlag right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/MetricId.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/MetricId.cs new file mode 100644 index 000000000000..ec0ec127d321 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/MetricId.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the Metrics section of Event Hub Namespace inside Azure Portal. + public readonly partial struct MetricId : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MetricId(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IncomingBytesValue = "IncomingBytes"; + private const string OutgoingBytesValue = "OutgoingBytes"; + private const string IncomingMessagesValue = "IncomingMessages"; + private const string OutgoingMessagesValue = "OutgoingMessages"; + + /// IncomingBytes. + public static MetricId IncomingBytes { get; } = new MetricId(IncomingBytesValue); + /// OutgoingBytes. + public static MetricId OutgoingBytes { get; } = new MetricId(OutgoingBytesValue); + /// IncomingMessages. + public static MetricId IncomingMessages { get; } = new MetricId(IncomingMessagesValue); + /// OutgoingMessages. + public static MetricId OutgoingMessages { get; } = new MetricId(OutgoingMessagesValue); + /// Determines if two values are the same. + public static bool operator ==(MetricId left, MetricId right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MetricId left, MetricId right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MetricId(string value) => new MetricId(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MetricId other && Equals(other); + /// + public bool Equals(MetricId other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs new file mode 100644 index 000000000000..1c7bc841954f --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NetworkSecurityPerimeter + { + internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element) + { + Optional id = default; + Optional perimeterGuid = default; + Optional location = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("perimeterGuid")) + { + perimeterGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("location")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + } + return new NetworkSecurityPerimeter(id.Value, perimeterGuid.Value, Optional.ToNullable(location)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.cs new file mode 100644 index 000000000000..0e0033ee3f54 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeter.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// NetworkSecurityPerimeter related information. + public partial class NetworkSecurityPerimeter + { + /// Initializes a new instance of NetworkSecurityPerimeter. + internal NetworkSecurityPerimeter() + { + } + + /// Initializes a new instance of NetworkSecurityPerimeter. + /// Fully qualified identifier of the resource. + /// Guid of the resource. + /// Location of the resource. + internal NetworkSecurityPerimeter(string id, string perimeterGuid, AzureLocation? location) + { + Id = id; + PerimeterGuid = perimeterGuid; + Location = location; + } + + /// Fully qualified identifier of the resource. + public string Id { get; } + /// Guid of the resource. + public string PerimeterGuid { get; } + /// Location of the resource. + public AzureLocation? Location { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.Serialization.cs new file mode 100644 index 000000000000..61cd472b8ebf --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NetworkSecurityPerimeterConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(ProvisioningIssues)) + { + writer.WritePropertyName("provisioningIssues"); + writer.WriteStartArray(); + foreach (var item in ProvisioningIssues) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static NetworkSecurityPerimeterConfiguration DeserializeNetworkSecurityPerimeterConfiguration(JsonElement element) + { + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional> provisioningIssues = default; + Optional networkSecurityPerimeter = default; + Optional resourceAssociation = default; + Optional profile = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location")) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = new NetworkSecurityPerimeterConfigurationProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("provisioningIssues")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item)); + } + provisioningIssues = array; + continue; + } + if (property0.NameEquals("networkSecurityPerimeter")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property0.Value); + continue; + } + if (property0.NameEquals("resourceAssociation")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + resourceAssociation = NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.DeserializeNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(property0.Value); + continue; + } + if (property0.NameEquals("profile")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + profile = NetworkSecurityPerimeterConfigurationPropertiesProfile.DeserializeNetworkSecurityPerimeterConfigurationPropertiesProfile(property0.Value); + continue; + } + } + continue; + } + } + return new NetworkSecurityPerimeterConfiguration(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState), Optional.ToList(provisioningIssues), networkSecurityPerimeter.Value, resourceAssociation.Value, profile.Value); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.cs new file mode 100644 index 000000000000..5c27feb621f5 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfiguration.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Network Security Perimeter related configurations of a given namespace. + public partial class NetworkSecurityPerimeterConfiguration : TrackedResourceData + { + /// Initializes a new instance of NetworkSecurityPerimeterConfiguration. + /// The location. + public NetworkSecurityPerimeterConfiguration(AzureLocation location) : base(location) + { + ProvisioningIssues = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkSecurityPerimeterConfiguration. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of NetworkSecurityPerimeter configuration propagation. + /// List of Provisioning Issues if any. + /// NetworkSecurityPerimeter related information. + /// Information about resource association. + /// Information about current network profile. + internal NetworkSecurityPerimeterConfiguration(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState, IList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation, NetworkSecurityPerimeterConfigurationPropertiesProfile profile) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + ProvisioningIssues = provisioningIssues; + NetworkSecurityPerimeter = networkSecurityPerimeter; + ResourceAssociation = resourceAssociation; + Profile = profile; + } + + /// Provisioning state of NetworkSecurityPerimeter configuration propagation. + public NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; set; } + /// List of Provisioning Issues if any. + public IList ProvisioningIssues { get; } + /// NetworkSecurityPerimeter related information. + public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; } + /// Information about resource association. + public NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation ResourceAssociation { get; } + /// Information about current network profile. + public NetworkSecurityPerimeterConfigurationPropertiesProfile Profile { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs new file mode 100644 index 000000000000..c4f600cb7207 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + internal partial class NetworkSecurityPerimeterConfigurationList + { + internal static NetworkSecurityPerimeterConfigurationList DeserializeNetworkSecurityPerimeterConfigurationList(JsonElement element) + { + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeterConfiguration.DeserializeNetworkSecurityPerimeterConfiguration(item)); + } + value = array; + continue; + } + } + return new NetworkSecurityPerimeterConfigurationList(Optional.ToList(value)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs new file mode 100644 index 000000000000..081027be5529 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Result of the List NetworkSecurityPerimeterConfiguration operation. + internal partial class NetworkSecurityPerimeterConfigurationList + { + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationList. + internal NetworkSecurityPerimeterConfigurationList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationList. + /// A collection of NetworkSecurityPerimeterConfigurations. + internal NetworkSecurityPerimeterConfigurationList(IReadOnlyList value) + { + Value = value; + } + + /// A collection of NetworkSecurityPerimeterConfigurations. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.Serialization.cs new file mode 100644 index 000000000000..a208aa1e1b8c --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile + { + internal static NetworkSecurityPerimeterConfigurationPropertiesProfile DeserializeNetworkSecurityPerimeterConfigurationPropertiesProfile(JsonElement element) + { + Optional name = default; + Optional accessRulesVersion = default; + Optional> accessRules = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessRulesVersion")) + { + accessRulesVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessRules")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NspAccessRule.DeserializeNspAccessRule(item)); + } + accessRules = array; + continue; + } + } + return new NetworkSecurityPerimeterConfigurationPropertiesProfile(name.Value, accessRulesVersion.Value, Optional.ToList(accessRules)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs new file mode 100644 index 000000000000..b8ee3dc02a41 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesProfile.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Information about current network profile. + public partial class NetworkSecurityPerimeterConfigurationPropertiesProfile + { + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationPropertiesProfile. + internal NetworkSecurityPerimeterConfigurationPropertiesProfile() + { + AccessRules = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationPropertiesProfile. + /// Name of the resource. + /// Current access rules version. + /// List of Access Rules. + internal NetworkSecurityPerimeterConfigurationPropertiesProfile(string name, string accessRulesVersion, IReadOnlyList accessRules) + { + Name = name; + AccessRulesVersion = accessRulesVersion; + AccessRules = accessRules; + } + + /// Name of the resource. + public string Name { get; } + /// Current access rules version. + public string AccessRulesVersion { get; } + /// List of Access Rules. + public IReadOnlyList AccessRules { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.Serialization.cs new file mode 100644 index 000000000000..158de55d9611 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + { + internal static NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation DeserializeNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(JsonElement element) + { + Optional name = default; + Optional accessMode = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessMode")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + accessMode = new ResourceAssociationAccessMode(property.Value.GetString()); + continue; + } + } + return new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(name.Value, Optional.ToNullable(accessMode)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs new file mode 100644 index 000000000000..38b2951d947f --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Information about resource association. + public partial class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + { + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + internal NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation() + { + } + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + /// Name of the resource association. + /// Access Mode of the resource association. + internal NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(string name, ResourceAssociationAccessMode? accessMode) + { + Name = name; + AccessMode = accessMode; + } + + /// Name of the resource association. + public string Name { get; } + /// Access Mode of the resource association. + public ResourceAssociationAccessMode? AccessMode { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs new file mode 100644 index 000000000000..53d43488974b --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Provisioning state of NetworkSecurityPerimeter configuration propagation. + public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NetworkSecurityPerimeterConfigurationProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string AcceptedValue = "Accepted"; + private const string InvalidResponseValue = "InvalidResponse"; + private const string SucceededValue = "Succeeded"; + private const string SucceededWithIssuesValue = "SucceededWithIssues"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string CanceledValue = "Canceled"; + + /// Unknown. + public static NetworkSecurityPerimeterConfigurationProvisioningState Unknown { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UnknownValue); + /// Creating. + public static NetworkSecurityPerimeterConfigurationProvisioningState Creating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CreatingValue); + /// Updating. + public static NetworkSecurityPerimeterConfigurationProvisioningState Updating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UpdatingValue); + /// Accepted. + public static NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(AcceptedValue); + /// InvalidResponse. + public static NetworkSecurityPerimeterConfigurationProvisioningState InvalidResponse { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(InvalidResponseValue); + /// Succeeded. + public static NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededValue); + /// SucceededWithIssues. + public static NetworkSecurityPerimeterConfigurationProvisioningState SucceededWithIssues { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededWithIssuesValue); + /// Failed. + public static NetworkSecurityPerimeterConfigurationProvisioningState Failed { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(FailedValue); + /// Deleting. + public static NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletingValue); + /// Deleted. + public static NetworkSecurityPerimeterConfigurationProvisioningState Deleted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletedValue); + /// Canceled. + public static NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) => new NetworkSecurityPerimeterConfigurationProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NetworkSecurityPerimeterConfigurationProvisioningState other && Equals(other); + /// + public bool Equals(NetworkSecurityPerimeterConfigurationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.Serialization.cs new file mode 100644 index 000000000000..d23fdbc8f57c --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NspAccessRule + { + internal static NspAccessRule DeserializeNspAccessRule(JsonElement element) + { + Optional properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = NspAccessRuleProperties.DeserializeNspAccessRuleProperties(property.Value); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.ToString()); + continue; + } + } + return new NspAccessRule(id, name, type, systemData.Value, properties.Value); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.cs new file mode 100644 index 000000000000..52ab6f1a53cd --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRule.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Information of Access Rule in Network Profile. + public partial class NspAccessRule : ResourceData + { + /// Initializes a new instance of NspAccessRule. + internal NspAccessRule() + { + } + + /// Initializes a new instance of NspAccessRule. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Properties of Access Rule. + internal NspAccessRule(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NspAccessRuleProperties properties) : base(id, name, resourceType, systemData) + { + Properties = properties; + } + + /// Properties of Access Rule. + public NspAccessRuleProperties Properties { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleDirection.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleDirection.cs new file mode 100644 index 000000000000..b3cd0e299c3d --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleDirection.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.EventHubs.Models +{ + /// Direction of Access Rule. + public readonly partial struct NspAccessRuleDirection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NspAccessRuleDirection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InboundValue = "Inbound"; + private const string OutboundValue = "Outbound"; + + /// Inbound. + public static NspAccessRuleDirection Inbound { get; } = new NspAccessRuleDirection(InboundValue); + /// Outbound. + public static NspAccessRuleDirection Outbound { get; } = new NspAccessRuleDirection(OutboundValue); + /// Determines if two values are the same. + public static bool operator ==(NspAccessRuleDirection left, NspAccessRuleDirection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NspAccessRuleDirection left, NspAccessRuleDirection right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NspAccessRuleDirection(string value) => new NspAccessRuleDirection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NspAccessRuleDirection other && Equals(other); + /// + public bool Equals(NspAccessRuleDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.Serialization.cs new file mode 100644 index 000000000000..1d336bb2f1a9 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.Serialization.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class NspAccessRuleProperties + { + internal static NspAccessRuleProperties DeserializeNspAccessRuleProperties(JsonElement element) + { + Optional direction = default; + Optional> addressPrefixes = default; + Optional> subscriptions = default; + Optional> networkSecurityPerimeters = default; + Optional> fullyQualifiedDomainNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("direction")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + direction = new NspAccessRuleDirection(property.Value.GetString()); + continue; + } + if (property.NameEquals("addressPrefixes")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + addressPrefixes = array; + continue; + } + if (property.NameEquals("subscriptions")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.ToString())); + } + subscriptions = array; + continue; + } + if (property.NameEquals("networkSecurityPerimeters")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item)); + } + networkSecurityPerimeters = array; + continue; + } + if (property.NameEquals("fullyQualifiedDomainNames")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fullyQualifiedDomainNames = array; + continue; + } + } + return new NspAccessRuleProperties(Optional.ToNullable(direction), Optional.ToList(addressPrefixes), Optional.ToList(subscriptions), Optional.ToList(networkSecurityPerimeters), Optional.ToList(fullyQualifiedDomainNames)); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.cs new file mode 100644 index 000000000000..3a7741ca49b2 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/NspAccessRuleProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Properties of Access Rule. + public partial class NspAccessRuleProperties + { + /// Initializes a new instance of NspAccessRuleProperties. + internal NspAccessRuleProperties() + { + AddressPrefixes = new ChangeTrackingList(); + Subscriptions = new ChangeTrackingList(); + NetworkSecurityPerimeters = new ChangeTrackingList(); + FullyQualifiedDomainNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of NspAccessRuleProperties. + /// Direction of Access Rule. + /// Address prefixes in the CIDR format for inbound rules. + /// Subscriptions for inbound rules. + /// NetworkSecurityPerimeters for inbound rules. + /// FQDN for outbound rules. + internal NspAccessRuleProperties(NspAccessRuleDirection? direction, IReadOnlyList addressPrefixes, IReadOnlyList subscriptions, IReadOnlyList networkSecurityPerimeters, IReadOnlyList fullyQualifiedDomainNames) + { + Direction = direction; + AddressPrefixes = addressPrefixes; + Subscriptions = subscriptions; + NetworkSecurityPerimeters = networkSecurityPerimeters; + FullyQualifiedDomainNames = fullyQualifiedDomainNames; + } + + /// Direction of Access Rule. + public NspAccessRuleDirection? Direction { get; } + /// Address prefixes in the CIDR format for inbound rules. + public IReadOnlyList AddressPrefixes { get; } + /// Subscriptions for inbound rules. + public IReadOnlyList Subscriptions { get; } + /// NetworkSecurityPerimeters for inbound rules. + public IReadOnlyList NetworkSecurityPerimeters { get; } + /// FQDN for outbound rules. + public IReadOnlyList FullyQualifiedDomainNames { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.Serialization.cs new file mode 100644 index 000000000000..ac81b9a4311b --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class ProvisioningIssue : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + } + writer.WriteEndObject(); + } + + internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element) + { + Optional name = default; + Optional properties = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value); + continue; + } + } + return new ProvisioningIssue(name.Value, properties.Value); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.cs new file mode 100644 index 000000000000..a3057268900a --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssue.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Describes Provisioning issue for given NetworkSecurityPerimeterConfiguration. + public partial class ProvisioningIssue + { + /// Initializes a new instance of ProvisioningIssue. + public ProvisioningIssue() + { + } + + /// Initializes a new instance of ProvisioningIssue. + /// Name of the issue. + /// Properties of Provisioning Issue. + internal ProvisioningIssue(string name, ProvisioningIssueProperties properties) + { + Name = name; + Properties = properties; + } + + /// Name of the issue. + public string Name { get; set; } + /// Properties of Provisioning Issue. + public ProvisioningIssueProperties Properties { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs new file mode 100644 index 000000000000..f88a580dc7c4 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class ProvisioningIssueProperties + { + internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element) + { + Optional issueType = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("issueType")) + { + issueType = property.Value.GetString(); + continue; + } + if (property.NameEquals("description")) + { + description = property.Value.GetString(); + continue; + } + } + return new ProvisioningIssueProperties(issueType.Value, description.Value); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.cs new file mode 100644 index 000000000000..065a79396cbf --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ProvisioningIssueProperties.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Properties of Provisioning Issue. + public partial class ProvisioningIssueProperties + { + /// Initializes a new instance of ProvisioningIssueProperties. + internal ProvisioningIssueProperties() + { + } + + /// Initializes a new instance of ProvisioningIssueProperties. + /// Type of Issue. + /// Description of the issue. + internal ProvisioningIssueProperties(string issueType, string description) + { + IssueType = issueType; + Description = description; + } + + /// Type of Issue. + public string IssueType { get; } + /// Description of the issue. + public string Description { get; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/PublicNetworkAccess.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..a9a6fcff99c5 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/PublicNetworkAccess.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.EventHubs.Models +{ + /// This determines if traffic is allowed over public network. By default it is enabled. + public readonly partial struct PublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string SecuredByPerimeterValue = "SecuredByPerimeter"; + + /// Enabled. + public static PublicNetworkAccess Enabled { get; } = new PublicNetworkAccess(EnabledValue); + /// Disabled. + public static PublicNetworkAccess Disabled { get; } = new PublicNetworkAccess(DisabledValue); + /// SecuredByPerimeter. + public static PublicNetworkAccess SecuredByPerimeter { get; } = new PublicNetworkAccess(SecuredByPerimeterValue); + /// Determines if two values are the same. + public static bool operator ==(PublicNetworkAccess left, PublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicNetworkAccess left, PublicNetworkAccess right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PublicNetworkAccess(string value) => new PublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicNetworkAccess other && Equals(other); + /// + public bool Equals(PublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ResourceAssociationAccessMode.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ResourceAssociationAccessMode.cs new file mode 100644 index 000000000000..58b4d0cebb7a --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ResourceAssociationAccessMode.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Access Mode of the resource association. + public readonly partial struct ResourceAssociationAccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceAssociationAccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoAssociationModeValue = "NoAssociationMode"; + private const string EnforcedModeValue = "EnforcedMode"; + private const string LearningModeValue = "LearningMode"; + private const string AuditModeValue = "AuditMode"; + private const string UnspecifiedModeValue = "UnspecifiedMode"; + + /// NoAssociationMode. + public static ResourceAssociationAccessMode NoAssociationMode { get; } = new ResourceAssociationAccessMode(NoAssociationModeValue); + /// EnforcedMode. + public static ResourceAssociationAccessMode EnforcedMode { get; } = new ResourceAssociationAccessMode(EnforcedModeValue); + /// LearningMode. + public static ResourceAssociationAccessMode LearningMode { get; } = new ResourceAssociationAccessMode(LearningModeValue); + /// AuditMode. + public static ResourceAssociationAccessMode AuditMode { get; } = new ResourceAssociationAccessMode(AuditModeValue); + /// UnspecifiedMode. + public static ResourceAssociationAccessMode UnspecifiedMode { get; } = new ResourceAssociationAccessMode(UnspecifiedModeValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceAssociationAccessMode(string value) => new ResourceAssociationAccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceAssociationAccessMode other && Equals(other); + /// + public bool Equals(ResourceAssociationAccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.Serialization.cs new file mode 100644 index 000000000000..0612c9261adc --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + public partial class ThrottlingPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("rateLimitThreshold"); + writer.WriteNumberValue(RateLimitThreshold); + writer.WritePropertyName("metricId"); + writer.WriteStringValue(MetricId.ToString()); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(PolicyType.ToString()); + writer.WriteEndObject(); + } + + internal static ThrottlingPolicy DeserializeThrottlingPolicy(JsonElement element) + { + long rateLimitThreshold = default; + MetricId metricId = default; + string name = default; + ApplicationGroupPolicyType type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rateLimitThreshold")) + { + rateLimitThreshold = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("metricId")) + { + metricId = new MetricId(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ApplicationGroupPolicyType(property.Value.GetString()); + continue; + } + } + return new ThrottlingPolicy(name, type, rateLimitThreshold, metricId); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.cs new file mode 100644 index 000000000000..061bbd13bb22 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/ThrottlingPolicy.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// Properties of the throttling policy. + public partial class ThrottlingPolicy : ApplicationGroupPolicy + { + /// Initializes a new instance of ThrottlingPolicy. + /// The Name of this policy. + /// The Threshold limit above which the application group will be throttled.Rate limit is always per second. + /// Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the Metrics section of Event Hub Namespace inside Azure Portal. + /// is null. + public ThrottlingPolicy(string name, long rateLimitThreshold, MetricId metricId) : base(name) + { + Argument.AssertNotNull(name, nameof(name)); + + RateLimitThreshold = rateLimitThreshold; + MetricId = metricId; + PolicyType = ApplicationGroupPolicyType.ThrottlingPolicy; + } + + /// Initializes a new instance of ThrottlingPolicy. + /// The Name of this policy. + /// Application Group Policy types. + /// The Threshold limit above which the application group will be throttled.Rate limit is always per second. + /// Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the Metrics section of Event Hub Namespace inside Azure Portal. + internal ThrottlingPolicy(string name, ApplicationGroupPolicyType policyType, long rateLimitThreshold, MetricId metricId) : base(name, policyType) + { + RateLimitThreshold = rateLimitThreshold; + MetricId = metricId; + PolicyType = policyType; + } + + /// The Threshold limit above which the application group will be throttled.Rate limit is always per second. + public long RateLimitThreshold { get; set; } + /// Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the Metrics section of Event Hub Namespace inside Azure Portal. + public MetricId MetricId { get; set; } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/TlsVersion.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/TlsVersion.cs new file mode 100644 index 000000000000..a9f146dcfa11 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/TlsVersion.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.EventHubs.Models +{ + /// The minimum TLS version for the cluster to support, e.g. '1.2'. + public readonly partial struct TlsVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TlsVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string One0Value = "1.0"; + private const string One1Value = "1.1"; + private const string One2Value = "1.2"; + + /// 1.0. + public static TlsVersion One0 { get; } = new TlsVersion(One0Value); + /// 1.1. + public static TlsVersion One1 { get; } = new TlsVersion(One1Value); + /// 1.2. + public static TlsVersion One2 { get; } = new TlsVersion(One2Value); + /// Determines if two values are the same. + public static bool operator ==(TlsVersion left, TlsVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TlsVersion left, TlsVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TlsVersion(string value) => new TlsVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TlsVersion other && Equals(other); + /// + public bool Equals(TlsVersion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.Serialization.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.Serialization.cs new file mode 100644 index 000000000000..6153ca3655c6 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EventHubs.Models +{ + internal partial class UnknownApplicationGroupPolicy : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"); + writer.WriteStringValue(PolicyType.ToString()); + writer.WriteEndObject(); + } + + internal static UnknownApplicationGroupPolicy DeserializeUnknownApplicationGroupPolicy(JsonElement element) + { + string name = default; + ApplicationGroupPolicyType type = "Unknown"; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ApplicationGroupPolicyType(property.Value.GetString()); + continue; + } + } + return new UnknownApplicationGroupPolicy(name, type); + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.cs new file mode 100644 index 000000000000..62e555624232 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/Models/UnknownApplicationGroupPolicy.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.EventHubs.Models +{ + /// The UnknownApplicationGroupPolicy. + internal partial class UnknownApplicationGroupPolicy : ApplicationGroupPolicy + { + /// Initializes a new instance of UnknownApplicationGroupPolicy. + /// The Name of this policy. + /// Application Group Policy types. + internal UnknownApplicationGroupPolicy(string name, ApplicationGroupPolicyType policyType) : base(name, policyType) + { + PolicyType = policyType; + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ApplicationGroupRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ApplicationGroupRestOperations.cs new file mode 100644 index 000000000000..a2b0a4b2dfe7 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ApplicationGroupRestOperations.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EventHubs.Models; + +namespace Azure.ResourceManager.EventHubs +{ + internal partial class ApplicationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ApplicationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ApplicationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-01-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByNamespaceRequest(string subscriptionId, string resourceGroupName, string namespaceName) + { + 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.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/applicationGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a list of application groups for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNamespaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGroupListResult.DeserializeApplicationGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of application groups for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNamespace(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGroupListResult.DeserializeApplicationGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateApplicationGroupRequest(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, ApplicationGroupData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/applicationGroups/", false); + uri.AppendPath(applicationGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The ApplicationGroup. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateApplicationGroupAsync(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateApplicationGroupRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGroupData.DeserializeApplicationGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The ApplicationGroup. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateApplicationGroup(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, ApplicationGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateApplicationGroupRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGroupData.DeserializeApplicationGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName) + { + 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.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/applicationGroups/", false); + uri.AppendPath(applicationGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName) + { + 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.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/applicationGroups/", false); + uri.AppendPath(applicationGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGroupData.DeserializeApplicationGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ApplicationGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets an ApplicationGroup for a Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The Application Group name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string applicationGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(applicationGroupName, nameof(applicationGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, applicationGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGroupData.DeserializeApplicationGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ApplicationGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByNamespaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName) + { + 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; + } + + /// Gets a list of application groups for a Namespace. + /// The URL to the next page of results. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNamespaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ApplicationGroupListResult.DeserializeApplicationGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a list of application groups for a Namespace. + /// The URL to the next page of results. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNamespaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ApplicationGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ApplicationGroupListResult.DeserializeApplicationGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ClustersRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ClustersRestOperations.cs index 1c8a19ef0a6f..cb58fa33023b 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ClustersRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ClustersRestOperations.cs @@ -33,7 +33,7 @@ public ClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConfigurationRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConfigurationRestOperations.cs index 79fc6a005c9a..c97f0244f422 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConfigurationRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConfigurationRestOperations.cs @@ -33,7 +33,7 @@ public ConfigurationRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConsumerGroupsRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConsumerGroupsRestOperations.cs index c33935df8fad..83f83c0c238d 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConsumerGroupsRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/ConsumerGroupsRestOperations.cs @@ -33,7 +33,7 @@ public ConsumerGroupsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/DisasterRecoveryConfigsRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/DisasterRecoveryConfigsRestOperations.cs index 3e4cd7883ff9..4c2128ae3147 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/DisasterRecoveryConfigsRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/DisasterRecoveryConfigsRestOperations.cs @@ -33,15 +33,15 @@ public DisasterRecoveryConfigsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content) + internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -50,42 +50,40 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/disasterRecoveryConfigs/checkNameAvailability", false); + uri.AppendPath("/disasterRecoveryConfigs/", false); + uri.AppendPath(@alias, true); + uri.AppendPath("/authorizationRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Check the give Namespace name availability. + /// Gets a list of authorization rules for a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Parameters to check availability of the given Alias name. + /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CheckNameAvailabilityAsync(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAuthorizationRulesAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, resourceGroupName, namespaceName, content); + using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsNameAvailabilityResult value = default; + AuthorizationRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsNameAvailabilityResult.DeserializeEventHubsNameAvailabilityResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -93,30 +91,30 @@ public async Task> CheckNameAvailabili } } - /// Check the give Namespace name availability. + /// Gets a list of authorization rules for a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Parameters to check availability of the given Alias name. + /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CheckNameAvailability(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListAuthorizationRules(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, resourceGroupName, namespaceName, content); + using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsNameAvailabilityResult value = default; + AuthorizationRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsNameAvailabilityResult.DeserializeEventHubsNameAvailabilityResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -124,7 +122,7 @@ public Response CheckNameAvailability(string su } } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string namespaceName) + internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -137,7 +135,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/disasterRecoveryConfigs", false); + uri.AppendPath("/disasterRecoveryConfigs/", false); + uri.AppendPath(@alias, true); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -145,69 +146,81 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Gets all Alias(Disaster Recovery configurations). + /// Gets an AuthorizationRule for a Namespace by rule name. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. + /// The Disaster Recovery configuration name. + /// The authorization rule name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); + using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ArmDisasterRecoveryListResult value = default; + EventHubsAuthorizationRuleData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets all Alias(Disaster Recovery configurations). + /// Gets an AuthorizationRule for a Namespace by rule name. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. + /// The Disaster Recovery configuration name. + /// The authorization rule name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); + using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ArmDisasterRecoveryListResult value = default; + EventHubsAuthorizationRuleData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data) + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -218,92 +231,87 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; _userAgent.Apply(message); return message; } - /// Creates or updates a new Alias(Disaster Recovery configuration). + /// Gets the primary and secondary connection strings for the Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// Parameters required to create an Alias(Disaster Recovery configuration). + /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, @alias, data); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsDisasterRecoveryData value = default; + EventHubsAccessKeys value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } - case 201: - return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Creates or updates a new Alias(Disaster Recovery configuration). + /// Gets the primary and secondary connection strings for the Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// Parameters required to create an Alias(Disaster Recovery configuration). + /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, @alias, data); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsDisasterRecoveryData value = default; + EventHubsAccessKeys value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } - case 201: - return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -312,70 +320,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/disasterRecoveryConfigs/", false); - uri.AppendPath(@alias, true); + uri.AppendPath("/disasterRecoveryConfigs/checkNameAvailability", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Deletes an Alias(Disaster Recovery configuration). + /// Check the give Namespace name availability. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. + /// Parameters to check availability of the given Alias name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CheckNameAvailabilityAsync(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, resourceGroupName, namespaceName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubsNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventHubsNameAvailabilityResult.DeserializeEventHubsNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes an Alias(Disaster Recovery configuration). + /// Check the give Namespace name availability. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. + /// Parameters to check availability of the given Alias name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CheckNameAvailability(string subscriptionId, string resourceGroupName, string namespaceName, EventHubsNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, resourceGroupName, namespaceName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubsNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventHubsNameAvailabilityResult.DeserializeEventHubsNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string namespaceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -388,8 +407,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/disasterRecoveryConfigs/", false); - uri.AppendPath(@alias, true); + uri.AppendPath("/disasterRecoveryConfigs", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -397,77 +415,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + /// Gets all Alias(Disaster Recovery configurations). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsDisasterRecoveryData value = default; + ArmDisasterRecoveryListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. + /// Gets all Alias(Disaster Recovery configurations). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsDisasterRecoveryData value = default; + ArmDisasterRecoveryListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateBreakPairingRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -478,71 +488,92 @@ internal HttpMessage CreateBreakPairingRequest(string subscriptionId, string res uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); - uri.AppendPath("/breakPairing", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; _userAgent.Apply(message); return message; } - /// This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + /// Creates or updates a new Alias(Disaster Recovery configuration). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. + /// Parameters required to create an Alias(Disaster Recovery configuration). /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task BreakPairingAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateBreakPairingRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, @alias, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - return message.Response; + { + EventHubsDisasterRecoveryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 201: + return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. + /// Creates or updates a new Alias(Disaster Recovery configuration). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. + /// Parameters required to create an Alias(Disaster Recovery configuration). /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response BreakPairing(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, EventHubsDisasterRecoveryData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateBreakPairingRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, @alias, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - return message.Response; + { + EventHubsDisasterRecoveryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 201: + return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateFailOverRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -553,7 +584,6 @@ internal HttpMessage CreateFailOverRequest(string subscriptionId, string resourc uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); - uri.AppendPath("/failover", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -561,7 +591,7 @@ internal HttpMessage CreateFailOverRequest(string subscriptionId, string resourc return message; } - /// Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + /// Deletes an Alias(Disaster Recovery configuration). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -569,25 +599,26 @@ internal HttpMessage CreateFailOverRequest(string subscriptionId, string resourc /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task FailOverAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateFailOverRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. + /// Deletes an Alias(Disaster Recovery configuration). /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -595,25 +626,26 @@ public async Task FailOverAsync(string subscriptionId, string resource /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response FailOver(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateFailOverRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -628,7 +660,6 @@ internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); - uri.AppendPath("/authorizationRules", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -636,7 +667,7 @@ internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, return message; } - /// Gets a list of authorization rules for a Namespace. + /// Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -644,30 +675,32 @@ internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAuthorizationRulesAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubsDisasterRecoveryData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a list of authorization rules for a Namespace. + /// Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -675,34 +708,36 @@ public async Task> ListAuthorizationRulesA /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListAuthorizationRules(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubsDisasterRecoveryData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubsDisasterRecoveryData.DeserializeEventHubsDisasterRecoveryData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubsDisasterRecoveryData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName) + internal HttpMessage CreateBreakPairingRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -713,8 +748,7 @@ internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, st uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); + uri.AppendPath("/breakPairing", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -722,77 +756,59 @@ internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, st return message; } - /// Gets an AuthorizationRule for a Namespace by rule name. + /// This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task BreakPairingAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); + using var message = CreateBreakPairingRequest(subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - EventHubsAuthorizationRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets an AuthorizationRule for a Namespace by rule name. + /// This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response BreakPairing(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); + using var message = CreateBreakPairingRequest(subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - EventHubsAuthorizationRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName) + internal HttpMessage CreateFailOverRequest(string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -807,9 +823,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc uri.AppendPath(namespaceName, true); uri.AppendPath("/disasterRecoveryConfigs/", false); uri.AppendPath(@alias, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); - uri.AppendPath("/listKeys", false); + uri.AppendPath("/failover", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -817,73 +831,59 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc return message; } - /// Gets the primary and secondary connection strings for the Namespace. + /// Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task FailOverAsync(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); + using var message = CreateFailOverRequest(subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - EventHubsAccessKeys value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets the primary and secondary connection strings for the Namespace. + /// Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Disaster Recovery configuration name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListKeys(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response FailOver(string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, @alias, authorizationRuleName); + using var message = CreateFailOverRequest(subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - EventHubsAccessKeys value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName) + internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -897,30 +897,32 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Gets all Alias(Disaster Recovery configurations). + /// Gets a list of authorization rules for a Namespace. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. + /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAuthorizationRulesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); + using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, @alias); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ArmDisasterRecoveryListResult value = default; + AuthorizationRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -928,30 +930,32 @@ public async Task> ListNextPageAsync(str } } - /// Gets all Alias(Disaster Recovery configurations). + /// Gets a list of authorization rules for a Namespace. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. + /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListAuthorizationRulesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); + using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, @alias); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ArmDisasterRecoveryListResult value = default; + AuthorizationRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -959,7 +963,7 @@ public Response ListNextPage(string nextLink, str } } - internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -973,32 +977,30 @@ internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink return message; } - /// Gets a list of authorization rules for a Namespace. + /// Gets all Alias(Disaster Recovery configurations). /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAuthorizationRulesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + ArmDisasterRecoveryListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1006,32 +1008,30 @@ public async Task> ListAuthorizationRulesN } } - /// Gets a list of authorization rules for a Namespace. + /// Gets all Alias(Disaster Recovery configurations). /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Disaster Recovery configuration name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListAuthorizationRulesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string @alias, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(@alias, nameof(@alias)); - using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, @alias); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + ArmDisasterRecoveryListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/EventHubsRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/EventHubsRestOperations.cs index b03933c598a6..67e94e85d6a2 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/EventHubsRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/EventHubsRestOperations.cs @@ -33,11 +33,11 @@ public EventHubsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListByNamespaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, int? skip, int? top) + internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -50,46 +50,40 @@ internal HttpMessage CreateListByNamespaceRequest(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/eventhubs", false); + uri.AppendPath("/eventhubs/", false); + uri.AppendPath(eventHubName, true); + uri.AppendPath("/authorizationRules", false); uri.AppendQuery("api-version", _apiVersion, true); - if (skip != null) - { - uri.AppendQuery("$skip", skip.Value, true); - } - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets all the Event Hubs in a Namespace. + /// Gets the authorization rules for an Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N usageDetails. + /// The Event Hub name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNamespaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAuthorizationRulesAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName, skip, top); + using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubListResult value = default; + AuthorizationRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -97,30 +91,30 @@ public async Task> ListByNamespaceAsync(string subs } } - /// Gets all the Event Hubs in a Namespace. + /// Gets the authorization rules for an Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N usageDetails. + /// The Event Hub name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByNamespace(string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListAuthorizationRules(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName, skip, top); + using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubListResult value = default; + AuthorizationRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -128,7 +122,7 @@ public Response ListByNamespace(string subscriptionId, strin } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data) + internal HttpMessage CreateCreateOrUpdateAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -143,6 +137,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -154,32 +150,34 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Creates or updates a new Event Hub as a nested resource within a Namespace. + /// Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// Parameters supplied to create an Event Hub resource. + /// The authorization rule name. + /// The shared access AuthorizationRule. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, data); + using var message = CreateCreateOrUpdateAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubData value = default; + EventHubsAuthorizationRuleData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubData.DeserializeEventHubData(document.RootElement); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -187,32 +185,34 @@ public async Task> CreateOrUpdateAsync(string subscriptio } } - /// Creates or updates a new Event Hub as a nested resource within a Namespace. + /// Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// Parameters supplied to create an Event Hub resource. + /// The authorization rule name. + /// The shared access AuthorizationRule. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, data); + using var message = CreateCreateOrUpdateAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubData value = default; + EventHubsAuthorizationRuleData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubData.DeserializeEventHubData(document.RootElement); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -220,11 +220,11 @@ public Response CreateOrUpdate(string subscriptionId, string resou } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) + internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -235,6 +235,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -242,65 +244,81 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes an Event Hub from the specified Namespace and resource group. + /// Gets an AuthorizationRule for an Event Hub by rule name. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubsAuthorizationRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Deletes an Event Hub from the specified Namespace and resource group. + /// Gets an AuthorizationRule for an Event Hub by rule name. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubsAuthorizationRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) + internal HttpMessage CreateDeleteAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -311,6 +329,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -318,77 +338,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets an Event Hubs description for the specified Event Hub. + /// Deletes an Event Hub AuthorizationRule. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateDeleteAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - EventHubData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubData.DeserializeEventHubData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EventHubData)null, message.Response); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets an Event Hubs description for the specified Event Hub. + /// Deletes an Event Hub AuthorizationRule. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateDeleteAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - EventHubData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubData.DeserializeEventHubData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EventHubData)null, message.Response); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -399,7 +411,9 @@ internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); - uri.AppendPath("/authorizationRules", false); + uri.AppendPath("/authorizationRules/", false); + uri.AppendPath(authorizationRuleName, true); + uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -407,30 +421,32 @@ internal HttpMessage CreateListAuthorizationRulesRequest(string subscriptionId, return message; } - /// Gets the authorization rules for an Event Hub. + /// Gets the ACS and SAS connection strings for the Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAuthorizationRulesAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubsAccessKeys value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -438,30 +454,32 @@ public async Task> ListAuthorizationRulesA } } - /// Gets the authorization rules for an Event Hub. + /// Gets the ACS and SAS connection strings for the Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. + /// The authorization rule name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListAuthorizationRules(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListAuthorizationRulesRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubsAccessKeys value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -469,11 +487,11 @@ public Response ListAuthorizationRules(string subsc } } - internal HttpMessage CreateCreateOrUpdateAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data) + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -486,45 +504,46 @@ internal HttpMessage CreateCreateOrUpdateAuthorizationRuleRequest(string subscri uri.AppendPath(eventHubName, true); uri.AppendPath("/authorizationRules/", false); uri.AppendPath(authorizationRuleName, true); + uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + /// Regenerates the ACS and SAS connection strings for the Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. /// The authorization rule name. - /// The shared access AuthorizationRule. + /// Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). /// The cancellation token to use. - /// , , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data, CancellationToken cancellationToken = default) + public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, data); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsAuthorizationRuleData value = default; + EventHubsAccessKeys value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -532,34 +551,34 @@ public async Task> CreateOrUpdateAuthor } } - /// Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the AuthorizationRule will take a few seconds to take effect. + /// Regenerates the ACS and SAS connection strings for the Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. /// The authorization rule name. - /// The shared access AuthorizationRule. + /// Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). /// The cancellation token to use. - /// , , , , or is null. + /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdateAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsAuthorizationRuleData data, CancellationToken cancellationToken = default) + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, data); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsAuthorizationRuleData value = default; + EventHubsAccessKeys value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -567,7 +586,7 @@ public Response CreateOrUpdateAuthorizationRule( } } - internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) + internal HttpMessage CreateListByNamespaceRequest(string subscriptionId, string resourceGroupName, string namespaceName, int? skip, int? top) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -580,92 +599,89 @@ internal HttpMessage CreateGetAuthorizationRuleRequest(string subscriptionId, st uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false); uri.AppendPath(namespaceName, true); - uri.AppendPath("/eventhubs/", false); - uri.AppendPath(eventHubName, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); + uri.AppendPath("/eventhubs", false); uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets an AuthorizationRule for an Event Hub by rule name. + /// Gets all the Event Hubs in a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Event Hub name. - /// The authorization rule name. + /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N usageDetails. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNamespaceAsync(string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName, skip, top); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsAuthorizationRuleData value = default; + EventHubListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets an AuthorizationRule for an Event Hub by rule name. + /// Gets all the Event Hubs in a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Event Hub name. - /// The authorization rule name. + /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N usageDetails. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response GetAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNamespace(string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateGetAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateListByNamespaceRequest(subscriptionId, resourceGroupName, namespaceName, skip, top); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsAuthorizationRuleData value = default; + EventHubListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAuthorizationRuleData.DeserializeEventHubsAuthorizationRuleData(document.RootElement); + value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((EventHubsAuthorizationRuleData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateDeleteAuthorizationRuleRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -676,78 +692,88 @@ internal HttpMessage CreateDeleteAuthorizationRuleRequest(string subscriptionId, uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes an Event Hub AuthorizationRule. + /// Creates or updates a new Event Hub as a nested resource within a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. + /// Parameters supplied to create an Event Hub resource. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAuthorizationRuleAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EventHubData.DeserializeEventHubData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes an Event Hub AuthorizationRule. + /// Creates or updates a new Event Hub as a nested resource within a Namespace. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. + /// Parameters supplied to create an Event Hub resource. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response DeleteAuthorizationRule(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, EventHubData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteAuthorizationRuleRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + EventHubData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EventHubData.DeserializeEventHubData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -758,9 +784,6 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); - uri.AppendPath("/listKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -768,77 +791,65 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc return message; } - /// Gets the ACS and SAS connection strings for the Event Hub. + /// Deletes an Event Hub from the specified Namespace and resource group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - EventHubsAccessKeys value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets the ACS and SAS connection strings for the Event Hub. + /// Deletes an Event Hub from the specified Namespace and resource group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListKeys(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - EventHubsAccessKeys value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -849,91 +860,80 @@ internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string r uri.AppendPath(namespaceName, true); uri.AppendPath("/eventhubs/", false); uri.AppendPath(eventHubName, true); - uri.AppendPath("/authorizationRules/", false); - uri.AppendPath(authorizationRuleName, true); - uri.AppendPath("/regenerateKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Regenerates the ACS and SAS connection strings for the Event Hub. + /// Gets an Event Hubs description for the specified Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. - /// Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubsAccessKeys value = default; + EventHubData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); + value = EventHubData.DeserializeEventHubData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Regenerates the ACS and SAS connection strings for the Event Hub. + /// Gets an Event Hubs description for the specified Event Hub. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. /// The Event Hub name. - /// The authorization rule name. - /// Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/SecondaryKey). /// The cancellation token to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, string authorizationRuleName, EventHubsRegenerateAccessKeyContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - Argument.AssertNotNullOrEmpty(authorizationRuleName, nameof(authorizationRuleName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName, authorizationRuleName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, namespaceName, eventHubName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubsAccessKeys value = default; + EventHubData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubsAccessKeys.DeserializeEventHubsAccessKeys(document.RootElement); + value = EventHubData.DeserializeEventHubData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((EventHubData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListByNamespaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip, int? top) + internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -947,32 +947,32 @@ internal HttpMessage CreateListByNamespaceNextPageRequest(string nextLink, strin return message; } - /// Gets all the Event Hubs in a Namespace. + /// Gets the authorization rules for an Event Hub. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N usageDetails. + /// The Event Hub name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByNamespaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAuthorizationRulesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, skip, top); + using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, eventHubName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - EventHubListResult value = default; + AuthorizationRuleListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -980,32 +980,32 @@ public async Task> ListByNamespaceNextPageAsync(str } } - /// Gets all the Event Hubs in a Namespace. + /// Gets the authorization rules for an Event Hub. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. - /// May be used to limit the number of results to the most recent N usageDetails. + /// The Event Hub name. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByNamespaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListAuthorizationRulesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, skip, top); + using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, eventHubName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - EventHubListResult value = default; + AuthorizationRuleListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); + value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1013,7 +1013,7 @@ public Response ListByNamespaceNextPage(string nextLink, str } } - internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName) + internal HttpMessage CreateListByNamespaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip, int? top) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1027,32 +1027,32 @@ internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink return message; } - /// Gets the authorization rules for an Event Hub. + /// Gets all the Event Hubs in a Namespace. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Event Hub name. + /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N usageDetails. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAuthorizationRulesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByNamespaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, skip, top); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1060,32 +1060,32 @@ public async Task> ListAuthorizationRulesN } } - /// Gets the authorization rules for an Event Hub. + /// Gets all the Event Hubs in a Namespace. /// The URL to the next page of results. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. - /// The Event Hub name. + /// Skip is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. + /// May be used to limit the number of results to the most recent N usageDetails. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListAuthorizationRulesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, string eventHubName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByNamespaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string namespaceName, int? skip = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); - Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); - using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, eventHubName); + using var message = CreateListByNamespaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, namespaceName, skip, top); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AuthorizationRuleListResult value = default; + EventHubListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElement); + value = EventHubListResult.DeserializeEventHubListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NamespacesRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NamespacesRestOperations.cs index 7f673a365302..15236501e285 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NamespacesRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NamespacesRestOperations.cs @@ -33,7 +33,7 @@ public NamespacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationRestOperations.cs new file mode 100644 index 000000000000..4258228bf033 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationRestOperations.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EventHubs.Models; + +namespace Azure.ResourceManager.EventHubs +{ + internal partial class NetworkSecurityPerimeterConfigurationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public NetworkSecurityPerimeterConfigurationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-01-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string namespaceName) + { + 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.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets list of current NetworkSecurityPerimeterConfiguration for Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets list of current NetworkSecurityPerimeterConfiguration for Namespace. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, namespaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs new file mode 100644 index 000000000000..e375f6dca181 --- /dev/null +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.EventHubs +{ + internal partial class NetworkSecurityPerimeterConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-01-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string namespaceName, string resourceAssociationName) + { + 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.EventHub/namespaces/", false); + uri.AppendPath(namespaceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(resourceAssociationName, true); + uri.AppendPath("/reconcile", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Refreshes any information about the association. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The ResourceAssociation Name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string namespaceName, string resourceAssociationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(resourceAssociationName, nameof(resourceAssociationName)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, resourceAssociationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Refreshes any information about the association. + /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// Name of the resource group within the azure subscription. + /// The Namespace name. + /// The ResourceAssociation Name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string namespaceName, string resourceAssociationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(namespaceName, nameof(namespaceName)); + Argument.AssertNotNullOrEmpty(resourceAssociationName, nameof(resourceAssociationName)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, namespaceName, resourceAssociationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 5f18beeec15b..89d880841b4d 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -165,6 +165,7 @@ public async Task> CreateOrUpda { case 200: case 201: + case 202: { EventHubsPrivateEndpointConnectionData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); @@ -199,6 +200,7 @@ public Response CreateOrUpdate(string su { case 200: case 201: + case 202: { EventHubsPrivateEndpointConnectionData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); @@ -232,7 +234,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes an existing namespace. This operation also removes all associated resources under the namespace. + /// Deletes a Private Endpoint Connection. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -260,7 +262,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Deletes an existing namespace. This operation also removes all associated resources under the namespace. + /// Deletes a Private Endpoint Connection. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 3fabd7880fec..345a0818d107 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/SchemaRegistryRestOperations.cs b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/SchemaRegistryRestOperations.cs index 543991000834..da6e3772cf0c 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/SchemaRegistryRestOperations.cs +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/Generated/RestOperations/SchemaRegistryRestOperations.cs @@ -33,7 +33,7 @@ public SchemaRegistryRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-01"; + _apiVersion = apiVersion ?? "2022-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -154,6 +154,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } + /// Creates or Updates an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -186,6 +187,7 @@ public async Task> CreateOrUpdateAsync(string } } + /// Creates or Updates an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -240,6 +242,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } + /// Deletes an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -266,6 +269,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } + /// Deletes an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -314,6 +318,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } + /// Gets the details of an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. @@ -346,6 +351,7 @@ public async Task> GetAsync(string subscripti } } + /// Gets the details of an EventHub schema group. /// Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// Name of the resource group within the azure subscription. /// The Namespace name. diff --git a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/autorest.md b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/autorest.md index d460cad138d5..50f96369acab 100644 --- a/sdk/eventhub/Azure.ResourceManager.EventHubs/src/autorest.md +++ b/sdk/eventhub/Azure.ResourceManager.EventHubs/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true namespace: Azure.ResourceManager.EventHubs output-folder: $(this-folder)/Generated -require: https://github.com/Azure/azure-rest-api-specs/blob/8fb0263a6adbb529a9a7bf3e56110f3abdd55c72/specification/eventhub/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventhub/resource-manager/readme.md clear-output-folder: true skip-csproj: true