diff --git a/src/SDKs/SignalR/AzSdk.RP.props b/src/SDKs/SignalR/AzSdk.RP.props index 3f29983d6fd6..67178597a08b 100644 --- a/src/SDKs/SignalR/AzSdk.RP.props +++ b/src/SDKs/SignalR/AzSdk.RP.props @@ -1,7 +1,7 @@  - SignalRService_2018-03-01-preview; + SignalRService_2018-10-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/ISignalROperations.cs b/src/SDKs/SignalR/Management.SignalR/Generated/ISignalROperations.cs index 0ea8083171b1..e11e05afe388 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/ISignalROperations.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/ISignalROperations.cs @@ -261,6 +261,30 @@ public partial interface ISignalROperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, SignalRUpdateParameters parameters = default(SignalRUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Operation to restart a SignalR service. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Regenerate SignalR service access key. PrimaryKey and SecondaryKey /// cannot be regenerated at the same time. /// @@ -376,6 +400,30 @@ public partial interface ISignalROperations /// Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, SignalRUpdateParameters parameters = default(SignalRUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Operation to restart a SignalR service. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Handles requests to list all resources in a subscription. /// /// diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/Resource.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/Resource.cs index 85e4b5205fec..61725b5ca00c 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/Resource.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/Resource.cs @@ -33,7 +33,7 @@ public Resource() /// /// Fully qualified resource Id for the /// resource. - /// The name of the resouce. + /// The name of the resource. /// The type of the service - e.g. /// "Microsoft.SignalRService/SignalR" public Resource(string id = default(string), string name = default(string), string type = default(string)) @@ -56,7 +56,7 @@ public Resource() public string Id { get; private set; } /// - /// Gets the name of the resouce. + /// Gets the name of the resource. /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/ResourceSku.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/ResourceSku.cs index 3e0c1bf120d4..27d549452cf8 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/ResourceSku.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/ResourceSku.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.SignalR.Models using System.Linq; /// - /// The billing information of the resource.(e.g. basic vs. standard) + /// The billing information of the SignalR resource. /// public partial class ResourceSku { @@ -30,22 +30,22 @@ public ResourceSku() /// /// Initializes a new instance of the ResourceSku class. /// - /// The name of the SKU. This is typically a letter - /// + number code, such as A0 or P3. Required (if sku is - /// specified) - /// Optional tier of this particular SKU. `Basic` is - /// deprecated, use `Standard` instead for Basic tier. Possible values + /// The name of the SKU. Required. + /// + /// Allowed values: Standard_S1, Free_F1 + /// Optional tier of this particular SKU. 'Standard' + /// or 'Free'. + /// + /// `Basic` is deprecated, use `Standard` instead. Possible values /// include: 'Free', 'Basic', 'Standard', 'Premium' - /// Optional, string. When the name field is the - /// combination of tier and some other value, this would be the - /// standalone code. - /// Optional, string. If the service has different - /// generations of hardware, for the same SKU, then that can be - /// captured here. - /// Optional, integer. If the SKU supports scale - /// out/in then the capacity integer should be included. If scale - /// out/in is not - /// possible for the resource this may be omitted. + /// Optional string. For future use. + /// Optional string. For future use. + /// Optional, integer. The unit count of SignalR + /// resource. 1 by default. + /// + /// If present, following values are allowed: + /// Free: 1 + /// Standard: 1,2,5,10,20,50,100 public ResourceSku(string name, string tier = default(string), string size = default(string), string family = default(string), int? capacity = default(int?)) { Name = name; @@ -62,41 +62,42 @@ public ResourceSku() partial void CustomInit(); /// - /// Gets or sets the name of the SKU. This is typically a letter + - /// number code, such as A0 or P3. Required (if sku is specified) + /// Gets or sets the name of the SKU. Required. + /// + /// Allowed values: Standard_S1, Free_F1 /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets optional tier of this particular SKU. `Basic` is - /// deprecated, use `Standard` instead for Basic tier. Possible values + /// Gets or sets optional tier of this particular SKU. 'Standard' or + /// 'Free'. + /// + /// `Basic` is deprecated, use `Standard` instead. Possible values /// include: 'Free', 'Basic', 'Standard', 'Premium' /// [JsonProperty(PropertyName = "tier")] public string Tier { get; set; } /// - /// Gets or sets optional, string. When the name field is the - /// combination of tier and some other value, this would be the - /// standalone code. + /// Gets or sets optional string. For future use. /// [JsonProperty(PropertyName = "size")] public string Size { get; set; } /// - /// Gets or sets optional, string. If the service has different - /// generations of hardware, for the same SKU, then that can be - /// captured here. + /// Gets or sets optional string. For future use. /// [JsonProperty(PropertyName = "family")] public string Family { get; set; } /// - /// Gets or sets optional, integer. If the SKU supports scale out/in - /// then the capacity integer should be included. If scale out/in is - /// not - /// possible for the resource this may be omitted. + /// Gets or sets optional, integer. The unit count of SignalR resource. + /// 1 by default. + /// + /// If present, following values are allowed: + /// Free: 1 + /// Standard: 1,2,5,10,20,50,100 /// [JsonProperty(PropertyName = "capacity")] public int? Capacity { get; set; } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRCreateOrUpdateProperties.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRCreateOrUpdateProperties.cs index 60b635ac435f..6febd271c3c3 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRCreateOrUpdateProperties.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRCreateOrUpdateProperties.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.SignalR.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -35,9 +37,21 @@ public SignalRCreateOrUpdateProperties() /// service. Retained for future use. /// The hostname will be of format: /// &lt;hostNamePrefix&gt;.service.signalr.net. - public SignalRCreateOrUpdateProperties(string hostNamePrefix = default(string)) + /// List of SignalR featureFlags. e.g. + /// ServiceMode. + /// + /// FeatureFlags that are not included in the parameters for the update + /// operation will not be modified. + /// And the response will only include featureFlags that are explicitly + /// set. + /// When a featureFlag is not explicitly set, SignalR service will use + /// its globally default value. + /// But keep in mind, the default value doesn't mean "false". It varies + /// in terms of different FeatureFlags. + public SignalRCreateOrUpdateProperties(string hostNamePrefix = default(string), IList features = default(IList)) { HostNamePrefix = hostNamePrefix; + Features = features; CustomInit(); } @@ -55,5 +69,20 @@ public SignalRCreateOrUpdateProperties() [JsonProperty(PropertyName = "hostNamePrefix")] public string HostNamePrefix { get; set; } + /// + /// Gets or sets list of SignalR featureFlags. e.g. ServiceMode. + /// + /// FeatureFlags that are not included in the parameters for the update + /// operation will not be modified. + /// And the response will only include featureFlags that are explicitly + /// set. + /// When a featureFlag is not explicitly set, SignalR service will use + /// its globally default value. + /// But keep in mind, the default value doesn't mean "false". It varies + /// in terms of different FeatureFlags. + /// + [JsonProperty(PropertyName = "features")] + public IList Features { get; set; } + } } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRFeature.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRFeature.cs new file mode 100644 index 000000000000..5985cf8961d0 --- /dev/null +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRFeature.cs @@ -0,0 +1,106 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.SignalR.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Feature of a SignalR resource, which controls the SignalR runtime + /// behavior. + /// + public partial class SignalRFeature + { + /// + /// Initializes a new instance of the SignalRFeature class. + /// + public SignalRFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SignalRFeature class. + /// + /// Value of the feature flag. See Azure SignalR + /// service document + /// https://docs.microsoft.com/en-us/azure/azure-signalr/ for allowed + /// values. + /// Optional properties related to this + /// feature. + public SignalRFeature(string value, IDictionary properties = default(IDictionary)) + { + Value = value; + Properties = properties; + CustomInit(); + } + /// + /// Static constructor for SignalRFeature class. + /// + static SignalRFeature() + { + Flag = "ServiceMode"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of the feature flag. See Azure SignalR service + /// document https://docs.microsoft.com/en-us/azure/azure-signalr/ for + /// allowed values. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets optional properties related to this feature. + /// + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } + + /// + /// Kind of feature. Required. + /// + [JsonProperty(PropertyName = "flag")] + public static string Flag { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (Value != null) + { + if (Value.Length > 128) + { + throw new ValidationException(ValidationRules.MaxLength, "Value", 128); + } + if (Value.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Value", 1); + } + } + } + } +} diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRResource.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRResource.cs index 88fbc084262e..2ed65dd5f218 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRResource.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRResource.cs @@ -36,7 +36,7 @@ public SignalRResource() /// /// Fully qualified resource Id for the /// resource. - /// The name of the resouce. + /// The name of the resource. /// The type of the service - e.g. /// "Microsoft.SignalRService/SignalR" /// The GEO location of the SignalR service. @@ -49,6 +49,17 @@ public SignalRResource() /// service. Retained for future use. /// The hostname will be of format: /// &lt;hostNamePrefix&gt;.service.signalr.net. + /// List of SignalR featureFlags. e.g. + /// ServiceMode. + /// + /// FeatureFlags that are not included in the parameters for the update + /// operation will not be modified. + /// And the response will only include featureFlags that are explicitly + /// set. + /// When a featureFlag is not explicitly set, SignalR service will use + /// its globally default value. + /// But keep in mind, the default value doesn't mean "false". It varies + /// in terms of different FeatureFlags. /// Provisioning state of the resource. /// Possible values include: 'Unknown', 'Succeeded', 'Failed', /// 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', @@ -57,19 +68,20 @@ public SignalRResource() /// service. /// FQDN of the SignalR service instance. /// Format: xxx.service.signalr.net - /// The publicly accessibly port of the + /// The publicly accessible port of the /// SignalR service which is designed for browser/client side /// usage. - /// The publicly accessibly port of the + /// The publicly accessible port of the /// SignalR service which is designed for customer server side /// usage. /// Version of the SignalR resource. Probably you /// need the same or higher version of client SDKs. - public SignalRResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ResourceSku sku = default(ResourceSku), string hostNamePrefix = default(string), string provisioningState = default(string), string externalIP = default(string), string hostName = default(string), int? publicPort = default(int?), int? serverPort = default(int?), string version = default(string)) + public SignalRResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ResourceSku sku = default(ResourceSku), string hostNamePrefix = default(string), IList features = default(IList), string provisioningState = default(string), string externalIP = default(string), string hostName = default(string), int? publicPort = default(int?), int? serverPort = default(int?), string version = default(string)) : base(id, name, type, location, tags) { Sku = sku; HostNamePrefix = hostNamePrefix; + Features = features; ProvisioningState = provisioningState; ExternalIP = externalIP; HostName = hostName; @@ -99,6 +111,21 @@ public SignalRResource() [JsonProperty(PropertyName = "properties.hostNamePrefix")] public string HostNamePrefix { get; set; } + /// + /// Gets or sets list of SignalR featureFlags. e.g. ServiceMode. + /// + /// FeatureFlags that are not included in the parameters for the update + /// operation will not be modified. + /// And the response will only include featureFlags that are explicitly + /// set. + /// When a featureFlag is not explicitly set, SignalR service will use + /// its globally default value. + /// But keep in mind, the default value doesn't mean "false". It varies + /// in terms of different FeatureFlags. + /// + [JsonProperty(PropertyName = "properties.features")] + public IList Features { get; set; } + /// /// Gets provisioning state of the resource. Possible values include: /// 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', @@ -121,14 +148,14 @@ public SignalRResource() public string HostName { get; private set; } /// - /// Gets the publicly accessibly port of the SignalR service which is + /// Gets the publicly accessible port of the SignalR service which is /// designed for browser/client side usage. /// [JsonProperty(PropertyName = "properties.publicPort")] public int? PublicPort { get; private set; } /// - /// Gets the publicly accessibly port of the SignalR service which is + /// Gets the publicly accessible port of the SignalR service which is /// designed for customer server side usage. /// [JsonProperty(PropertyName = "properties.serverPort")] @@ -153,6 +180,16 @@ public virtual void Validate() { Sku.Validate(); } + if (Features != null) + { + foreach (var element in Features) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRUsageName.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRUsageName.cs index d401ecf81687..6330d3765151 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRUsageName.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRUsageName.cs @@ -29,7 +29,7 @@ public SignalRUsageName() /// /// Initializes a new instance of the SignalRUsageName class. /// - /// The indentifier of the usage. + /// The identifier of the usage. /// Localized name of the usage. public SignalRUsageName(string value = default(string), string localizedValue = default(string)) { @@ -44,7 +44,7 @@ public SignalRUsageName() partial void CustomInit(); /// - /// Gets or sets the indentifier of the usage. + /// Gets or sets the identifier of the usage. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Models/TrackedResource.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Models/TrackedResource.cs index 2829818e3e02..84e63367c1bb 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Models/TrackedResource.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Models/TrackedResource.cs @@ -33,7 +33,7 @@ public TrackedResource() /// /// Fully qualified resource Id for the /// resource. - /// The name of the resouce. + /// The name of the resource. /// The type of the service - e.g. /// "Microsoft.SignalRService/SignalR" /// The GEO location of the SignalR service. diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/Operations.cs b/src/SDKs/SignalR/Management.SignalR/Generated/Operations.cs index 79d9c4c56501..d6004b5c65e0 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/Operations.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/Operations.cs @@ -66,11 +66,21 @@ internal Operations(SignalRManagementClient client) /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/SdkInfo_SignalRManagementClient.cs b/src/SDKs/SignalR/Management.SignalR/Generated/SdkInfo_SignalRManagementClient.cs index 7bc991a59442..f5c6c0579e28 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/SdkInfo_SignalRManagementClient.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/SdkInfo_SignalRManagementClient.cs @@ -19,9 +19,9 @@ public static IEnumerable> ApiInfo_SignalRManageme { return new Tuple[] { - new Tuple("SignalRService", "Operations", "2018-03-01-preview"), - new Tuple("SignalRService", "SignalR", "2018-03-01-preview"), - new Tuple("SignalRService", "Usages", "2018-03-01-preview"), + new Tuple("SignalRService", "Operations", "2018-10-01"), + new Tuple("SignalRService", "SignalR", "2018-10-01"), + new Tuple("SignalRService", "Usages", "2018-10-01"), }.AsEnumerable(); } } diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/SignalRManagementClient.cs b/src/SDKs/SignalR/Management.SignalR/Generated/SignalRManagementClient.cs index 1482ae8bdc65..1c27a085e4f1 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/SignalRManagementClient.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/SignalRManagementClient.cs @@ -336,7 +336,7 @@ private void Initialize() SignalR = new SignalROperations(this); Usages = new UsagesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-03-01-preview"; + ApiVersion = "2018-10-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperations.cs b/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperations.cs index 4b6853b161e6..48ba52176c31 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperations.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperations.cs @@ -90,6 +90,10 @@ internal SignalROperations(SignalRManagementClient client) { parameters.Validate(); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -273,6 +277,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -451,6 +459,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -638,6 +650,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -858,6 +874,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -884,7 +904,7 @@ internal SignalROperations(SignalRManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -1093,6 +1113,29 @@ internal SignalROperations(SignalRManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Operation to restart a SignalR service. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot /// be regenerated at the same time. @@ -1130,6 +1173,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task> BeginRegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string resourceName, RegenerateKeyParameters parameters = default(RegenerateKeyParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1337,6 +1384,10 @@ internal SignalROperations(SignalRManagementClient client) { parameters.Validate(); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1364,7 +1415,7 @@ internal SignalROperations(SignalRManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -1534,6 +1585,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1560,7 +1615,7 @@ internal SignalROperations(SignalRManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -1712,6 +1767,10 @@ internal SignalROperations(SignalRManagementClient client) /// public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, SignalRUpdateParameters parameters = default(SignalRUpdateParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1739,7 +1798,7 @@ internal SignalROperations(SignalRManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -1879,6 +1938,182 @@ internal SignalROperations(SignalRManagementClient client) return _result; } + /// + /// Operation to restart a SignalR service. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Handles requests to list all resources in a subscription. /// diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperationsExtensions.cs b/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperationsExtensions.cs index 80a7c506b70a..b063e149a269 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperationsExtensions.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/SignalROperationsExtensions.cs @@ -394,6 +394,45 @@ public static void Delete(this ISignalROperations operations, string resourceGro } } + /// + /// Operation to restart a SignalR service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// 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 name of the SignalR resource. + /// + public static void Restart(this ISignalROperations operations, string resourceGroupName, string resourceName) + { + operations.RestartAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Operation to restart a SignalR service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this ISignalROperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot /// be regenerated at the same time. @@ -579,6 +618,45 @@ public static void BeginDelete(this ISignalROperations operations, string resour } } + /// + /// Operation to restart a SignalR service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// 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 name of the SignalR resource. + /// + public static void BeginRestart(this ISignalROperations operations, string resourceGroupName, string resourceName) + { + operations.BeginRestartAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Operation to restart a SignalR service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// 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 name of the SignalR resource. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestartAsync(this ISignalROperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Handles requests to list all resources in a subscription. /// diff --git a/src/SDKs/SignalR/Management.SignalR/Generated/UsagesOperations.cs b/src/SDKs/SignalR/Management.SignalR/Generated/UsagesOperations.cs index 8f7c3fcddc2f..d380d572d05b 100644 --- a/src/SDKs/SignalR/Management.SignalR/Generated/UsagesOperations.cs +++ b/src/SDKs/SignalR/Management.SignalR/Generated/UsagesOperations.cs @@ -83,6 +83,10 @@ internal UsagesOperations(SignalRManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");