コード例 #1
0
 /// <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 <DomainAvailability> 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);
     }
 }
コード例 #2
0
        /// <summary>
        /// Get Cognitive Services Account Kinds.
        /// </summary>
        /// <param name="client">The ICognitiveServicesManagementClient instance.</param>
        /// <param name="location">The location as filter, set to null to ignore.</param>
        /// <returns>A set of available Kinds.</returns>
        private static HashSet <string> GetAccountKinds(ICognitiveServicesManagementClient client, string location = null)
        {
            var resourceSkuKindList = client.ResourceSkus.List().Where(resourceSku => (string.IsNullOrWhiteSpace(location) || resourceSku.Locations.Any(x => string.Compare(x, location, StringComparison.OrdinalIgnoreCase) == 0))).Select(x => x.Kind).ToList();

            return(new HashSet <string>(resourceSkuKindList));
        }
コード例 #3
0
 public CognitiveServicesManagementClientWrapper(ICognitiveServicesManagementClient resourceManagementClient)
 {
     CognitiveServicesManagementClient = resourceManagementClient;
 }
コード例 #4
0
 public CognitiveServicesManagementClientWrapper(ICognitiveServicesManagementClient resourceManagementClient)
 {
     CognitiveServicesManagementClient = resourceManagementClient;
 }
コード例 #5
0
 /// <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 DomainAvailability CheckDomainAvailability(this ICognitiveServicesManagementClient operations, string subdomainName, string type)
 {
     return(operations.CheckDomainAvailabilityAsync(subdomainName, type).GetAwaiter().GetResult());
 }
コード例 #6
0
 /// <summary>
 /// Check available SKUs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='skus'>
 /// The SKU of the resource.
 /// </param>
 /// <param name='kind'>
 /// The Kind of the resource.
 /// </param>
 /// <param name='type'>
 /// The Type of the resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SkuAvailabilityListResult> CheckSkuAvailabilityAsync(this ICognitiveServicesManagementClient operations, string location, IList <string> skus, string kind, string type, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckSkuAvailabilityWithHttpMessagesAsync(location, skus, kind, type, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #7
0
 /// <summary>
 /// Check available SKUs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Resource location.
 /// </param>
 /// <param name='skus'>
 /// The SKU of the resource.
 /// </param>
 /// <param name='kind'>
 /// The Kind of the resource.
 /// </param>
 /// <param name='type'>
 /// The Type of the resource.
 /// </param>
 public static SkuAvailabilityListResult CheckSkuAvailability(this ICognitiveServicesManagementClient operations, string location, IList <string> skus, string kind, string type)
 {
     return(operations.CheckSkuAvailabilityAsync(location, skus, kind, type).GetAwaiter().GetResult());
 }