Skip to content

Commit

Permalink
.NET SDK Resource Provider:'SignalR'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5661'
REST Spec PR Author 'juniwang'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 16, 2019
1 parent db5d0cc commit 5ebc936
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/SDKs/SignalR/AzSdk.RP.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--This file and it's contents are updated at build time moving or editing might result in build failure. Take due deligence while editing this file-->
<PropertyGroup>
<AzureApiTag>SignalRService_2018-03-01-preview;</AzureApiTag>
<AzureApiTag>SignalRService_2018-10-01;</AzureApiTag>
<PackageTags>$(PackageTags);$(CommonTags);$(AzureApiTag);</PackageTags>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,30 @@ public partial interface ISignalROperations
/// </exception>
Task<AzureOperationResponse<SignalRResource>> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, SignalRUpdateParameters parameters = default(SignalRUpdateParameters), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Operation to restart a SignalR service.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
/// </param>
/// <param name='resourceName'>
/// The name of the SignalR resource.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> RestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Regenerate SignalR service access key. PrimaryKey and SecondaryKey
/// cannot be regenerated at the same time.
/// </summary>
Expand Down Expand Up @@ -376,6 +400,30 @@ public partial interface ISignalROperations
/// </exception>
Task<AzureOperationResponse<SignalRResource>> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, SignalRUpdateParameters parameters = default(SignalRUpdateParameters), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Operation to restart a SignalR service.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group that contains the resource. You can
/// obtain this value from the Azure Resource Manager API or the
/// portal.
/// </param>
/// <param name='resourceName'>
/// The name of the SignalR resource.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Handles requests to list all resources in a subscription.
/// </summary>
/// <param name='nextPageLink'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Resource()
/// </summary>
/// <param name="id">Fully qualified resource Id for the
/// resource.</param>
/// <param name="name">The name of the resouce.</param>
/// <param name="name">The name of the resource.</param>
/// <param name="type">The type of the service - e.g.
/// "Microsoft.SignalRService/SignalR"</param>
public Resource(string id = default(string), string name = default(string), string type = default(string))
Expand All @@ -56,7 +56,7 @@ public Resource()
public string Id { get; private set; }

/// <summary>
/// Gets the name of the resouce.
/// Gets the name of the resource.
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; private set; }
Expand Down
61 changes: 31 additions & 30 deletions src/SDKs/SignalR/Management.SignalR/Generated/Models/ResourceSku.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.SignalR.Models
using System.Linq;

/// <summary>
/// The billing information of the resource.(e.g. basic vs. standard)
/// The billing information of the SignalR resource.
/// </summary>
public partial class ResourceSku
{
Expand All @@ -30,22 +30,22 @@ public ResourceSku()
/// <summary>
/// Initializes a new instance of the ResourceSku class.
/// </summary>
/// <param name="name">The name of the SKU. This is typically a letter
/// + number code, such as A0 or P3. Required (if sku is
/// specified)</param>
/// <param name="tier">Optional tier of this particular SKU. `Basic` is
/// deprecated, use `Standard` instead for Basic tier. Possible values
/// <param name="name">The name of the SKU. Required.
///
/// Allowed values: Standard_S1, Free_F1</param>
/// <param name="tier">Optional tier of this particular SKU. 'Standard'
/// or 'Free'.
///
/// `Basic` is deprecated, use `Standard` instead. Possible values
/// include: 'Free', 'Basic', 'Standard', 'Premium'</param>
/// <param name="size">Optional, string. When the name field is the
/// combination of tier and some other value, this would be the
/// standalone code.</param>
/// <param name="family">Optional, string. If the service has different
/// generations of hardware, for the same SKU, then that can be
/// captured here.</param>
/// <param name="capacity">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.</param>
/// <param name="size">Optional string. For future use.</param>
/// <param name="family">Optional string. For future use.</param>
/// <param name="capacity">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</param>
public ResourceSku(string name, string tier = default(string), string size = default(string), string family = default(string), int? capacity = default(int?))
{
Name = name;
Expand All @@ -62,41 +62,42 @@ public ResourceSku()
partial void CustomInit();

/// <summary>
/// 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
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }

/// <summary>
/// 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'
/// </summary>
[JsonProperty(PropertyName = "tier")]
public string Tier { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "size")]
public string Size { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "family")]
public string Family { get; set; }

