Skip to content

Commit

Permalink
.NET SDK Resource Provider:'CognitiveServices'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5729'
REST Spec PR Author 'yangyuan'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 22, 2019
1 parent 4cf4631 commit f15eb9a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ internal AccountsOperations(CognitiveServicesManagementClient client)
/// have a key no greater than 128 characters and value no greater than 256
/// characters.
/// </param>
/// <param name='properties'>
/// Additional properties for Account. Only provided fileds will be updated.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -334,7 +337,7 @@ internal AccountsOperations(CognitiveServicesManagementClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<CognitiveServicesAccount>> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<CognitiveServicesAccount>> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), object properties = default(object), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
Expand Down Expand Up @@ -372,10 +375,11 @@ internal AccountsOperations(CognitiveServicesManagementClient client)
sku.Validate();
}
CognitiveServicesAccountUpdateParameters parameters = new CognitiveServicesAccountUpdateParameters();
if (sku != null || tags != null)
if (sku != null || tags != null || properties != null)
{
parameters.Sku = sku;
parameters.Tags = tags;
parameters.Properties = properties;
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ public static CognitiveServicesAccount Create(this IAccountsOperations operation
/// have a key no greater than 128 characters and value no greater than 256
/// characters.
/// </param>
public static CognitiveServicesAccount Update(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>))
/// <param name='properties'>
/// Additional properties for Account. Only provided fileds will be updated.
/// </param>
public static CognitiveServicesAccount Update(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), object properties = default(object))
{
return operations.UpdateAsync(resourceGroupName, accountName, sku, tags).GetAwaiter().GetResult();
return operations.UpdateAsync(resourceGroupName, accountName, sku, tags, properties).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -122,12 +125,15 @@ public static CognitiveServicesAccount Create(this IAccountsOperations operation
/// have a key no greater than 128 characters and value no greater than 256
/// characters.
/// </param>
/// <param name='properties'>
/// Additional properties for Account. Only provided fileds will be updated.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<CognitiveServicesAccount> UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<CognitiveServicesAccount> UpdateAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), object properties = default(object), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, sku, tags, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, sku, tags, properties, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public partial interface IAccountsOperations
/// a resource. Each tag must have a key no greater than 128 characters
/// and value no greater than 256 characters.
/// </param>
/// <param name='properties'>
/// Additional properties for Account. Only provided fileds will be
/// updated.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
Expand All @@ -87,7 +91,7 @@ public partial interface IAccountsOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<CognitiveServicesAccount>> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<CognitiveServicesAccount>> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), object properties = default(object), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Deletes a Cognitive Services account from the resource group.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public CognitiveServicesAccount()
/// 'Succeeded', 'Failed'</param>
/// <param name="endpoint">Endpoint of the created account.</param>
/// <param name="internalId">The internal identifier.</param>
/// <param name="customSubDomainName">Optional subdomain name used for
/// token-based authentication.</param>
/// <param name="sku">The SKU of Cognitive Services account.</param>
/// <param name="tags">Gets or sets a list of key value pairs that
/// describe the resource. These tags can be used in viewing and
Expand All @@ -55,7 +57,7 @@ public CognitiveServicesAccount()
/// greater than 128 characters and value no greater than 256
/// characters.</param>
/// <param name="type">Resource type</param>
public CognitiveServicesAccount(string etag = default(string), string id = default(string), string kind = default(string), string location = default(string), string name = default(string), string provisioningState = default(string), string endpoint = default(string), string internalId = default(string), Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), string type = default(string))
public CognitiveServicesAccount(string etag = default(string), string id = default(string), string kind = default(string), string location = default(string), string name = default(string), string provisioningState = default(string), string endpoint = default(string), string internalId = default(string), string customSubDomainName = default(string), Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), string type = default(string))
{
Etag = etag;
Id = id;
Expand All @@ -65,6 +67,7 @@ public CognitiveServicesAccount()
ProvisioningState = provisioningState;
Endpoint = endpoint;
InternalId = internalId;
CustomSubDomainName = customSubDomainName;
Sku = sku;
Tags = tags;
Type = type;
Expand Down Expand Up @@ -126,6 +129,13 @@ public CognitiveServicesAccount()
[JsonProperty(PropertyName = "properties.internalId")]
public string InternalId { get; set; }

/// <summary>
/// Gets or sets optional subdomain name used for token-based
/// authentication.
/// </summary>
[JsonProperty(PropertyName = "properties.customSubDomainName")]
public string CustomSubDomainName { get; set; }

/// <summary>
/// Gets or sets the SKU of Cognitive Services account.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ public CognitiveServicesAccountUpdateParameters()
/// tags can be provided for a resource. Each tag must have a key no
/// greater than 128 characters and value no greater than 256
/// characters.</param>
public CognitiveServicesAccountUpdateParameters(Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>))
/// <param name="properties">Additional properties for Account. Only
/// provided fileds will be updated.</param>
public CognitiveServicesAccountUpdateParameters(Sku sku = default(Sku), IDictionary<string, string> tags = default(IDictionary<string, string>), object properties = default(object))
{
Sku = sku;
Tags = tags;
Properties = properties;
CustomInit();
}

Expand All @@ -68,6 +71,13 @@ public CognitiveServicesAccountUpdateParameters()
[JsonProperty(PropertyName = "tags")]
public IDictionary<string, string> Tags { get; set; }

/// <summary>
/// Gets or sets additional properties for Account. Only provided
/// fileds will be updated.
/// </summary>
[JsonProperty(PropertyName = "properties")]
public object Properties { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,5 @@ public static IEnumerable<Tuple<string, string, string>> ApiInfo_CognitiveServic
}.AsEnumerable();
}
}
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283";
public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cognitiveservices/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Github\\azure-sdk-for-net\\src\\SDKs";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
public static readonly String GithubCommidId = "a5fd13fd813e416fc4500310537491482ad401b3";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
}
}

0 comments on commit f15eb9a

Please sign in to comment.