diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/api/Azure.ResourceManager.SignalR.netstandard2.0.cs b/sdk/signalr/Azure.ResourceManager.SignalR/api/Azure.ResourceManager.SignalR.netstandard2.0.cs index 9562461f4d34e..c2f4458369ec9 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/api/Azure.ResourceManager.SignalR.netstandard2.0.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/api/Azure.ResourceManager.SignalR.netstandard2.0.cs @@ -1,5 +1,67 @@ namespace Azure.ResourceManager.SignalR { + public partial class ReplicaCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ReplicaCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicaName, Azure.ResourceManager.SignalR.ReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicaName, Azure.ResourceManager.SignalR.ReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicaName, 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 replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string replicaName, 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 ReplicaData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ReplicaData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? ProvisioningState { get { throw null; } } + public string RegionEndpointEnabled { get { throw null; } set { } } + public string ResourceStopped { get { throw null; } set { } } + public Azure.ResourceManager.SignalR.Models.SignalRResourceSku Sku { get { throw null; } set { } } + Azure.ResourceManager.SignalR.ReplicaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SignalR.ReplicaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReplicaResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ReplicaResource() { } + public virtual Azure.ResourceManager.SignalR.ReplicaData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) { 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.Pageable GetReplicaSkusSignalRs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetReplicaSkusSignalRsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSignalRReplicaSharedPrivateLinkResource(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSignalRReplicaSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SignalR.SignalRReplicaSharedPrivateLinkResourceCollection GetSignalRReplicaSharedPrivateLinkResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Restart(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RestartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SignalR.ReplicaData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SignalR.ReplicaData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.ReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.ReplicaData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class SignalRCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected SignalRCollection() { } @@ -133,7 +195,10 @@ public SignalRData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? ProvisioningState { get { throw null; } } public string PublicNetworkAccess { get { throw null; } set { } } public int? PublicPort { get { throw null; } } + public string RegionEndpointEnabled { get { throw null; } set { } } public System.Collections.Generic.IList ResourceLogCategories { get { throw null; } } + public string ResourceStopped { get { throw null; } set { } } + public int? ServerlessConnectionTimeoutInSeconds { get { throw null; } set { } } public int? ServerPort { get { throw null; } } public System.Collections.Generic.IReadOnlyList SharedPrivateLinkResources { get { throw null; } } public Azure.ResourceManager.SignalR.Models.SignalRResourceSku Sku { get { throw null; } set { } } @@ -149,11 +214,13 @@ public static partial class SignalRExtensions { public static Azure.Response CheckSignalRNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.SignalR.Models.SignalRNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> CheckSignalRNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.SignalR.Models.SignalRNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.SignalR.ReplicaResource GetReplicaResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetSignalR(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetSignalRAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.SignalR.SignalRCustomCertificateResource GetSignalRCustomCertificateResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.SignalR.SignalRCustomDomainResource GetSignalRCustomDomainResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.SignalR.SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.SignalR.SignalRReplicaSharedPrivateLinkResource GetSignalRReplicaSharedPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.SignalR.SignalRResource GetSignalRResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.SignalR.SignalRCollection GetSignalRs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetSignalRs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -211,6 +278,40 @@ protected SignalRPrivateEndpointConnectionResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.SignalRPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.SignalRPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class SignalRReplicaSharedPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected SignalRReplicaSharedPrivateLinkResource() { } + public virtual Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class SignalRReplicaSharedPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected SignalRReplicaSharedPrivateLinkResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sharedPrivateLinkResourceName, Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string sharedPrivateLinkResourceName, 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 sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string sharedPrivateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string sharedPrivateLinkResourceName, 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 SignalRResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -226,6 +327,9 @@ protected SignalRResource() { } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetReplica(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetReplicaAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.SignalR.ReplicaCollection GetReplicas() { throw null; } public virtual Azure.Response GetSignalRCustomCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSignalRCustomCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRCustomCertificateCollection GetSignalRCustomCertificates() { throw null; } @@ -314,9 +418,11 @@ namespace Azure.ResourceManager.SignalR.Mocking public partial class MockableSignalRArmClient : Azure.ResourceManager.ArmResource { protected MockableSignalRArmClient() { } + public virtual Azure.ResourceManager.SignalR.ReplicaResource GetReplicaResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRCustomCertificateResource GetSignalRCustomCertificateResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRCustomDomainResource GetSignalRCustomDomainResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.SignalR.SignalRReplicaSharedPrivateLinkResource GetSignalRReplicaSharedPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRResource GetSignalRResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.SignalR.SignalRSharedPrivateLinkResource GetSignalRSharedPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -342,9 +448,12 @@ namespace Azure.ResourceManager.SignalR.Models { public static partial class ArmSignalRModelFactory { + public static Azure.ResourceManager.SignalR.ReplicaData ReplicaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SignalR.Models.SignalRResourceSku sku = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), string regionEndpointEnabled = null, string resourceStopped = null) { throw null; } public static Azure.ResourceManager.SignalR.SignalRCustomCertificateData SignalRCustomCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), System.Uri keyVaultBaseUri = null, string keyVaultSecretName = null, string keyVaultSecretVersion = null) { throw null; } public static Azure.ResourceManager.SignalR.SignalRCustomDomainData SignalRCustomDomainData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), string domainName = null, Azure.Core.ResourceIdentifier customCertificateId = null) { throw null; } - public static Azure.ResourceManager.SignalR.SignalRData SignalRData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SignalR.Models.SignalRResourceSku sku = null, Azure.ResourceManager.SignalR.Models.SignalRServiceKind? kind = default(Azure.ResourceManager.SignalR.Models.SignalRServiceKind?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), string externalIP = null, string hostName = null, int? publicPort = default(int?), int? serverPort = default(int?), string version = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, bool? isClientCertEnabled = default(bool?), string hostNamePrefix = null, System.Collections.Generic.IEnumerable features = null, Azure.ResourceManager.SignalR.Models.SignalRLiveTraceConfiguration liveTraceConfiguration = null, System.Collections.Generic.IEnumerable resourceLogCategories = null, System.Collections.Generic.IEnumerable corsAllowedOrigins = null, System.Collections.Generic.IEnumerable upstreamTemplates = null, Azure.ResourceManager.SignalR.Models.SignalRNetworkAcls networkACLs = null, string publicNetworkAccess = null, bool? disableLocalAuth = default(bool?), bool? disableAadAuth = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.SignalR.SignalRData SignalRData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.SignalR.Models.SignalRResourceSku sku, Azure.ResourceManager.SignalR.Models.SignalRServiceKind? kind, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState, string externalIP, string hostName, int? publicPort, int? serverPort, string version, System.Collections.Generic.IEnumerable privateEndpointConnections, System.Collections.Generic.IEnumerable sharedPrivateLinkResources, bool? isClientCertEnabled, string hostNamePrefix, System.Collections.Generic.IEnumerable features, Azure.ResourceManager.SignalR.Models.SignalRLiveTraceConfiguration liveTraceConfiguration, System.Collections.Generic.IEnumerable resourceLogCategories, System.Collections.Generic.IEnumerable corsAllowedOrigins, System.Collections.Generic.IEnumerable upstreamTemplates, Azure.ResourceManager.SignalR.Models.SignalRNetworkAcls networkACLs, string publicNetworkAccess, bool? disableLocalAuth, bool? disableAadAuth) { throw null; } + public static Azure.ResourceManager.SignalR.SignalRData SignalRData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.SignalR.Models.SignalRResourceSku sku = null, Azure.ResourceManager.SignalR.Models.SignalRServiceKind? kind = default(Azure.ResourceManager.SignalR.Models.SignalRServiceKind?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), string externalIP = null, string hostName = null, int? publicPort = default(int?), int? serverPort = default(int?), string version = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, bool? isClientCertEnabled = default(bool?), string hostNamePrefix = null, System.Collections.Generic.IEnumerable features = null, Azure.ResourceManager.SignalR.Models.SignalRLiveTraceConfiguration liveTraceConfiguration = null, System.Collections.Generic.IEnumerable resourceLogCategories = null, System.Collections.Generic.IEnumerable corsAllowedOrigins = null, int? serverlessConnectionTimeoutInSeconds = default(int?), System.Collections.Generic.IEnumerable upstreamTemplates = null, Azure.ResourceManager.SignalR.Models.SignalRNetworkAcls networkACLs = null, string publicNetworkAccess = null, bool? disableLocalAuth = default(bool?), bool? disableAadAuth = default(bool?), string regionEndpointEnabled = null, string resourceStopped = null) { throw null; } public static Azure.ResourceManager.SignalR.Models.SignalRKeys SignalRKeys(string primaryKey = null, string secondaryKey = null, string primaryConnectionString = null, string secondaryConnectionString = null) { throw null; } public static Azure.ResourceManager.SignalR.Models.SignalRNameAvailabilityResult SignalRNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } public static Azure.ResourceManager.SignalR.SignalRPrivateEndpointConnectionData SignalRPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SignalR.Models.SignalRProvisioningState? provisioningState = default(Azure.ResourceManager.SignalR.Models.SignalRProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.ResourceManager.SignalR.Models.SignalRPrivateLinkServiceConnectionState connectionState = null) { throw null; } @@ -356,6 +465,17 @@ public static partial class ArmSignalRModelFactory public static Azure.ResourceManager.SignalR.Models.SignalRUsage SignalRUsage(Azure.Core.ResourceIdentifier id = null, long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.SignalR.Models.SignalRUsageName name = null, string unit = null) { throw null; } public static Azure.ResourceManager.SignalR.Models.SignalRUsageName SignalRUsageName(string value = null, string localizedValue = null) { throw null; } } + public partial class IPRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IPRule() { } + public Azure.ResourceManager.SignalR.Models.SignalRNetworkAclAction? Action { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + Azure.ResourceManager.SignalR.Models.IPRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.SignalR.Models.IPRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PrivateLinkServiceConnectionStatus : System.IEquatable { @@ -541,6 +661,7 @@ public partial class SignalRNetworkAcls : System.ClientModel.Primitives.IJsonMod { public SignalRNetworkAcls() { } public Azure.ResourceManager.SignalR.Models.SignalRNetworkAclAction? DefaultAction { get { throw null; } set { } } + public System.Collections.Generic.IList IPRules { get { throw null; } } public System.Collections.Generic.IList PrivateEndpoints { get { throw null; } } public Azure.ResourceManager.SignalR.Models.SignalRNetworkAcl PublicNetwork { get { throw null; } set { } } Azure.ResourceManager.SignalR.Models.SignalRNetworkAcls System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs index fc8affdda6eb0..3a9a277a5d245 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -61,7 +62,7 @@ public static SignalRUsageName SignalRUsageName(string value = null, string loca /// The tags. /// The location. /// The billing information of the resource. - /// The kind of the service, it can be SignalR or RawWebSockets. + /// The kind of the service. /// A class represent managed identities used for request and response. Current supported identity types: None, SystemAssigned, UserAssigned. /// Provisioning state of the resource. /// The publicly accessible IP of the resource. @@ -84,6 +85,7 @@ public static SignalRUsageName SignalRUsageName(string value = null, string loca /// Live trace configuration of a Microsoft.SignalRService resource. /// Resource log configuration of a Microsoft.SignalRService resource. /// Cross-Origin Resource Sharing (CORS) settings. + /// Serverless settings. /// The settings for the Upstream when the service is in server-less mode. /// Network ACLs for the resource. /// @@ -101,8 +103,18 @@ public static SignalRUsageName SignalRUsageName(string value = null, string loca /// Enable or disable aad auth /// When set as true, connection with AuthType=aad won't work. /// + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// This property is replica specific. Disable the regional endpoint without replica is not allowed. + /// + /// + /// Stop or start the resource. Default to "False". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// /// A new instance for mocking. - public static SignalRData SignalRData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SignalRResourceSku sku = null, SignalRServiceKind? kind = null, ManagedServiceIdentity identity = null, SignalRProvisioningState? provisioningState = null, string externalIP = null, string hostName = null, int? publicPort = null, int? serverPort = null, string version = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, bool? isClientCertEnabled = null, string hostNamePrefix = null, IEnumerable features = null, SignalRLiveTraceConfiguration liveTraceConfiguration = null, IEnumerable resourceLogCategories = null, IEnumerable corsAllowedOrigins = null, IEnumerable upstreamTemplates = null, SignalRNetworkAcls networkACLs = null, string publicNetworkAccess = null, bool? disableLocalAuth = null, bool? disableAadAuth = null) + public static SignalRData SignalRData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SignalRResourceSku sku = null, SignalRServiceKind? kind = null, ManagedServiceIdentity identity = null, SignalRProvisioningState? provisioningState = null, string externalIP = null, string hostName = null, int? publicPort = null, int? serverPort = null, string version = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, bool? isClientCertEnabled = null, string hostNamePrefix = null, IEnumerable features = null, SignalRLiveTraceConfiguration liveTraceConfiguration = null, IEnumerable resourceLogCategories = null, IEnumerable corsAllowedOrigins = null, int? serverlessConnectionTimeoutInSeconds = null, IEnumerable upstreamTemplates = null, SignalRNetworkAcls networkACLs = null, string publicNetworkAccess = null, bool? disableLocalAuth = null, bool? disableAadAuth = null, string regionEndpointEnabled = null, string resourceStopped = null) { tags ??= new Dictionary(); privateEndpointConnections ??= new List(); @@ -136,11 +148,14 @@ public static SignalRData SignalRData(ResourceIdentifier id = null, string name liveTraceConfiguration, resourceLogCategories != null ? new SignalRResourceLogCategoryListResult(resourceLogCategories?.ToList(), serializedAdditionalRawData: null) : null, corsAllowedOrigins != null ? new SignalRCorsSettings(corsAllowedOrigins?.ToList(), serializedAdditionalRawData: null) : null, + serverlessConnectionTimeoutInSeconds != null ? new ServerlessSettings(serverlessConnectionTimeoutInSeconds, serializedAdditionalRawData: null) : null, upstreamTemplates != null ? new ServerlessUpstreamSettings(upstreamTemplates?.ToList(), serializedAdditionalRawData: null) : null, networkACLs, publicNetworkAccess, disableLocalAuth, disableAadAuth, + regionEndpointEnabled, + resourceStopped, serializedAdditionalRawData: null); } @@ -148,7 +163,7 @@ public static SignalRData SignalRData(ResourceIdentifier id = null, string name /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1, Premium_P2 /// /// /// Optional tier of this particular SKU. 'Standard' or 'Free'. @@ -158,11 +173,14 @@ public static SignalRData SignalRData(ResourceIdentifier id = null, string name /// Not used. Retained for future use. /// Not used. Retained for future use. /// - /// Optional, integer. The unit count of the resource. 1 by default. + /// Optional, integer. The unit count of the resource. + /// 1 for Free_F1/Standard_S1/Premium_P1, 100 for Premium_P2 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free_F1: 1; + /// Standard_S1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P2: 100,200,300,400,500,600,700,800,900,1000; /// /// A new instance for mocking. public static SignalRResourceSku SignalRResourceSku(string name = null, SignalRSkuTier? tier = null, string size = null, string family = null, int? capacity = null) @@ -313,6 +331,43 @@ public static SignalRPrivateLinkResource SignalRPrivateLinkResource(ResourceIden serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The billing information of the resource. + /// Provisioning state of the resource. + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// + /// + /// Stop or start the resource. Default to "false". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// + /// A new instance for mocking. + public static ReplicaData ReplicaData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SignalRResourceSku sku = null, SignalRProvisioningState? provisioningState = null, string regionEndpointEnabled = null, string resourceStopped = null) + { + tags ??= new Dictionary(); + + return new ReplicaData( + id, + name, + resourceType, + systemData, + tags, + location, + sku, + provisioningState, + regionEndpointEnabled, + resourceStopped, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The resource type that this object applies to. /// The billing information of the resource. @@ -342,5 +397,59 @@ public static SignalRSkuCapacity SignalRSkuCapacity(int? minimum = null, int? ma scaleType, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The billing information of the resource. + /// The kind of the service, it can be SignalR or RawWebSockets. + /// A class represent managed identities used for request and response. Current supported identity types: None, SystemAssigned, UserAssigned. + /// Provisioning state of the resource. + /// The publicly accessible IP of the resource. + /// FQDN of the service instance. + /// The publicly accessible port of the resource which is designed for browser/client side usage. + /// The publicly accessible port of the resource which is designed for customer server side usage. + /// Version of the resource. Probably you need the same or higher version of client SDKs. + /// Private endpoint connections to the resource. + /// The list of shared private link resources. + /// TLS settings for the resource. + /// Deprecated. + /// + /// List of the featureFlags. + /// FeatureFlags that are not included in the parameters for the update operation will not be modified. + /// And the response will only include featureFlags that are explicitly set. + /// When a featureFlag is not explicitly set, its globally default value will be used + /// But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. + /// + /// Live trace configuration of a Microsoft.SignalRService resource. + /// Resource log configuration of a Microsoft.SignalRService resource. + /// Cross-Origin Resource Sharing (CORS) settings. + /// The settings for the Upstream when the service is in server-less mode. + /// Network ACLs for the resource. + /// + /// Enable or disable public network access. Default to "Enabled". + /// When it's Enabled, network ACLs still apply. + /// When it's Disabled, public network access is always disabled no matter what you set in network ACLs. + /// + /// + /// DisableLocalAuth + /// Enable or disable local auth with AccessKey + /// When set as true, connection with AccessKey=xxx won't work. + /// + /// + /// DisableLocalAuth + /// Enable or disable aad auth + /// When set as true, connection with AuthType=aad won't work. + /// + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SignalRData SignalRData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SignalRResourceSku sku, SignalRServiceKind? kind, ManagedServiceIdentity identity, SignalRProvisioningState? provisioningState, string externalIP, string hostName, int? publicPort, int? serverPort, string version, IEnumerable privateEndpointConnections, IEnumerable sharedPrivateLinkResources, bool? isClientCertEnabled, string hostNamePrefix, IEnumerable features, SignalRLiveTraceConfiguration liveTraceConfiguration, IEnumerable resourceLogCategories, IEnumerable corsAllowedOrigins, IEnumerable upstreamTemplates, SignalRNetworkAcls networkACLs, string publicNetworkAccess, bool? disableLocalAuth, bool? disableAadAuth) + { + return SignalRData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, kind: kind, identity: identity, provisioningState: provisioningState, externalIP: externalIP, hostName: hostName, publicPort: publicPort, serverPort: serverPort, version: version, privateEndpointConnections: privateEndpointConnections, sharedPrivateLinkResources: sharedPrivateLinkResources, isClientCertEnabled: isClientCertEnabled, hostNamePrefix: hostNamePrefix, features: features, liveTraceConfiguration: liveTraceConfiguration, resourceLogCategories: resourceLogCategories, corsAllowedOrigins: corsAllowedOrigins, serverlessConnectionTimeoutInSeconds: default, upstreamTemplates: upstreamTemplates, networkACLs: networkACLs, publicNetworkAccess: publicNetworkAccess, disableLocalAuth: disableLocalAuth, disableAadAuth: disableAadAuth, regionEndpointEnabled: default, resourceStopped: default); + } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRArmClient.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRArmClient.cs index 030e7543194ba..22d41ef593ac0 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRArmClient.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRArmClient.cs @@ -82,6 +82,30 @@ public virtual SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpoin return new SignalRPrivateEndpointConnectionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ReplicaResource GetReplicaResource(ResourceIdentifier id) + { + ReplicaResource.ValidateResourceId(id); + return new ReplicaResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SignalRReplicaSharedPrivateLinkResource GetSignalRReplicaSharedPrivateLinkResource(ResourceIdentifier id) + { + SignalRReplicaSharedPrivateLinkResource.ValidateResourceId(id); + return new SignalRReplicaSharedPrivateLinkResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRResourceGroupResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRResourceGroupResource.cs index 60fceb1799189..6e21672ee47f5 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRResourceGroupResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual SignalRCollection GetSignalRs() /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetSignalRAsync(string reso /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRSubscriptionResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRSubscriptionResource.cs index f2d0e09408927..8eb32c49dd41b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRSubscriptionResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/MockableSignalRSubscriptionResource.cs @@ -59,7 +59,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -102,7 +102,7 @@ public virtual async Task> CheckSignalRN /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual Response CheckSignalRNameAvailabil /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetSignalRsAsync(CancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetSignalRs(CancellationToken cancellat /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// @@ -232,7 +232,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs index 3726c6cae98bd..82f80663c0e21 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs @@ -109,6 +109,44 @@ public static SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpoint return GetMockableSignalRArmClient(client).GetSignalRPrivateEndpointConnectionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ReplicaResource GetReplicaResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSignalRArmClient(client).GetReplicaResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static SignalRReplicaSharedPrivateLinkResource GetSignalRReplicaSharedPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSignalRArmClient(client).GetSignalRReplicaSharedPrivateLinkResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -158,7 +196,7 @@ public static SignalRCollection GetSignalRs(this ResourceGroupResource resourceG /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -196,7 +234,7 @@ public static async Task> GetSignalRAsync(this Resourc /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -234,7 +272,7 @@ public static Response GetSignalR(this ResourceGroupResource re /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -271,7 +309,7 @@ public static async Task> CheckSignalRNa /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -308,7 +346,7 @@ public static Response CheckSignalRNameAvailabili /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -344,7 +382,7 @@ public static AsyncPageable GetSignalRsAsync(this SubscriptionR /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -380,7 +418,7 @@ public static Pageable GetSignalRs(this SubscriptionResource su /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// @@ -413,7 +451,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/ReplicaOperationSource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/ReplicaOperationSource.cs new file mode 100644 index 0000000000000..251fef5e833c2 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/ReplicaOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR +{ + internal class ReplicaOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ReplicaOperationSource(ArmClient client) + { + _client = client; + } + + ReplicaResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ReplicaData.DeserializeReplicaData(document.RootElement); + return new ReplicaResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ReplicaData.DeserializeReplicaData(document.RootElement); + return new ReplicaResource(_client, data); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/SignalRReplicaSharedPrivateLinkResourceOperationSource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/SignalRReplicaSharedPrivateLinkResourceOperationSource.cs new file mode 100644 index 0000000000000..95bad320bb51e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/SignalRReplicaSharedPrivateLinkResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR +{ + internal class SignalRReplicaSharedPrivateLinkResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SignalRReplicaSharedPrivateLinkResourceOperationSource(ArmClient client) + { + _client = client; + } + + SignalRReplicaSharedPrivateLinkResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(document.RootElement); + return new SignalRReplicaSharedPrivateLinkResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(document.RootElement); + return new SignalRReplicaSharedPrivateLinkResource(_client, data); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.Serialization.cs new file mode 100644 index 0000000000000..136e67d1a796c --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR.Models +{ + public partial class IPRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPRule)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + IPRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IPRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIPRule(document.RootElement, options); + } + + internal static IPRule DeserializeIPRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string value = default; + SignalRNetworkAclAction? action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = new SignalRNetworkAclAction(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IPRule(value, action, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Action), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" action: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Action)) + { + builder.Append(" action: "); + builder.AppendLine($"'{Action.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(IPRule)} does not support writing '{options.Format}' format."); + } + } + + IPRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeIPRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IPRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.cs new file mode 100644 index 0000000000000..7885977325c44 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SignalR.Models +{ + /// An IP rule. + public partial class IPRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IPRule() + { + } + + /// Initializes a new instance of . + /// An IP or CIDR or ServiceTag. + /// Azure Networking ACL Action. + /// Keeps track of any properties unknown to the library. + internal IPRule(string value, SignalRNetworkAclAction? action, IDictionary serializedAdditionalRawData) + { + Value = value; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// An IP or CIDR or ServiceTag. + [WirePath("value")] + public string Value { get; set; } + /// Azure Networking ACL Action. + [WirePath("action")] + public SignalRNetworkAclAction? Action { get; set; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.Serialization.cs new file mode 100644 index 0000000000000..87da0d45ba16d --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR.Models +{ + internal partial class ReplicaList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaList)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReplicaList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicaList(document.RootElement, options); + } + + internal static ReplicaList DeserializeReplicaList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReplicaData.DeserializeReplicaData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicaList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ReplicaList)} does not support writing '{options.Format}' format."); + } + } + + ReplicaList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicaList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicaList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.cs new file mode 100644 index 0000000000000..7e47fb37c70b8 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SignalR.Models +{ + /// The ReplicaList. + internal partial class ReplicaList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ReplicaList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of the replica. + /// + /// The URL the client should use to fetch the next page (per server side paging). + /// It's null for now, added for future use. + /// + /// Keeps track of any properties unknown to the library. + internal ReplicaList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of the replica. + public IReadOnlyList Value { get; } + /// + /// The URL the client should use to fetch the next page (per server side paging). + /// It's null for now, added for future use. + /// + public string NextLink { get; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.Serialization.cs new file mode 100644 index 0000000000000..e98e5f97c0857 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR.Models +{ + internal partial class ServerlessSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ConnectionTimeoutInSeconds)) + { + writer.WritePropertyName("connectionTimeoutInSeconds"u8); + writer.WriteNumberValue(ConnectionTimeoutInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessSettings(document.RootElement, options); + } + + internal static ServerlessSettings DeserializeServerlessSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? connectionTimeoutInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionTimeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionTimeoutInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessSettings(connectionTimeoutInSeconds, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionTimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionTimeoutInSeconds)) + { + builder.Append(" connectionTimeoutInSeconds: "); + builder.AppendLine($"{ConnectionTimeoutInSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ServerlessSettings)} does not support writing '{options.Format}' format."); + } + } + + ServerlessSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.cs new file mode 100644 index 0000000000000..7dad67f37d928 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SignalR.Models +{ + /// Serverless settings. + internal partial class ServerlessSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ServerlessSettings() + { + } + + /// Initializes a new instance of . + /// + /// Gets or sets Client Connection Timeout. Optional to be set. + /// Value in seconds. + /// Default value is 30 seconds. + /// Customer should set the timeout to a shorter period if messages are expected to be sent in shorter intervals, + /// and want the client to disconnect more quickly after the last message is sent. + /// You can set the timeout to a longer period if messages are expected to be sent in longer intervals, + /// and they want to keep the same client connection alive during this session. + /// The service considers the client disconnected if it hasn't received a message (including keep-alive) in this interval. + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessSettings(int? connectionTimeoutInSeconds, IDictionary serializedAdditionalRawData) + { + ConnectionTimeoutInSeconds = connectionTimeoutInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Gets or sets Client Connection Timeout. Optional to be set. + /// Value in seconds. + /// Default value is 30 seconds. + /// Customer should set the timeout to a shorter period if messages are expected to be sent in shorter intervals, + /// and want the client to disconnect more quickly after the last message is sent. + /// You can set the timeout to a longer period if messages are expected to be sent in longer intervals, + /// and they want to keep the same client connection alive during this session. + /// The service considers the client disconnected if it hasn't received a message (including keep-alive) in this interval. + /// + [WirePath("connectionTimeoutInSeconds")] + public int? ConnectionTimeoutInSeconds { get; set; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs index 5e57e0759bde3..35e4467e9db4b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs @@ -47,7 +47,7 @@ public partial class SignalRNameAvailabilityContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub". + /// The resource type. Can be "Microsoft.SignalRService/SignalR", "Microsoft.SignalRService/WebPubSub", "Microsoft.SignalRService/SignalR/replicas" or "Microsoft.SignalRService/WebPubSub/replicas". /// The resource name to validate. e.g."my-resource-name". /// is null. public SignalRNameAvailabilityContent(ResourceType resourceType, string name) @@ -59,7 +59,7 @@ public SignalRNameAvailabilityContent(ResourceType resourceType, string name) } /// Initializes a new instance of . - /// The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub". + /// The resource type. Can be "Microsoft.SignalRService/SignalR", "Microsoft.SignalRService/WebPubSub", "Microsoft.SignalRService/SignalR/replicas" or "Microsoft.SignalRService/WebPubSub/replicas". /// The resource name to validate. e.g."my-resource-name". /// Keeps track of any properties unknown to the library. internal SignalRNameAvailabilityContent(ResourceType resourceType, string name, IDictionary serializedAdditionalRawData) @@ -74,7 +74,7 @@ internal SignalRNameAvailabilityContent() { } - /// The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub". + /// The resource type. Can be "Microsoft.SignalRService/SignalR", "Microsoft.SignalRService/WebPubSub", "Microsoft.SignalRService/SignalR/replicas" or "Microsoft.SignalRService/WebPubSub/replicas". [WirePath("type")] public ResourceType ResourceType { get; } /// The resource name to validate. e.g."my-resource-name". diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.Serialization.cs index d3a9cd7abb186..29b47df0173de 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.Serialization.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.Serialization.cs @@ -48,6 +48,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(IPRules)) + { + writer.WritePropertyName("ipRules"u8); + writer.WriteStartArray(); + foreach (var item in IPRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -89,6 +99,7 @@ internal static SignalRNetworkAcls DeserializeSignalRNetworkAcls(JsonElement ele SignalRNetworkAclAction? defaultAction = default; SignalRNetworkAcl publicNetwork = default; IList privateEndpoints = default; + IList ipRules = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -125,13 +136,27 @@ internal static SignalRNetworkAcls DeserializeSignalRNetworkAcls(JsonElement ele privateEndpoints = array; continue; } + if (property.NameEquals("ipRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPRule.DeserializeIPRule(item, options)); + } + ipRules = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new SignalRNetworkAcls(defaultAction, publicNetwork, privateEndpoints ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new SignalRNetworkAcls(defaultAction, publicNetwork, privateEndpoints ?? new ChangeTrackingList(), ipRules ?? new ChangeTrackingList(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -198,6 +223,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IPRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ipRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(IPRules)) + { + if (IPRules.Any()) + { + builder.Append(" ipRules: "); + builder.AppendLine("["); + foreach (var item in IPRules) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " ipRules: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs index 95dc9617655cc..88e2a22f7267f 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs @@ -49,18 +49,21 @@ public partial class SignalRNetworkAcls public SignalRNetworkAcls() { PrivateEndpoints = new ChangeTrackingList(); + IPRules = new ChangeTrackingList(); } /// Initializes a new instance of . /// Azure Networking ACL Action. /// Network ACL. /// ACLs for requests from private endpoints. + /// IP rules for filtering public traffic. /// Keeps track of any properties unknown to the library. - internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetworkAcl publicNetwork, IList privateEndpoints, IDictionary serializedAdditionalRawData) + internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetworkAcl publicNetwork, IList privateEndpoints, IList ipRules, IDictionary serializedAdditionalRawData) { DefaultAction = defaultAction; PublicNetwork = publicNetwork; PrivateEndpoints = privateEndpoints; + IPRules = ipRules; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -73,5 +76,8 @@ internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetwo /// ACLs for requests from private endpoints. [WirePath("privateEndpoints")] public IList PrivateEndpoints { get; } + /// IP rules for filtering public traffic. + [WirePath("ipRules")] + public IList IPRules { get; } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs index 2e39b8081f129..5dde4c41e7074 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs @@ -49,7 +49,7 @@ public partial class SignalRResourceSku /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1, Premium_P2 /// /// is null. public SignalRResourceSku(string name) @@ -63,7 +63,7 @@ public SignalRResourceSku(string name) /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1, Premium_P2 /// /// /// Optional tier of this particular SKU. 'Standard' or 'Free'. @@ -73,11 +73,14 @@ public SignalRResourceSku(string name) /// Not used. Retained for future use. /// Not used. Retained for future use. /// - /// Optional, integer. The unit count of the resource. 1 by default. + /// Optional, integer. The unit count of the resource. + /// 1 for Free_F1/Standard_S1/Premium_P1, 100 for Premium_P2 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free_F1: 1; + /// Standard_S1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P2: 100,200,300,400,500,600,700,800,900,1000; /// /// Keeps track of any properties unknown to the library. internal SignalRResourceSku(string name, SignalRSkuTier? tier, string size, string family, int? capacity, IDictionary serializedAdditionalRawData) @@ -98,7 +101,7 @@ internal SignalRResourceSku() /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1, Premium_P2 /// [WirePath("name")] public string Name { get; set; } @@ -116,11 +119,14 @@ internal SignalRResourceSku() [WirePath("family")] public string Family { get; } /// - /// Optional, integer. The unit count of the resource. 1 by default. + /// Optional, integer. The unit count of the resource. + /// 1 for Free_F1/Standard_S1/Premium_P1, 100 for Premium_P2 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free_F1: 1; + /// Standard_S1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P1: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium_P2: 100,200,300,400,500,600,700,800,900,1000; /// [WirePath("capacity")] public int? Capacity { get; set; } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRServiceKind.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRServiceKind.cs index 31fca711ba20d..d029d8a96c97a 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRServiceKind.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRServiceKind.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.SignalR.Models { - /// The kind of the service, it can be SignalR or RawWebSockets. + /// The kind of the service. public readonly partial struct SignalRServiceKind : IEquatable { private readonly string _value; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs index 317989d25c389..55f444a219de3 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs @@ -51,7 +51,7 @@ public SignalRTlsSettings() } /// Initializes a new instance of . - /// Request client certificate during TLS handshake if enabled. + /// Request client certificate during TLS handshake if enabled. Not supported for free tier. Any input will be ignored for free tier. /// Keeps track of any properties unknown to the library. internal SignalRTlsSettings(bool? isClientCertEnabled, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal SignalRTlsSettings(bool? isClientCertEnabled, IDictionary Request client certificate during TLS handshake if enabled. + /// Request client certificate during TLS handshake if enabled. Not supported for free tier. Any input will be ignored for free tier. [WirePath("clientCertEnabled")] public bool? IsClientCertEnabled { get; set; } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaCollection.cs new file mode 100644 index 0000000000000..52f92c137d7a3 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SignalR +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetReplicas method from an instance of . + /// + public partial class ReplicaCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _replicaSignalRReplicasClientDiagnostics; + private readonly SignalRReplicasRestOperations _replicaSignalRReplicasRestClient; + + /// Initializes a new instance of the class for mocking. + protected ReplicaCollection() + { + } + + /// 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 ReplicaCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicaSignalRReplicasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SignalR", ReplicaResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ReplicaResource.ResourceType, out string replicaSignalRReplicasApiVersion); + _replicaSignalRReplicasRestClient = new SignalRReplicasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicaSignalRReplicasApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SignalRResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SignalRResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the replica. + /// Parameters for the create or update operation. + /// 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 replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, data, cancellationToken).ConfigureAwait(false); + var operation = new SignalRArmOperation(new ReplicaOperationSource(Client), _replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the replica. + /// Parameters for the create or update operation. + /// 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 replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, data, cancellationToken); + var operation = new SignalRArmOperation(new ReplicaOperationSource(Client), _replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.Get"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.Get"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all replicas belong to this resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas + /// + /// + /// Operation Id + /// SignalRReplicas_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _replicaSignalRReplicasRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicaSignalRReplicasRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ReplicaResource(Client, ReplicaData.DeserializeReplicaData(e)), _replicaSignalRReplicasClientDiagnostics, Pipeline, "ReplicaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List all replicas belong to this resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas + /// + /// + /// Operation Id + /// SignalRReplicas_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _replicaSignalRReplicasRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _replicaSignalRReplicasRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ReplicaResource(Client, ReplicaData.DeserializeReplicaData(e)), _replicaSignalRReplicasClientDiagnostics, Pipeline, "ReplicaCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.Exists"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, 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.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.Exists"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaCollection.GetIfExists"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicaName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.Serialization.cs new file mode 100644 index 0000000000000..add1c102ca5c9 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.Serialization.cs @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + public partial class ReplicaData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(RegionEndpointEnabled)) + { + writer.WritePropertyName("regionEndpointEnabled"u8); + writer.WriteStringValue(RegionEndpointEnabled); + } + if (Optional.IsDefined(ResourceStopped)) + { + writer.WritePropertyName("resourceStopped"u8); + writer.WriteStringValue(ResourceStopped); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ReplicaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicaData(document.RootElement, options); + } + + internal static ReplicaData DeserializeReplicaData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SignalRResourceSku sku = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + SignalRProvisioningState? provisioningState = default; + string regionEndpointEnabled = default; + string resourceStopped = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = SignalRResourceSku.DeserializeSignalRResourceSku(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SignalRProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("regionEndpointEnabled"u8)) + { + regionEndpointEnabled = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceStopped"u8)) + { + resourceStopped = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicaData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + sku, + provisioningState, + regionEndpointEnabled, + resourceStopped, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sku: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Sku)) + { + builder.Append(" sku: "); + BicepSerializationHelpers.AppendChildObject(builder, Sku, options, 2, false, " sku: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RegionEndpointEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" regionEndpointEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RegionEndpointEnabled)) + { + builder.Append(" regionEndpointEnabled: "); + if (RegionEndpointEnabled.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RegionEndpointEnabled}'''"); + } + else + { + builder.AppendLine($"'{RegionEndpointEnabled}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceStopped), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceStopped: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceStopped)) + { + builder.Append(" resourceStopped: "); + if (ResourceStopped.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ResourceStopped}'''"); + } + else + { + builder.AppendLine($"'{ResourceStopped}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ReplicaData)} does not support writing '{options.Format}' format."); + } + } + + ReplicaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeReplicaData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicaData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.cs new file mode 100644 index 0000000000000..486fd413fa020 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + /// + /// A class representing the Replica data model. + /// A class represent a replica resource. + /// + public partial class ReplicaData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public ReplicaData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The billing information of the resource. + /// Provisioning state of the resource. + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// + /// + /// Stop or start the resource. Default to "false". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// + /// Keeps track of any properties unknown to the library. + internal ReplicaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SignalRResourceSku sku, SignalRProvisioningState? provisioningState, string regionEndpointEnabled, string resourceStopped, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Sku = sku; + ProvisioningState = provisioningState; + RegionEndpointEnabled = regionEndpointEnabled; + ResourceStopped = resourceStopped; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReplicaData() + { + } + + /// The billing information of the resource. + [WirePath("sku")] + public SignalRResourceSku Sku { get; set; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public SignalRProvisioningState? ProvisioningState { get; } + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// + [WirePath("properties.regionEndpointEnabled")] + public string RegionEndpointEnabled { get; set; } + /// + /// Stop or start the resource. Default to "false". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// + [WirePath("properties.resourceStopped")] + public string ResourceStopped { get; set; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.Serialization.cs new file mode 100644 index 0000000000000..74194897d245a --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.SignalR +{ + public partial class ReplicaResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ReplicaData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ReplicaData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.cs new file mode 100644 index 0000000000000..9d96eb3545954 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.cs @@ -0,0 +1,928 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + /// + /// A Class representing a Replica along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetReplicaResource method. + /// Otherwise you can get one from its parent resource using the GetReplica method. + /// + public partial class ReplicaResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The replicaName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _replicaSignalRReplicasClientDiagnostics; + private readonly SignalRReplicasRestOperations _replicaSignalRReplicasRestClient; + private readonly ClientDiagnostics _signalRClientDiagnostics; + private readonly SignalRRestOperations _signalRRestClient; + private readonly ReplicaData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.SignalRService/signalR/replicas"; + + /// Initializes a new instance of the class for mocking. + protected ReplicaResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ReplicaResource(ArmClient client, ReplicaData 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 ReplicaResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _replicaSignalRReplicasClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SignalR", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string replicaSignalRReplicasApiVersion); + _replicaSignalRReplicasRestClient = new SignalRReplicasRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, replicaSignalRReplicasApiVersion); + _signalRClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SignalR", SignalRResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SignalRResource.ResourceType, out string signalRApiVersion); + _signalRRestClient = new SignalRRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, signalRApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ReplicaData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of SignalRReplicaSharedPrivateLinkResources in the Replica. + /// An object representing collection of SignalRReplicaSharedPrivateLinkResources and their operations over a SignalRReplicaSharedPrivateLinkResource. + public virtual SignalRReplicaSharedPrivateLinkResourceCollection GetSignalRReplicaSharedPrivateLinkResources() + { + return GetCachedClient(client => new SignalRReplicaSharedPrivateLinkResourceCollection(client, Id)); + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSignalRReplicaSharedPrivateLinkResourceAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetSignalRReplicaSharedPrivateLinkResources().GetAsync(sharedPrivateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSignalRReplicaSharedPrivateLinkResource(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetSignalRReplicaSharedPrivateLinkResources().Get(sharedPrivateLinkResourceName, cancellationToken); + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Get"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.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 ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Get"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ReplicaResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to delete a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Delete"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _replicaSignalRReplicasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new SignalRArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to delete a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Delete + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Delete"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _replicaSignalRReplicasRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new SignalRArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to update an exiting replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Update + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters for the update operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Update"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new SignalRArmOperation(new ReplicaOperationSource(Client), _replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to update an exiting replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Update + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters for the update operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Update"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new SignalRArmOperation(new ReplicaOperationSource(Client), _replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all available skus of the replica resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/skus + /// + /// + /// Operation Id + /// SignalR_ListReplicaSkus + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetReplicaSkusSignalRsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _signalRRestClient.CreateListReplicaSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SignalRSku.DeserializeSignalRSku(e), _signalRClientDiagnostics, Pipeline, "ReplicaResource.GetReplicaSkusSignalRs", "value", null, cancellationToken); + } + + /// + /// List all available skus of the replica resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/skus + /// + /// + /// Operation Id + /// SignalR_ListReplicaSkus + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetReplicaSkusSignalRs(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _signalRRestClient.CreateListReplicaSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SignalRSku.DeserializeSignalRSku(e), _signalRClientDiagnostics, Pipeline, "ReplicaResource.GetReplicaSkusSignalRs", "value", null, cancellationToken); + } + + /// + /// Operation to restart a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/restart + /// + /// + /// Operation Id + /// SignalRReplicas_Restart + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task RestartAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Restart"); + scope.Start(); + try + { + var response = await _replicaSignalRReplicasRestClient.RestartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SignalRArmOperation(_replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Operation to restart a replica. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/restart + /// + /// + /// Operation Id + /// SignalRReplicas_Restart + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.Restart"); + scope.Start(); + try + { + var response = _replicaSignalRReplicasRestClient.Restart(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SignalRArmOperation(_replicaSignalRReplicasClientDiagnostics, Pipeline, _replicaSignalRReplicasRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReplicaData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReplicaData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReplicaData(current.Location); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReplicaData(current.Location); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _replicaSignalRReplicasRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ReplicaData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _replicaSignalRReplicasClientDiagnostics.CreateScope("ReplicaResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _replicaSignalRReplicasRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ReplicaResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ReplicaData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs index 8b27d8cabfd00..5bc060fdfccd1 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs @@ -32,7 +32,7 @@ public SignalRCustomCertificatesRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all custom certificates. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> ListAsync(string } /// List all custom certificates. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -169,8 +169,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The cancellation token to use. @@ -202,8 +202,8 @@ public async Task> GetAsync(string subscr } /// Get a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The cancellation token to use. @@ -277,8 +277,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The to use. @@ -306,8 +306,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The to use. @@ -373,8 +373,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The cancellation token to use. @@ -400,8 +400,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a custom certificate. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom certificate name. /// The cancellation token to use. @@ -450,8 +450,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List all custom certificates. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. @@ -481,8 +481,8 @@ public async Task> ListNextPageAsyn /// List all custom certificates. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs index 9190ddc7f6e61..94f7aabc4744a 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs @@ -32,7 +32,7 @@ public SignalRCustomDomainsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all custom domains. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> ListAsync(string subs } /// List all custom domains. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -169,8 +169,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The cancellation token to use. @@ -202,8 +202,8 @@ public async Task> GetAsync(string subscriptio } /// Get a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The cancellation token to use. @@ -277,8 +277,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The to use. @@ -305,8 +305,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The to use. @@ -371,8 +371,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The cancellation token to use. @@ -399,8 +399,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a custom domain. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Custom domain name. /// The cancellation token to use. @@ -450,8 +450,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List all custom domains. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. @@ -481,8 +481,8 @@ public async Task> ListNextPageAsync(str /// List all custom domains. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs index d7478059bb755..1565a1a1d29e6 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public SignalRPrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, st { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List private endpoint connections. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> ListAsyn } /// List private endpoint connections. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -169,10 +169,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -202,10 +202,10 @@ public async Task> GetAsync(strin } /// Get the specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -277,10 +277,10 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update the state of specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The resource of private endpoint and its properties. /// The cancellation token to use. /// , , , or is null. @@ -310,10 +310,10 @@ public async Task> UpdateAsync(st } /// Update the state of specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The resource of private endpoint and its properties. /// The cancellation token to use. /// , , , or is null. @@ -381,10 +381,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete the specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -409,10 +409,10 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete the specified private endpoint connection. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -460,8 +460,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List private endpoint connections. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. @@ -491,8 +491,8 @@ public async Task> ListNext /// List private endpoint connections. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs index ce7279a0df9ca..9eee2bb1d1459 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SignalRPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the private link resources that need to be created for a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> ListAsync(stri } /// Get the private link resources that need to be created for a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -154,8 +154,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the private link resources that need to be created for a resource. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. @@ -185,8 +185,8 @@ public async Task> ListNextPageAs /// Get the private link resources that need to be created for a resource. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicaSharedPrivateLinkResourcesRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicaSharedPrivateLinkResourcesRestOperations.cs new file mode 100644 index 0000000000000..ab85834b1a08e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicaSharedPrivateLinkResourcesRestOperations.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + internal partial class SignalRReplicaSharedPrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SignalRReplicaSharedPrivateLinkResourcesRestOperations. + /// 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 SignalRReplicaSharedPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List shared private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SignalRSharedPrivateLinkResourceListResult.DeserializeSignalRSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List shared private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SignalRSharedPrivateLinkResourceListResult.DeserializeSignalRSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the specified shared private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The name of the shared private link resource. + /// 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 resourceName, string replicaName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SignalRSharedPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the specified shared private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The name of the shared private link resource. + /// 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 resourceName, string replicaName, string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SignalRSharedPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/sharedPrivateLinkResources/", false); + uri.AppendPath(sharedPrivateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a shared private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The name of the shared private link resource. + /// The shared private link resource. + /// 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 resourceName, string replicaName, string sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a shared private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The name of the shared private link resource. + /// The shared private link resource. + /// 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 resourceName, string replicaName, string sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List shared private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SignalRSharedPrivateLinkResourceListResult.DeserializeSignalRSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List shared private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SignalRSharedPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SignalRSharedPrivateLinkResourceListResult.DeserializeSignalRSharedPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicasRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicasRestOperations.cs new file mode 100644 index 0000000000000..2fbe4aa58b716 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicasRestOperations.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + internal partial class SignalRReplicasRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SignalRReplicasRestOperations. + /// 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 SignalRReplicasRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all replicas belong to this resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicaList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicaList.DeserializeReplicaList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all replicas belong to this resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicaList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicaList.DeserializeReplicaList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the replica and its properties. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicaData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicaData.DeserializeReplicaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the replica and its properties. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicaData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicaData.DeserializeReplicaData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ReplicaData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// Parameters for the create or update operation. + /// 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 resourceName, string replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// Parameters for the create or update operation. + /// 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 resourceName, string replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Operation to delete a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to delete a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// 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 resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Operation to update an exiting replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// Parameters for the update operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to update an exiting replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// Parameters for the update operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, ReplicaData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, replicaName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRestartRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/restart", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRestartRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/restart", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Operation to restart a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RestartAsync(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateRestartRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to restart a replica. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Restart(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateRestartRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all replicas belong to this resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicaList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ReplicaList.DeserializeReplicaList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all replicas belong to this resource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// 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 resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicaList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ReplicaList.DeserializeReplicaList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs index f8f746dabc4d8..99c870712ef13 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs @@ -32,7 +32,7 @@ public SignalRRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, A } /// Checks that the resource name is valid and is not already in use. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. @@ -101,7 +101,7 @@ public async Task> CheckNameAvailability } /// Checks that the resource name is valid and is not already in use. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the region. /// Parameters supplied to the operation. /// The cancellation token to use. @@ -157,7 +157,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Handles requests to list all resources in a subscription. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -182,7 +182,7 @@ public async Task> ListBySubscriptionAsync(string } /// Handles requests to list all resources in a subscription. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -239,8 +239,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Handles requests to list all resources in a resource group. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -266,8 +266,8 @@ public async Task> ListByResourceGroupAsync(string } /// Handles requests to list all resources in a resource group. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -327,8 +327,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the resource and its properties. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -358,8 +358,8 @@ public async Task> GetAsync(string subscriptionId, string } /// Get the resource and its properties. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -427,8 +427,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameters for the create or update operation. /// The cancellation token to use. @@ -455,8 +455,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameters for the create or update operation. /// The cancellation token to use. @@ -517,8 +517,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Operation to delete a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -543,8 +543,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Operation to delete a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -607,8 +607,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Operation to update an exiting resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameters for the update operation. /// The cancellation token to use. @@ -634,8 +634,8 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Operation to update an exiting resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameters for the update operation. /// The cancellation token to use. @@ -697,8 +697,8 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc } /// Get the access keys of the resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -726,8 +726,8 @@ public async Task> ListKeysAsync(string subscriptionId, st } /// Get the access keys of the resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -795,8 +795,8 @@ internal HttpMessage CreateRegenerateKeyRequest(string subscriptionId, string re } /// Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameter that describes the Regenerate Key Operation. /// The cancellation token to use. @@ -813,6 +813,7 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -821,8 +822,8 @@ public async Task RegenerateKeyAsync(string subscriptionId, string res } /// Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// Parameter that describes the Regenerate Key Operation. /// The cancellation token to use. @@ -839,6 +840,7 @@ public Response RegenerateKey(string subscriptionId, string resourceGroupName, s _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -846,6 +848,108 @@ public Response RegenerateKey(string subscriptionId, string resourceGroupName, s } } + internal RequestUriBuilder CreateListReplicaSkusRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListReplicaSkusRequest(string subscriptionId, string resourceGroupName, string resourceName, string replicaName) + { + 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.SignalRService/signalR/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/replicas/", false); + uri.AppendPath(replicaName, true); + uri.AppendPath("/skus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all available skus of the replica resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListReplicaSkusAsync(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListReplicaSkusRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SignalRSkuListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SignalRSkuListResult.DeserializeSignalRSkuListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all available skus of the replica resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the resource. + /// The name of the replica. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListReplicaSkus(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(replicaName, nameof(replicaName)); + + using var message = CreateListReplicaSkusRequest(subscriptionId, resourceGroupName, resourceName, replicaName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SignalRSkuListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SignalRSkuListResult.DeserializeSignalRSkuListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateRestartRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); @@ -883,8 +987,8 @@ internal HttpMessage CreateRestartRequest(string subscriptionId, string resource } /// Operation to restart a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -908,8 +1012,8 @@ public async Task RestartAsync(string subscriptionId, string resourceG } /// Operation to restart a resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -969,8 +1073,8 @@ internal HttpMessage CreateListSkusRequest(string subscriptionId, string resourc } /// List all available skus of the resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -998,8 +1102,8 @@ public async Task> ListSkusAsync(string subscript } /// List all available skus of the resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -1050,7 +1154,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Handles requests to list all resources in a subscription. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1077,7 +1181,7 @@ public async Task> ListBySubscriptionNextPageAsync /// Handles requests to list all resources in a subscription. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1126,8 +1230,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Handles requests to list all resources in a resource group. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -1155,8 +1259,8 @@ public async Task> ListByResourceGroupNextPageAsyn /// Handles requests to list all resources in a resource group. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs index fa21d0a003bc8..be8c8494c1497 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SignalRSharedPrivateLinkResourcesRestOperations(HttpPipeline pipeline, st { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List shared private link resources. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> ListAsyn } /// List shared private link resources. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , or is null. @@ -169,8 +169,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The cancellation token to use. @@ -202,8 +202,8 @@ public async Task> GetAsync(strin } /// Get the specified shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The cancellation token to use. @@ -277,8 +277,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The shared private link resource. @@ -306,8 +306,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The shared private link resource. @@ -373,8 +373,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete the specified shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The cancellation token to use. @@ -401,8 +401,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete the specified shared private link resource. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The name of the shared private link resource. /// The cancellation token to use. @@ -452,8 +452,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List shared private link resources. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. @@ -483,8 +483,8 @@ public async Task> ListNext /// List shared private link resources. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs index eb1f7d070c7e4..3b9aa6d6b9a6d 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// List resource usage quotas by location. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the location like "eastus". /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> ListAsync(string subscriptionId, A } /// List resource usage quotas by location. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the location like "eastus". /// The cancellation token to use. /// is null. @@ -144,7 +144,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List resource usage quotas by location. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the location like "eastus". /// The cancellation token to use. /// or is null. @@ -172,7 +172,7 @@ public async Task> ListNextPageAsync(string nextLink, /// List resource usage quotas by location. /// The URL to the next page of results. - /// Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// the location like "eastus". /// The cancellation token to use. /// or is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs index 17b30061f8bb2..69299a0b652c1 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -89,7 +89,7 @@ public virtual async Task> CreateOrUpdateAsync(Wai try { var response = await _signalRRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalROperationSource(Client), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalROperationSource(Client), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -138,7 +138,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, try { var response = _signalRRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalROperationSource(Client), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalROperationSource(Client), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string resourceNam /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string resourceName, CancellationTo /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken canc /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync(st /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs index c6d85c743c458..d09316b77529f 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -88,7 +88,7 @@ public virtual async Task> Create try { var response = await _signalRCustomCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -137,7 +137,7 @@ public virtual ArmOperation CreateOrUpdate(Wai try { var response = _signalRCustomCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string certificate /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string certificateName, Ca /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string certificateName, CancellationToken c /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs index 3381a42482880..5060bdb55c55d 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual async Task> Update try { var response = await _signalRCustomCertificateRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -315,7 +315,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Update(WaitUntil w try { var response = _signalRCustomCertificateRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomCertificateOperationSource(Client), _signalRCustomCertificateClientDiagnostics, Pipeline, _signalRCustomCertificateRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs index ec52987e85337..fe2421df2998e 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -88,7 +88,7 @@ public virtual async Task> CreateOrUpd try { var response = await _signalRCustomDomainRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -137,7 +137,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti try { var response = _signalRCustomDomainRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string name, Cancellati /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs index 163384f773299..f0abcec9f954e 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> UpdateAsync try { var response = await _signalRCustomDomainRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -332,7 +332,7 @@ public virtual ArmOperation Update(WaitUntil waitUn try { var response = _signalRCustomDomainRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRCustomDomainOperationSource(Client), _signalRCustomDomainClientDiagnostics, Pipeline, _signalRCustomDomainRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.Serialization.cs index 038f33a27b196..a42b3e7517774 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.Serialization.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.Serialization.cs @@ -165,6 +165,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WritePropertyName("cors"u8); writer.WriteObjectValue(Cors, options); } + if (Optional.IsDefined(Serverless)) + { + writer.WritePropertyName("serverless"u8); + writer.WriteObjectValue(Serverless, options); + } if (Optional.IsDefined(Upstream)) { writer.WritePropertyName("upstream"u8); @@ -190,6 +195,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WritePropertyName("disableAadAuth"u8); writer.WriteBooleanValue(DisableAadAuth.Value); } + if (Optional.IsDefined(RegionEndpointEnabled)) + { + writer.WritePropertyName("regionEndpointEnabled"u8); + writer.WriteStringValue(RegionEndpointEnabled); + } + if (Optional.IsDefined(ResourceStopped)) + { + writer.WritePropertyName("resourceStopped"u8); + writer.WriteStringValue(ResourceStopped); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -252,11 +267,14 @@ internal static SignalRData DeserializeSignalRData(JsonElement element, ModelRea SignalRLiveTraceConfiguration liveTraceConfiguration = default; SignalRResourceLogCategoryListResult resourceLogConfiguration = default; SignalRCorsSettings cors = default; + ServerlessSettings serverless = default; ServerlessUpstreamSettings upstream = default; SignalRNetworkAcls networkACLs = default; string publicNetworkAccess = default; bool? disableLocalAuth = default; bool? disableAadAuth = default; + string regionEndpointEnabled = default; + string resourceStopped = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -465,6 +483,15 @@ internal static SignalRData DeserializeSignalRData(JsonElement element, ModelRea cors = SignalRCorsSettings.DeserializeSignalRCorsSettings(property0.Value, options); continue; } + if (property0.NameEquals("serverless"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverless = ServerlessSettings.DeserializeServerlessSettings(property0.Value, options); + continue; + } if (property0.NameEquals("upstream"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -506,6 +533,16 @@ internal static SignalRData DeserializeSignalRData(JsonElement element, ModelRea disableAadAuth = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("regionEndpointEnabled"u8)) + { + regionEndpointEnabled = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("resourceStopped"u8)) + { + resourceStopped = property0.Value.GetString(); + continue; + } } continue; } @@ -539,11 +576,14 @@ internal static SignalRData DeserializeSignalRData(JsonElement element, ModelRea liveTraceConfiguration, resourceLogConfiguration, cors, + serverless, upstream, networkACLs, publicNetworkAccess, disableLocalAuth, disableAadAuth, + regionEndpointEnabled, + resourceStopped, serializedAdditionalRawData); } @@ -988,6 +1028,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ServerlessConnectionTimeoutInSeconds", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serverless: "); + builder.AppendLine("{"); + builder.AppendLine(" serverless: {"); + builder.Append(" connectionTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Serverless)) + { + builder.Append(" serverless: "); + BicepSerializationHelpers.AppendChildObject(builder, Serverless, options, 4, false, " serverless: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("UpstreamTemplates", out propertyOverride); if (hasPropertyOverride) { @@ -1078,6 +1138,52 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RegionEndpointEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" regionEndpointEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RegionEndpointEnabled)) + { + builder.Append(" regionEndpointEnabled: "); + if (RegionEndpointEnabled.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RegionEndpointEnabled}'''"); + } + else + { + builder.AppendLine($"'{RegionEndpointEnabled}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceStopped), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceStopped: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceStopped)) + { + builder.Append(" resourceStopped: "); + if (ResourceStopped.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ResourceStopped}'''"); + } + else + { + builder.AppendLine($"'{ResourceStopped}'"); + } + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs index d097d73c8b64b..06543c26ef1ba 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs @@ -68,7 +68,7 @@ public SignalRData(AzureLocation location) : base(location) /// The tags. /// The location. /// The billing information of the resource. - /// The kind of the service, it can be SignalR or RawWebSockets. + /// The kind of the service. /// A class represent managed identities used for request and response. Current supported identity types: None, SystemAssigned, UserAssigned. /// Provisioning state of the resource. /// The publicly accessible IP of the resource. @@ -91,6 +91,7 @@ public SignalRData(AzureLocation location) : base(location) /// Live trace configuration of a Microsoft.SignalRService resource. /// Resource log configuration of a Microsoft.SignalRService resource. /// Cross-Origin Resource Sharing (CORS) settings. + /// Serverless settings. /// The settings for the Upstream when the service is in server-less mode. /// Network ACLs for the resource. /// @@ -108,8 +109,18 @@ public SignalRData(AzureLocation location) : base(location) /// Enable or disable aad auth /// When set as true, connection with AuthType=aad won't work. /// + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// This property is replica specific. Disable the regional endpoint without replica is not allowed. + /// + /// + /// Stop or start the resource. Default to "False". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// /// Keeps track of any properties unknown to the library. - internal SignalRData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SignalRResourceSku sku, SignalRServiceKind? kind, ManagedServiceIdentity identity, SignalRProvisioningState? provisioningState, string externalIP, string hostName, int? publicPort, int? serverPort, string version, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, SignalRTlsSettings tls, string hostNamePrefix, IList features, SignalRLiveTraceConfiguration liveTraceConfiguration, SignalRResourceLogCategoryListResult resourceLogConfiguration, SignalRCorsSettings cors, ServerlessUpstreamSettings upstream, SignalRNetworkAcls networkACLs, string publicNetworkAccess, bool? disableLocalAuth, bool? disableAadAuth, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal SignalRData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SignalRResourceSku sku, SignalRServiceKind? kind, ManagedServiceIdentity identity, SignalRProvisioningState? provisioningState, string externalIP, string hostName, int? publicPort, int? serverPort, string version, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, SignalRTlsSettings tls, string hostNamePrefix, IList features, SignalRLiveTraceConfiguration liveTraceConfiguration, SignalRResourceLogCategoryListResult resourceLogConfiguration, SignalRCorsSettings cors, ServerlessSettings serverless, ServerlessUpstreamSettings upstream, SignalRNetworkAcls networkACLs, string publicNetworkAccess, bool? disableLocalAuth, bool? disableAadAuth, string regionEndpointEnabled, string resourceStopped, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Kind = kind; @@ -128,11 +139,14 @@ internal SignalRData(ResourceIdentifier id, string name, ResourceType resourceTy LiveTraceConfiguration = liveTraceConfiguration; ResourceLogConfiguration = resourceLogConfiguration; Cors = cors; + Serverless = serverless; Upstream = upstream; NetworkACLs = networkACLs; PublicNetworkAccess = publicNetworkAccess; DisableLocalAuth = disableLocalAuth; DisableAadAuth = disableAadAuth; + RegionEndpointEnabled = regionEndpointEnabled; + ResourceStopped = resourceStopped; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -144,7 +158,7 @@ internal SignalRData() /// The billing information of the resource. [WirePath("sku")] public SignalRResourceSku Sku { get; set; } - /// The kind of the service, it can be SignalR or RawWebSockets. + /// The kind of the service. [WirePath("kind")] public SignalRServiceKind? Kind { get; set; } /// A class represent managed identities used for request and response. Current supported identity types: None, SystemAssigned, UserAssigned. @@ -176,7 +190,7 @@ internal SignalRData() public IReadOnlyList SharedPrivateLinkResources { get; } /// TLS settings for the resource. internal SignalRTlsSettings Tls { get; set; } - /// Request client certificate during TLS handshake if enabled. + /// Request client certificate during TLS handshake if enabled. Not supported for free tier. Any input will be ignored for free tier. [WirePath("properties.tls.clientCertEnabled")] public bool? IsClientCertEnabled { @@ -233,6 +247,30 @@ public IList CorsAllowedOrigins } } + /// Serverless settings. + internal ServerlessSettings Serverless { get; set; } + /// + /// Gets or sets Client Connection Timeout. Optional to be set. + /// Value in seconds. + /// Default value is 30 seconds. + /// Customer should set the timeout to a shorter period if messages are expected to be sent in shorter intervals, + /// and want the client to disconnect more quickly after the last message is sent. + /// You can set the timeout to a longer period if messages are expected to be sent in longer intervals, + /// and they want to keep the same client connection alive during this session. + /// The service considers the client disconnected if it hasn't received a message (including keep-alive) in this interval. + /// + [WirePath("properties.serverless.connectionTimeoutInSeconds")] + public int? ServerlessConnectionTimeoutInSeconds + { + get => Serverless is null ? default : Serverless.ConnectionTimeoutInSeconds; + set + { + if (Serverless is null) + Serverless = new ServerlessSettings(); + Serverless.ConnectionTimeoutInSeconds = value; + } + } + /// The settings for the Upstream when the service is in server-less mode. internal ServerlessUpstreamSettings Upstream { get; set; } /// Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. @@ -271,5 +309,19 @@ public IList UpstreamTemplates /// [WirePath("properties.disableAadAuth")] public bool? DisableAadAuth { get; set; } + /// + /// Enable or disable the regional endpoint. Default to "Enabled". + /// When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected. + /// This property is replica specific. Disable the regional endpoint without replica is not allowed. + /// + [WirePath("properties.regionEndpointEnabled")] + public string RegionEndpointEnabled { get; set; } + /// + /// Stop or start the resource. Default to "False". + /// When it's true, the data plane of the resource is shutdown. + /// When it's false, the data plane of the resource is started. + /// + [WirePath("properties.resourceStopped")] + public string ResourceStopped { get; set; } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs index 910fabe835230..3d370a4b24c57 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -73,7 +73,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The resource of private endpoint and its properties. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -115,7 +115,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -124,7 +124,7 @@ public virtual async Task /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The resource of private endpoint and its properties. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual ArmOperation CreateOrUp /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -211,7 +211,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> Ge /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -256,7 +256,7 @@ public virtual Response Get(string pri /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual Pageable GetAll(Cancell /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -402,7 +402,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -410,7 +410,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -455,7 +455,7 @@ public virtual async Task /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionResource.cs index 3f46279db4bb5..e958cf96b4a4e 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.Serialization.cs new file mode 100644 index 0000000000000..40bfb7a457cbc --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.SignalR +{ + public partial class SignalRReplicaSharedPrivateLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SignalRSharedPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SignalRSharedPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.cs new file mode 100644 index 0000000000000..274d033fd875e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResource.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SignalR +{ + /// + /// A Class representing a SignalRReplicaSharedPrivateLinkResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetSignalRReplicaSharedPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetSignalRReplicaSharedPrivateLinkResource method. + /// + public partial class SignalRReplicaSharedPrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The replicaName. + /// The sharedPrivateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string replicaName, string sharedPrivateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _signalRReplicaSharedPrivateLinkResourceClientDiagnostics; + private readonly SignalRReplicaSharedPrivateLinkResourcesRestOperations _signalRReplicaSharedPrivateLinkResourceRestClient; + private readonly SignalRSharedPrivateLinkResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.SignalRService/signalR/replicas/sharedPrivateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected SignalRReplicaSharedPrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SignalRReplicaSharedPrivateLinkResource(ArmClient client, SignalRSharedPrivateLinkResourceData 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 SignalRReplicaSharedPrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _signalRReplicaSharedPrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SignalR", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string signalRReplicaSharedPrivateLinkResourceApiVersion); + _signalRReplicaSharedPrivateLinkResourceRestClient = new SignalRReplicaSharedPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, signalRReplicaSharedPrivateLinkResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SignalRSharedPrivateLinkResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The shared private link resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResource.Update"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new SignalRArmOperation(new SignalRReplicaSharedPrivateLinkResourceOperationSource(Client), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRReplicaSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The shared private link resource. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResource.Update"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new SignalRArmOperation(new SignalRReplicaSharedPrivateLinkResourceOperationSource(Client), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRReplicaSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResourceCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResourceCollection.cs new file mode 100644 index 0000000000000..9ef52f8696ed5 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRReplicaSharedPrivateLinkResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.SignalR +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetSignalRReplicaSharedPrivateLinkResources method from an instance of . + /// + public partial class SignalRReplicaSharedPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _signalRReplicaSharedPrivateLinkResourceClientDiagnostics; + private readonly SignalRReplicaSharedPrivateLinkResourcesRestOperations _signalRReplicaSharedPrivateLinkResourceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SignalRReplicaSharedPrivateLinkResourceCollection() + { + } + + /// 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 SignalRReplicaSharedPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _signalRReplicaSharedPrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SignalR", SignalRReplicaSharedPrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SignalRReplicaSharedPrivateLinkResource.ResourceType, out string signalRReplicaSharedPrivateLinkResourceApiVersion); + _signalRReplicaSharedPrivateLinkResourceRestClient = new SignalRReplicaSharedPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, signalRReplicaSharedPrivateLinkResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ReplicaResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ReplicaResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the shared private link resource. + /// The shared private link resource. + /// 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 sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SignalRArmOperation(new SignalRReplicaSharedPrivateLinkResourceOperationSource(Client), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRReplicaSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the shared private link resource. + /// The shared private link resource. + /// 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 sharedPrivateLinkResourceName, SignalRSharedPrivateLinkResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken); + var operation = new SignalRArmOperation(new SignalRReplicaSharedPrivateLinkResourceOperationSource(Client), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRReplicaSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified shared private link resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List shared private link resources + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _signalRReplicaSharedPrivateLinkResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _signalRReplicaSharedPrivateLinkResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SignalRReplicaSharedPrivateLinkResource(Client, SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(e)), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, "SignalRReplicaSharedPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List shared private link resources + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_List + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _signalRReplicaSharedPrivateLinkResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _signalRReplicaSharedPrivateLinkResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SignalRReplicaSharedPrivateLinkResource(Client, SignalRSharedPrivateLinkResourceData.DeserializeSignalRSharedPrivateLinkResourceData(e)), _signalRReplicaSharedPrivateLinkResourceClientDiagnostics, Pipeline, "SignalRReplicaSharedPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, 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.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _signalRReplicaSharedPrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName} + /// + /// + /// Operation Id + /// SignalRReplicaSharedPrivateLinkResources_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the shared private link resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string sharedPrivateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sharedPrivateLinkResourceName, nameof(sharedPrivateLinkResourceName)); + + using var scope = _signalRReplicaSharedPrivateLinkResourceClientDiagnostics.CreateScope("SignalRReplicaSharedPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _signalRReplicaSharedPrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, sharedPrivateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SignalRReplicaSharedPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs index c5b59afc1c784..1ccc33ed90b8a 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs @@ -115,7 +115,7 @@ public virtual SignalRCustomCertificateCollection GetSignalRCustomCertificates() /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task> GetSignalR /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual SignalRCustomDomainCollection GetSignalRCustomDomains() /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetSignalRCusto /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual SignalRPrivateEndpointConnectionCollection GetSignalRPrivateEndpo /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual SignalRPrivateEndpointConnectionCollection GetSignalRPrivateEndpo /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -284,7 +284,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task> Ge /// /// /// - /// The name of the private endpoint connection. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -302,6 +302,75 @@ public virtual Response GetSignalRPriv return GetSignalRPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } + /// Gets a collection of ReplicaResources in the SignalR. + /// An object representing collection of ReplicaResources and their operations over a ReplicaResource. + public virtual ReplicaCollection GetReplicas() + { + return GetCachedClient(client => new ReplicaCollection(client, Id)); + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetReplicaAsync(string replicaName, CancellationToken cancellationToken = default) + { + return await GetReplicas().GetAsync(replicaName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetReplica(string replicaName, CancellationToken cancellationToken = default) + { + return GetReplicas().Get(replicaName, cancellationToken); + } + /// Gets a collection of SignalRSharedPrivateLinkResources in the SignalR. /// An object representing collection of SignalRSharedPrivateLinkResources and their operations over a SignalRSharedPrivateLinkResource. public virtual SignalRSharedPrivateLinkResourceCollection GetSignalRSharedPrivateLinkResources() @@ -322,7 +391,7 @@ public virtual SignalRSharedPrivateLinkResourceCollection GetSignalRSharedPrivat /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -353,7 +422,7 @@ public virtual async Task> GetSignalR /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -384,7 +453,7 @@ public virtual Response GetSignalRSharedPrivat /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -424,7 +493,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -464,7 +533,7 @@ public virtual Response Get(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -506,7 +575,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -548,7 +617,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -594,7 +663,7 @@ public virtual async Task> UpdateAsync(WaitUntil w /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -640,7 +709,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, SignalR /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -678,7 +747,7 @@ public virtual async Task> GetKeysAsync(CancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -716,7 +785,7 @@ public virtual Response GetKeys(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -737,7 +806,7 @@ public virtual async Task> RegenerateKeyAsync(WaitUnti try { var response = await _signalRRestClient.RegenerateKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRKeysOperationSource(), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRegenerateKeyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new SignalRArmOperation(new SignalRKeysOperationSource(), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRegenerateKeyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -762,7 +831,7 @@ public virtual async Task> RegenerateKeyAsync(WaitUnti /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -783,7 +852,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, Sign try { var response = _signalRRestClient.RegenerateKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new SignalRArmOperation(new SignalRKeysOperationSource(), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRegenerateKeyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new SignalRArmOperation(new SignalRKeysOperationSource(), _signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRegenerateKeyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -808,7 +877,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, Sign /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -825,7 +894,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel try { var response = await _signalRRestClient.RestartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(_signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new SignalRArmOperation(_signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -850,7 +919,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -867,7 +936,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance try { var response = _signalRRestClient.Restart(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SignalRArmOperation(_signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new SignalRArmOperation(_signalRClientDiagnostics, Pipeline, _signalRRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -892,7 +961,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -921,7 +990,7 @@ public virtual AsyncPageable GetSkusAsync(CancellationToken cancella /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -950,7 +1019,7 @@ public virtual Pageable GetSkus(CancellationToken cancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// @@ -976,7 +1045,7 @@ public virtual AsyncPageable GetSignalRPrivateLinkRe /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// @@ -1002,7 +1071,7 @@ public virtual Pageable GetSignalRPrivateLinkResourc /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -1064,7 +1133,7 @@ public virtual async Task> AddTagAsync(string key, str /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -1126,7 +1195,7 @@ public virtual Response AddTag(string key, string value, Cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -1183,7 +1252,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -1240,7 +1309,7 @@ public virtual Response SetTags(IDictionary tag /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -1300,7 +1369,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs index 09f1bf53436e3..06828d50b60be 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> Update try { var response = await _signalRSharedPrivateLinkResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -311,7 +311,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -332,7 +332,7 @@ public virtual ArmOperation Update(WaitUntil w try { var response = _signalRSharedPrivateLinkResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs index 110d31a2715a3..6cced1618dba4 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -88,7 +88,7 @@ public virtual async Task> Create try { var response = await _signalRSharedPrivateLinkResourceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken).ConfigureAwait(false); - var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -137,7 +137,7 @@ public virtual ArmOperation CreateOrUpdate(Wai try { var response = _signalRSharedPrivateLinkResourceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data, cancellationToken); - var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.Location); + var operation = new SignalRArmOperation(new SignalRSharedPrivateLinkResourceOperationSource(Client), _signalRSharedPrivateLinkResourceClientDiagnostics, Pipeline, _signalRSharedPrivateLinkResourceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sharedPrivateLinkResourceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string sharedPriva /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string sharedPrivateLinkRe /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string sharedPrivateLinkResourceName, Cance /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2022-02-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md b/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md index 324c610102eb3..f4cc0c7289501 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: SignalR namespace: Azure.ResourceManager.SignalR -require: https://github.com/Azure/azure-rest-api-specs/blob/34ba022add0034e30462b76e1548ce5a7e053e33/specification/signalr/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/signalr/resource-manager/readme.md #tag: package-2022-02-01 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/autorest.md b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/autorest.md index 68b1645608c1f..e66f53d242767 100644 --- a/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/autorest.md +++ b/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/autorest.md @@ -6,7 +6,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: WebPubSub namespace: Azure.ResourceManager.WebPubSub -require: https://github.com/Azure/azure-rest-api-specs/blob/1be09531e4c6edeafde41d6562371566d39669e8/specification/webpubsub/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/webpubsub/resource-manager/readme.md tag: package-2021-10-01 output-folder: $(this-folder)/Generated clear-output-folder: true