/// <summary>
/// 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
/// </summary>
[JsonProperty(PropertyName = "capacity")]
public int? Capacity { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
namespace Microsoft.Azure.Management.SignalR.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
Expand All @@ -35,9 +37,20 @@ public SignalRCreateOrUpdateProperties()
/// service. Retained for future use.
/// The hostname will be of format:
/// &amp;lt;hostNamePrefix&amp;gt;.service.signalr.net.</param>
public SignalRCreateOrUpdateProperties(string hostNamePrefix = default(string))
/// <param name="features">List of SignalR featureFlags. e.g.
/// ServiceMode.
///
/// When updating featureFlags, if certain featureFlag is not included
/// in parameters, SignalR service will remain it unchanged.
/// And when you GET a SignalR resource, the response will include only
/// those featureFlags explicitly set by you. For other featureFlags,
/// SignalR service will use its globally default value. Note that,
/// default value doesn't mean "false". It varies in terms of different
/// FeatureFlags.</param>
public SignalRCreateOrUpdateProperties(string hostNamePrefix = default(string), IList<SignalRFeature> features = default(IList<SignalRFeature>))
{
HostNamePrefix = hostNamePrefix;
Features = features;
CustomInit();
}

Expand All @@ -55,5 +68,19 @@ public SignalRCreateOrUpdateProperties()
[JsonProperty(PropertyName = "hostNamePrefix")]
public string HostNamePrefix { get; set; }

/// <summary>
/// Gets or sets list of SignalR featureFlags. e.g. ServiceMode.
///
/// When updating featureFlags, if certain featureFlag is not included
/// in parameters, SignalR service will remain it unchanged.
/// And when you GET a SignalR resource, the response will include only
/// those featureFlags explicitly set by you. For other featureFlags,
/// SignalR service will use its globally default value. Note that,
/// default value doesn't mean "false". It varies in terms of different
/// FeatureFlags.
/// </summary>
[JsonProperty(PropertyName = "features")]
public IList<SignalRFeature> Features { get; set; }

}
}
106 changes: 106 additions & 0 deletions src/SDKs/SignalR/Management.SignalR/Generated/Models/SignalRFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.SignalR.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Feature of a SignalR resource, which controls the SignalR runtime
/// behavior.
/// </summary>
public partial class SignalRFeature
{
/// <summary>
/// Initializes a new instance of the SignalRFeature class.
/// </summary>
public SignalRFeature()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the SignalRFeature class.
/// </summary>
/// <param name="value">Value of the feature flag. See Azure SignalR
/// service document
/// https://docs.microsoft.com/en-us/azure/azure-signalr/ for allowed
/// values.</param>
/// <param name="properties">Optional properties related to this
/// feature.</param>
public SignalRFeature(string value, IDictionary<string, string> properties = default(IDictionary<string, string>))
{
Value = value;
Properties = properties;
CustomInit();
}
/// <summary>
/// Static constructor for SignalRFeature class.
/// </summary>
static SignalRFeature()
{
Flag = "ServiceMode";
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }

/// <summary>
/// Gets or sets optional properties related to this feature.
/// </summary>
[JsonProperty(PropertyName = "properties")]
public IDictionary<string, string> Properties { get; set; }

/// <summary>
/// Name of the feature. Required.
/// </summary>
[JsonProperty(PropertyName = "flag")]
public static string Flag { get; private set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
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);
}
}
}
}
}
Loading

0 comments on commit 5ebc936

Please sign in to comment.