forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AutoPR Microsoft.Azure.Management.CognitiveServices] Fix check domai…
…n path (#147) * Generated from cce264ba7c751076c58518d67e19b9e469832c0c (#136) Update ListLegacyPeerings.json * Generated from 111d1bc1666fe89cebb960135cf2f5336bbcb35a Removed rogue file
- Loading branch information
1 parent
d92e3c5
commit 1c5d546
Showing
7 changed files
with
451 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...Management.CognitiveServices/src/Generated/CognitiveServicesManagementClientExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// <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.CognitiveServices | ||
{ | ||
using Microsoft.Rest; | ||
using Microsoft.Rest.Azure; | ||
using Models; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// Extension methods for CognitiveServicesManagementClient. | ||
/// </summary> | ||
public static partial class CognitiveServicesManagementClientExtensions | ||
{ | ||
/// <summary> | ||
/// Check whether a domain is available. | ||
/// </summary> | ||
/// <param name='operations'> | ||
/// The operations group for this extension method. | ||
/// </param> | ||
/// <param name='subdomainName'> | ||
/// The subdomain name to use. | ||
/// </param> | ||
/// <param name='type'> | ||
/// The Type of the resource. | ||
/// </param> | ||
public static CheckDomainAvailabilityResult CheckDomainAvailability(this ICognitiveServicesManagementClient operations, string subdomainName, string type) | ||
{ | ||
return operations.CheckDomainAvailabilityAsync(subdomainName, type).GetAwaiter().GetResult(); | ||
} | ||
|
||
/// <summary> | ||
/// Check whether a domain is available. | ||
/// </summary> | ||
/// <param name='operations'> | ||
/// The operations group for this extension method. | ||
/// </param> | ||
/// <param name='subdomainName'> | ||
/// The subdomain name to use. | ||
/// </param> | ||
/// <param name='type'> | ||
/// The Type of the resource. | ||
/// </param> | ||
/// <param name='cancellationToken'> | ||
/// The cancellation token. | ||
/// </param> | ||
public static async Task<CheckDomainAvailabilityResult> CheckDomainAvailabilityAsync(this ICognitiveServicesManagementClient operations, string subdomainName, string type, CancellationToken cancellationToken = default(CancellationToken)) | ||
{ | ||
using (var _result = await operations.CheckDomainAvailabilityWithHttpMessagesAsync(subdomainName, type, null, cancellationToken).ConfigureAwait(false)) | ||
{ | ||
return _result.Body; | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...ure.Management.CognitiveServices/src/Generated/Models/CheckDomainAvailabilityParameter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// <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.CognitiveServices.Models | ||
{ | ||
using Microsoft.Rest; | ||
using Newtonsoft.Json; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Check Domain availability parameter. | ||
/// </summary> | ||
public partial class CheckDomainAvailabilityParameter | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the CheckDomainAvailabilityParameter | ||
/// class. | ||
/// </summary> | ||
public CheckDomainAvailabilityParameter() | ||
{ | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the CheckDomainAvailabilityParameter | ||
/// class. | ||
/// </summary> | ||
/// <param name="subdomainName">The subdomain name to use.</param> | ||
/// <param name="type">The Type of the resource.</param> | ||
public CheckDomainAvailabilityParameter(string subdomainName, string type) | ||
{ | ||
SubdomainName = subdomainName; | ||
Type = type; | ||
CustomInit(); | ||
} | ||
|
||
/// <summary> | ||
/// An initialization method that performs custom operations like setting defaults | ||
/// </summary> | ||
partial void CustomInit(); | ||
|
||
/// <summary> | ||
/// Gets or sets the subdomain name to use. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "subdomainName")] | ||
public string SubdomainName { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Type of the resource. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "type")] | ||
public string Type { get; set; } | ||
|
||
/// <summary> | ||
/// Validate the object. | ||
/// </summary> | ||
/// <exception cref="ValidationException"> | ||
/// Thrown if validation fails | ||
/// </exception> | ||
public virtual void Validate() | ||
{ | ||
if (SubdomainName == null) | ||
{ | ||
throw new ValidationException(ValidationRules.CannotBeNull, "SubdomainName"); | ||
} | ||
if (Type == null) | ||
{ | ||
throw new ValidationException(ValidationRules.CannotBeNull, "Type"); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.