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 4a7986e04a30..5458d0e68e1a 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,52 @@ 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; } + 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 + { + public ReplicaData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + 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 { } } + } + public partial class ReplicaResource : Azure.ResourceManager.ArmResource + { + 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 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; } + 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() { } @@ -107,7 +154,10 @@ public SignalRData(Azure.Core.AzureLocation location) : base (default(Azure.Core 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 { } } @@ -118,6 +168,7 @@ 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; } @@ -183,6 +234,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; } @@ -253,9 +307,10 @@ 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; } + 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; } @@ -267,6 +322,12 @@ 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 + { + public IPRule() { } + public Azure.ResourceManager.SignalR.Models.SignalRNetworkAclAction? Action { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PrivateLinkServiceConnectionStatus : System.IEquatable { @@ -407,6 +468,7 @@ public partial class SignalRNetworkAcls { 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 { } } } diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs index 68b16b374ec2..754b094c3487 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ArmSignalRModelFactory.cs @@ -56,7 +56,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. @@ -79,6 +79,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. /// @@ -96,8 +97,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(); @@ -107,14 +118,14 @@ public static SignalRData SignalRData(ResourceIdentifier id = null, string name corsAllowedOrigins ??= new List(); upstreamTemplates ??= new List(); - return new SignalRData(id, name, resourceType, systemData, tags, location, sku, kind, identity, provisioningState, externalIP, hostName, publicPort, serverPort, version, privateEndpointConnections?.ToList(), sharedPrivateLinkResources?.ToList(), isClientCertEnabled != null ? new SignalRTlsSettings(isClientCertEnabled) : null, hostNamePrefix, features?.ToList(), liveTraceConfiguration, resourceLogCategories != null ? new SignalRResourceLogCategoryListResult(resourceLogCategories?.ToList()) : null, corsAllowedOrigins != null ? new SignalRCorsSettings(corsAllowedOrigins?.ToList()) : null, upstreamTemplates != null ? new ServerlessUpstreamSettings(upstreamTemplates?.ToList()) : null, networkACLs, publicNetworkAccess, disableLocalAuth, disableAadAuth); + return new SignalRData(id, name, resourceType, systemData, tags, location, sku, kind, identity, provisioningState, externalIP, hostName, publicPort, serverPort, version, privateEndpointConnections?.ToList(), sharedPrivateLinkResources?.ToList(), isClientCertEnabled != null ? new SignalRTlsSettings(isClientCertEnabled) : null, hostNamePrefix, features?.ToList(), liveTraceConfiguration, resourceLogCategories != null ? new SignalRResourceLogCategoryListResult(resourceLogCategories?.ToList()) : null, corsAllowedOrigins != null ? new SignalRCorsSettings(corsAllowedOrigins?.ToList()) : null, serverlessConnectionTimeoutInSeconds != null ? new ServerlessSettings(serverlessConnectionTimeoutInSeconds) : null, upstreamTemplates != null ? new ServerlessUpstreamSettings(upstreamTemplates?.ToList()) : null, networkACLs, publicNetworkAccess, disableLocalAuth, disableAadAuth, regionEndpointEnabled, resourceStopped); } /// Initializes a new instance of SignalRResourceSku. /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1 /// /// /// Optional tier of this particular SKU. 'Standard' or 'Free'. @@ -127,8 +138,9 @@ public static SignalRData SignalRData(ResourceIdentifier id = null, string name /// Optional, integer. The unit count of the resource. 1 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free: 1; + /// Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; /// /// A new instance for mocking. public static SignalRResourceSku SignalRResourceSku(string name = null, SignalRSkuTier? tier = null, string size = null, string family = null, int? capacity = null) @@ -228,6 +240,32 @@ public static SignalRPrivateLinkResource SignalRPrivateLinkResource(ResourceIden return new SignalRPrivateLinkResource(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), shareablePrivateLinkResourceTypes?.ToList()); } + /// Initializes a new instance of ReplicaData. + /// 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); + } + /// Initializes a new instance of SignalRSku. /// The resource type that this object applies to. /// The billing information of the resource. 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 351a90fc8fa1..5d9d8fc24a05 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Extensions/SignalRExtensions.cs @@ -126,6 +126,25 @@ public static SignalRPrivateEndpointConnectionResource GetSignalRPrivateEndpoint } #endregion + #region ReplicaResource + /// + /// 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 instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ReplicaResource GetReplicaResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ReplicaResource.ValidateResourceId(id); + return new ReplicaResource(client, id); + } + ); + } + #endregion + #region SignalRSharedPrivateLinkResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. 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 000000000000..1d402258c501 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/LongRunningOperation/ReplicaOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.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/Models/IPRule.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.Serialization.cs new file mode 100644 index 000000000000..6de89f90eb8f --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.Serialization.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR.Models +{ + public partial class IPRule : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + 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()); + } + writer.WriteEndObject(); + } + + internal static IPRule DeserializeIPRule(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional value = default; + Optional action = default; + 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; + } + } + return new IPRule(value.Value, Optional.ToNullable(action)); + } + } +} 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 000000000000..68868ad3f51e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/IPRule.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SignalR.Models +{ + /// An IP rule. + public partial class IPRule + { + /// Initializes a new instance of IPRule. + public IPRule() + { + } + + /// Initializes a new instance of IPRule. + /// An IP or CIDR or ServiceTag. + /// Azure Networking ACL Action. + internal IPRule(string value, SignalRNetworkAclAction? action) + { + Value = value; + Action = action; + } + + /// An IP or CIDR or ServiceTag. + public string Value { get; set; } + /// Azure Networking ACL Action. + public SignalRNetworkAclAction? Action { get; set; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaData.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaData.Serialization.cs new file mode 100644 index 000000000000..360af9e065f4 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaData.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SignalR.Models; + +namespace Azure.ResourceManager.SignalR +{ + public partial class ReplicaData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku); + } + 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); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(RegionEndpointEnabled)) + { + writer.WritePropertyName("regionEndpointEnabled"u8); + writer.WriteStringValue(RegionEndpointEnabled); + } + if (Optional.IsDefined(ResourceStopped)) + { + writer.WritePropertyName("resourceStopped"u8); + writer.WriteStringValue(ResourceStopped); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ReplicaData DeserializeReplicaData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional sku = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional regionEndpointEnabled = default; + Optional resourceStopped = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = SignalRResourceSku.DeserializeSignalRResourceSku(property.Value); + 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; + } + } + return new ReplicaData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(provisioningState), regionEndpointEnabled.Value, resourceStopped.Value); + } + } +} 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 000000000000..a838dbcb308e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.SignalR; + +namespace Azure.ResourceManager.SignalR.Models +{ + internal partial class ReplicaList + { + internal static ReplicaList DeserializeReplicaList(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + 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)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ReplicaList(Optional.ToList(value), nextLink.Value); + } + } +} 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 000000000000..ca3e7f513733 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ReplicaList.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.SignalR; + +namespace Azure.ResourceManager.SignalR.Models +{ + /// The ReplicaList. + internal partial class ReplicaList + { + /// Initializes a new instance of ReplicaList. + internal ReplicaList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ReplicaList. + /// 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. + /// + internal ReplicaList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// 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 000000000000..c97487424337 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.Serialization.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SignalR.Models +{ + internal partial class ServerlessSettings : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ConnectionTimeoutInSeconds)) + { + writer.WritePropertyName("connectionTimeoutInSeconds"u8); + writer.WriteNumberValue(ConnectionTimeoutInSeconds.Value); + } + writer.WriteEndObject(); + } + + internal static ServerlessSettings DeserializeServerlessSettings(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional connectionTimeoutInSeconds = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionTimeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionTimeoutInSeconds = property.Value.GetInt32(); + continue; + } + } + return new ServerlessSettings(Optional.ToNullable(connectionTimeoutInSeconds)); + } + } +} 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 000000000000..c042618b9806 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/ServerlessSettings.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SignalR.Models +{ + /// Serverless settings. + internal partial class ServerlessSettings + { + /// Initializes a new instance of ServerlessSettings. + public ServerlessSettings() + { + } + + /// Initializes a new instance of ServerlessSettings. + /// + /// 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. + /// + internal ServerlessSettings(int? connectionTimeoutInSeconds) + { + ConnectionTimeoutInSeconds = connectionTimeoutInSeconds; + } + + /// + /// 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. + /// + public int? ConnectionTimeoutInSeconds { get; set; } + } +} diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRData.Serialization.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRData.Serialization.cs index e1327ad5dd33..f6e9da4c725b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRData.Serialization.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRData.Serialization.cs @@ -78,6 +78,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("cors"u8); writer.WriteObjectValue(Cors); } + if (Optional.IsDefined(Serverless)) + { + writer.WritePropertyName("serverless"u8); + writer.WriteObjectValue(Serverless); + } if (Optional.IsDefined(Upstream)) { writer.WritePropertyName("upstream"u8); @@ -103,6 +108,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) 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(); writer.WriteEndObject(); } @@ -136,11 +151,14 @@ internal static SignalRData DeserializeSignalRData(JsonElement element) Optional liveTraceConfiguration = default; Optional resourceLogConfiguration = default; Optional cors = default; + Optional serverless = default; Optional upstream = default; Optional networkACLs = default; Optional publicNetworkAccess = default; Optional disableLocalAuth = default; Optional disableAadAuth = default; + Optional regionEndpointEnabled = default; + Optional resourceStopped = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku"u8)) @@ -347,6 +365,15 @@ internal static SignalRData DeserializeSignalRData(JsonElement element) cors = SignalRCorsSettings.DeserializeSignalRCorsSettings(property0.Value); continue; } + if (property0.NameEquals("serverless"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverless = ServerlessSettings.DeserializeServerlessSettings(property0.Value); + continue; + } if (property0.NameEquals("upstream"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -388,11 +415,21 @@ internal static SignalRData DeserializeSignalRData(JsonElement element) 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; } } - return new SignalRData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(kind), identity, Optional.ToNullable(provisioningState), externalIP.Value, hostName.Value, Optional.ToNullable(publicPort), Optional.ToNullable(serverPort), version.Value, Optional.ToList(privateEndpointConnections), Optional.ToList(sharedPrivateLinkResources), tls.Value, hostNamePrefix.Value, Optional.ToList(features), liveTraceConfiguration.Value, resourceLogConfiguration.Value, cors.Value, upstream.Value, networkACLs.Value, publicNetworkAccess.Value, Optional.ToNullable(disableLocalAuth), Optional.ToNullable(disableAadAuth)); + return new SignalRData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToNullable(kind), identity, Optional.ToNullable(provisioningState), externalIP.Value, hostName.Value, Optional.ToNullable(publicPort), Optional.ToNullable(serverPort), version.Value, Optional.ToList(privateEndpointConnections), Optional.ToList(sharedPrivateLinkResources), tls.Value, hostNamePrefix.Value, Optional.ToList(features), liveTraceConfiguration.Value, resourceLogConfiguration.Value, cors.Value, serverless.Value, upstream.Value, networkACLs.Value, publicNetworkAccess.Value, Optional.ToNullable(disableLocalAuth), Optional.ToNullable(disableAadAuth), regionEndpointEnabled.Value, resourceStopped.Value); } } } 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 f0e1d47bcb38..4be302573611 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNameAvailabilityContent.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.SignalR.Models public partial class SignalRNameAvailabilityContent { /// Initializes a new instance of 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". /// The resource name to validate. e.g."my-resource-name". /// is null. public SignalRNameAvailabilityContent(ResourceType resourceType, string name) @@ -25,7 +25,7 @@ public SignalRNameAvailabilityContent(ResourceType resourceType, string name) Name = name; } - /// 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". public ResourceType ResourceType { get; } /// The resource name to validate. e.g."my-resource-name". public string Name { get; } 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 67cd3ddd4630..fbd4f7b56371 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 @@ -36,6 +36,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(IPRules)) + { + writer.WritePropertyName("ipRules"u8); + writer.WriteStartArray(); + foreach (var item in IPRules) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); } @@ -48,6 +58,7 @@ internal static SignalRNetworkAcls DeserializeSignalRNetworkAcls(JsonElement ele Optional defaultAction = default; Optional publicNetwork = default; Optional> privateEndpoints = default; + Optional> ipRules = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("defaultAction"u8)) @@ -82,8 +93,22 @@ 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)); + } + ipRules = array; + continue; + } } - return new SignalRNetworkAcls(Optional.ToNullable(defaultAction), publicNetwork.Value, Optional.ToList(privateEndpoints)); + return new SignalRNetworkAcls(Optional.ToNullable(defaultAction), publicNetwork.Value, Optional.ToList(privateEndpoints), Optional.ToList(ipRules)); } } } 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 be16ed16454d..6568c5519658 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRNetworkAcls.cs @@ -17,17 +17,20 @@ public partial class SignalRNetworkAcls public SignalRNetworkAcls() { PrivateEndpoints = new ChangeTrackingList(); + IPRules = new ChangeTrackingList(); } /// Initializes a new instance of SignalRNetworkAcls. /// Azure Networking ACL Action. /// Network ACL. /// ACLs for requests from private endpoints. - internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetworkAcl publicNetwork, IList privateEndpoints) + /// IP rules for filtering public traffic. + internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetworkAcl publicNetwork, IList privateEndpoints, IList ipRules) { DefaultAction = defaultAction; PublicNetwork = publicNetwork; PrivateEndpoints = privateEndpoints; + IPRules = ipRules; } /// Azure Networking ACL Action. @@ -36,5 +39,7 @@ internal SignalRNetworkAcls(SignalRNetworkAclAction? defaultAction, SignalRNetwo public SignalRNetworkAcl PublicNetwork { get; set; } /// ACLs for requests from private endpoints. public IList PrivateEndpoints { get; } + /// IP rules for filtering public traffic. + 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 332b7c9404c2..925c886b8f2c 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRResourceSku.cs @@ -17,7 +17,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 /// /// is null. public SignalRResourceSku(string name) @@ -31,7 +31,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 /// /// /// Optional tier of this particular SKU. 'Standard' or 'Free'. @@ -44,8 +44,9 @@ public SignalRResourceSku(string name) /// Optional, integer. The unit count of the resource. 1 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free: 1; + /// Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; /// internal SignalRResourceSku(string name, SignalRSkuTier? tier, string size, string family, int? capacity) { @@ -59,7 +60,7 @@ internal SignalRResourceSku(string name, SignalRSkuTier? tier, string size, stri /// /// The name of the SKU. Required. /// - /// Allowed values: Standard_S1, Free_F1 + /// Allowed values: Standard_S1, Free_F1, Premium_P1 /// public string Name { get; set; } /// @@ -76,8 +77,9 @@ internal SignalRResourceSku(string name, SignalRSkuTier? tier, string size, stri /// Optional, integer. The unit count of the resource. 1 by default. /// /// If present, following values are allowed: - /// Free: 1 - /// Standard: 1,2,5,10,20,50,100 + /// Free: 1; + /// Standard: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; + /// Premium: 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100; /// 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 31fca711ba20..d029d8a96c97 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 312b2bf2247f..513bbba229f9 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/Models/SignalRTlsSettings.cs @@ -16,13 +16,13 @@ public SignalRTlsSettings() } /// Initializes a new instance of SignalRTlsSettings. - /// 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. internal SignalRTlsSettings(bool? isClientCertEnabled) { IsClientCertEnabled = isClientCertEnabled; } - /// 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. 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 000000000000..5d36c9cd1260 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaCollection.cs @@ -0,0 +1,340 @@ +// 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 Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 PageableHelpers.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 + /// + /// + /// + /// 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 PageableHelpers.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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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; + } + } + + 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.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.cs new file mode 100644 index 000000000000..b708d45f6f9e --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaData.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +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 + { + /// Initializes a new instance of ReplicaData. + /// The location. + public ReplicaData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of ReplicaData. + /// 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. + /// + internal ReplicaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SignalRResourceSku sku, SignalRProvisioningState? provisioningState, string regionEndpointEnabled, string resourceStopped) : base(id, name, resourceType, systemData, tags, location) + { + Sku = sku; + ProvisioningState = provisioningState; + RegionEndpointEnabled = regionEndpointEnabled; + ResourceStopped = resourceStopped; + } + + /// The billing information of the resource. + public SignalRResourceSku Sku { get; set; } + /// Provisioning state of the resource. + 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. + /// + 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. + /// + public string ResourceStopped { get; set; } + } +} 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 000000000000..2f5e78e19031 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/ReplicaResource.cs @@ -0,0 +1,724 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +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. + 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; + + /// 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 the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.SignalRService/signalR/replicas"; + + /// 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)); + } + + /// + /// Get the replica and its properties. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName} + /// + /// + /// Operation Id + /// SignalRReplicas_Get + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 operation = new SignalRArmOperation(response); + 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 + /// + /// + /// + /// 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 operation = new SignalRArmOperation(response); + 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SignalRSku.DeserializeSignalRSku, _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 + /// + /// + /// + /// 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 PageableHelpers.CreatePageable(FirstPageRequest, null, SignalRSku.DeserializeSignalRSku, _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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 + /// + /// + /// + /// 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 6cfe80c1ad64..614fe3a12274 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomCertificatesRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,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. @@ -88,8 +88,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. @@ -139,8 +139,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. @@ -172,8 +172,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. @@ -231,8 +231,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 SignalRCustomCertificate to use. @@ -260,8 +260,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 SignalRCustomCertificate to use. @@ -311,8 +311,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. @@ -338,8 +338,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. @@ -380,8 +380,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. @@ -411,8 +411,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 3cd55a825fa7..3e246af5dd7a 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRCustomDomainsRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,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. @@ -88,8 +88,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. @@ -139,8 +139,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. @@ -172,8 +172,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. @@ -231,8 +231,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 SignalRCustomDomain to use. @@ -259,8 +259,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 SignalRCustomDomain to use. @@ -309,8 +309,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. @@ -337,8 +337,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. @@ -380,8 +380,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. @@ -411,8 +411,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 7caefd6bf3ae..3de2a7bd2b7d 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,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. @@ -88,8 +88,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. @@ -139,10 +139,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. @@ -172,10 +172,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. @@ -231,10 +231,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. @@ -264,10 +264,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. @@ -319,10 +319,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. @@ -347,10 +347,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. @@ -390,8 +390,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. @@ -421,8 +421,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 0edea5d6f37a..a98e72d0741d 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRPrivateLinkResourcesRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,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. @@ -88,8 +88,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. @@ -132,8 +132,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. @@ -163,8 +163,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/SignalRReplicasRestOperations.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicasRestOperations.cs new file mode 100644 index 000000000000..3a747b8df096 --- /dev/null +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRReplicasRestOperations.cs @@ -0,0 +1,604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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 ?? "2023-08-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + 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 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 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); + 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 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 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); + 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 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 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 c12269e5c291..681a864a6e56 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -61,7 +61,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. @@ -89,7 +89,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. @@ -134,7 +134,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. @@ -159,7 +159,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. @@ -203,8 +203,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. @@ -230,8 +230,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. @@ -277,8 +277,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. @@ -308,8 +308,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. @@ -363,8 +363,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. @@ -391,8 +391,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. @@ -439,8 +439,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. @@ -465,8 +465,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. @@ -515,8 +515,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. @@ -542,8 +542,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. @@ -590,8 +590,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. @@ -619,8 +619,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. @@ -673,8 +673,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. @@ -691,6 +691,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: @@ -699,8 +700,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. @@ -717,6 +718,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: @@ -724,6 +726,91 @@ public Response RegenerateKey(string subscriptionId, string resourceGroupName, s } } + 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 HttpMessage CreateRestartRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); @@ -746,8 +833,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. @@ -771,8 +858,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. @@ -817,8 +904,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. @@ -846,8 +933,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. @@ -890,7 +977,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. @@ -917,7 +1004,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. @@ -958,8 +1045,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. @@ -987,8 +1074,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 55a07cad414f..55cd6ced86a3 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/SignalRSharedPrivateLinkResourcesRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -59,8 +59,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. @@ -88,8 +88,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. @@ -139,8 +139,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. @@ -172,8 +172,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. @@ -231,8 +231,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. @@ -260,8 +260,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. @@ -311,8 +311,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. @@ -339,8 +339,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. @@ -382,8 +382,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. @@ -413,8 +413,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 62bd3767de60..b86b8a7bb18c 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/RestOperations/UsagesRestOperations.cs @@ -33,7 +33,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 ?? "2023-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -57,7 +57,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. @@ -83,7 +83,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. @@ -124,7 +124,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. @@ -152,7 +152,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 2811edb7529a..e3f166907942 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCollection.cs @@ -82,7 +82,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; @@ -123,7 +123,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; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs index f5dee06dcc96..2d00a407226f 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateCollection.cs @@ -81,7 +81,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; @@ -122,7 +122,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; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs index c97f66fa42f2..86bb50a42e51 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomCertificateResource.cs @@ -244,7 +244,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; @@ -282,7 +282,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 3bc7837c55b4..4473fcbf8ce1 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainCollection.cs @@ -81,7 +81,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; @@ -122,7 +122,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; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs index 2d6dbb0daad1..c69846b63f7b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRCustomDomainResource.cs @@ -244,7 +244,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; @@ -282,7 +282,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.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs index 40740a58c0c7..b3613b0df5c9 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRData.cs @@ -35,7 +35,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. @@ -58,6 +58,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. /// @@ -75,7 +76,17 @@ public SignalRData(AzureLocation location) : base(location) /// Enable or disable aad auth /// When set as true, connection with AuthType=aad won't work. /// - 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) : base(id, name, resourceType, systemData, tags, location) + /// + /// 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. + /// + 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) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Kind = kind; @@ -94,16 +105,19 @@ 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; } /// The billing information of the resource. public SignalRResourceSku Sku { get; set; } - /// The kind of the service, it can be SignalR or RawWebSockets. + /// The kind of the service. public SignalRServiceKind? Kind { get; set; } /// A class represent managed identities used for request and response. Current supported identity types: None, SystemAssigned, UserAssigned. public ManagedServiceIdentity Identity { get; set; } @@ -125,7 +139,7 @@ internal SignalRData(ResourceIdentifier id, string name, ResourceType resourceTy 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. public bool? IsClientCertEnabled { get => Tls is null ? default : Tls.IsClientCertEnabled; @@ -176,6 +190,29 @@ 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. + /// + 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. @@ -209,5 +246,17 @@ public IList UpstreamTemplates /// When set as true, connection with AuthType=aad won't work. /// 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. + /// + 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. + /// + 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 5466434c92a6..8dfe5c4e84f5 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRPrivateEndpointConnectionCollection.cs @@ -66,7 +66,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. @@ -107,7 +107,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. @@ -147,7 +147,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. @@ -184,7 +184,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. @@ -265,7 +265,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. @@ -300,7 +300,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. diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs index b4b438b2279e..eaa65880bc3b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRResource.cs @@ -219,7 +219,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 an empty string, and was expected to be non-empty. /// is null. @@ -242,7 +242,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. @@ -252,6 +252,59 @@ 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 + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [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 + /// + /// + /// + /// The name of the replica. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [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() @@ -599,7 +652,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; @@ -637,7 +690,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; @@ -671,7 +724,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; @@ -705,7 +758,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; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs index 2ad48a3b6e3d..f34fc2cdf04b 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResource.cs @@ -244,7 +244,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; @@ -282,7 +282,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 bed935871586..e5d0eae048b7 100644 --- a/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs +++ b/sdk/signalr/Azure.ResourceManager.SignalR/src/Generated/SignalRSharedPrivateLinkResourceCollection.cs @@ -81,7 +81,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; @@ -122,7 +122,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; diff --git a/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md b/sdk/signalr/Azure.ResourceManager.SignalR/src/autorest.md index 72b1f51d8b89..5621a91cdd96 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 output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true