Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
import * as operations from "./operations";
import { CognitiveServicesManagementClientContext } from "./cognitiveServicesManagementClientContext";

Expand All @@ -35,9 +36,71 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien
this.operations = new operations.Operations(this);
this.checkSkuAvailability = new operations.CheckSkuAvailability(this);
}

/**
* Check whether a domain is available.
* @param subdomainName The subdomain name to use.
* @param type The Type of the resource.
* @param [options] The optional parameters
* @returns Promise<Models.CheckDomainAvailabilityResponse>
*/
checkDomainAvailability(subdomainName: string, type: string, options?: msRest.RequestOptionsBase): Promise<Models.CheckDomainAvailabilityResponse>;
/**
* @param subdomainName The subdomain name to use.
* @param type The Type of the resource.
* @param callback The callback
*/
checkDomainAvailability(subdomainName: string, type: string, callback: msRest.ServiceCallback<Models.CheckDomainAvailabilityResult>): void;
/**
* @param subdomainName The subdomain name to use.
* @param type The Type of the resource.
* @param options The optional parameters
* @param callback The callback
*/
checkDomainAvailability(subdomainName: string, type: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CheckDomainAvailabilityResult>): void;
checkDomainAvailability(subdomainName: string, type: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CheckDomainAvailabilityResult>, callback?: msRest.ServiceCallback<Models.CheckDomainAvailabilityResult>): Promise<Models.CheckDomainAvailabilityResponse> {
return this.sendOperationRequest(
{
subdomainName,
type,
options
},
checkDomainAvailabilityOperationSpec,
callback) as Promise<Models.CheckDomainAvailabilityResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const checkDomainAvailabilityOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "providers/Microsoft.CognitiveServices/checkDomainAvailability",
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
requestBody: {
parameterPath: {
subdomainName: "subdomainName",
type: "type"
},
mapper: {
...Mappers.CheckDomainAvailabilityParameter,
required: true
}
},
responses: {
200: {
bodyMapper: Mappers.CheckDomainAvailabilityResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

export {
CognitiveServicesManagementClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ export {
CognitiveServicesResourceAndSku,
ErrorBody,
ErrorModel,
IpRule,
MetricName,
NetworkRuleSet,
RegenerateKeyParameters,
Sku,
Usage,
UsagesResult
UsagesResult,
VirtualNetworkRule
} from "../models/mappers";
130 changes: 130 additions & 0 deletions sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,60 @@ export interface CognitiveServicesAccountUpdateParameters {
properties?: any;
}

/**
* A rule governing the accessibility from a specific ip address or ip range.
*/
export interface IpRule {
/**
* An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or
* '124.56.78.0/24' (all addresses that start with 124.56.78).
*/
value: string;
}

/**
* A rule governing the accessibility from a specific virtual network.
*/
export interface VirtualNetworkRule {
/**
* Full resource id of a vnet subnet, such as
* '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'.
*/
id: string;
/**
* Gets the state of virtual network rule.
*/
state?: string;
/**
* Ignore missing vnet service endpoint or not.
*/
ignoreMissingVnetServiceEndpoint?: boolean;
}

/**
* A set of rules governing the network accessibility.
*/
export interface NetworkRuleSet {
/**
* Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not
* specified the default is 'AzureServices'. Possible values include: 'AzureServices', 'None'
*/
bypass?: NetworkRuleBypassOptions;
/**
* The default action when no rule from ipRules and from virtualNetworkRules match. This is only
* used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny'
*/
defaultAction?: NetworkRuleAction;
/**
* The list of IP address rules.
*/
ipRules?: IpRule[];
/**
* The list of virtual network rules.
*/
virtualNetworkRules?: VirtualNetworkRule[];
}

/**
* Cognitive Services Account is an Azure resource representing the provisioned account, its type,
* location and SKU.
Expand Down Expand Up @@ -126,6 +180,10 @@ export interface CognitiveServicesAccount extends BaseResource {
* Optional subdomain name used for token-based authentication.
*/
customSubDomainName?: string;
/**
* A collection of rules governing the accessibility from specific network locations.
*/
networkAcls?: NetworkRuleSet;
/**
* The SKU of Cognitive Services account.
*/
Expand Down Expand Up @@ -387,6 +445,42 @@ export interface CheckSkuAvailabilityResultList {
value?: CheckSkuAvailabilityResult[];
}

/**
* Check Domain availability parameter.
*/
export interface CheckDomainAvailabilityParameter {
/**
* The subdomain name to use.
*/
subdomainName: string;
/**
* The Type of the resource.
*/
type: string;
}

/**
* Check Domain availability result.
*/
export interface CheckDomainAvailabilityResult {
/**
* Indicates the given SKU is available or not.
*/
isSubdomainAvailable?: boolean;
/**
* Reason why the SKU is not available.
*/
reason?: string;
/**
* The subdomain name to use.
*/
subdomainName?: string;
/**
* The Type of the resource.
*/
type?: string;
}

/**
* An interface representing ResourceSkuRestrictionInfo.
*/
Expand Down Expand Up @@ -558,6 +652,22 @@ export type SkuTier = 'Free' | 'Standard' | 'Premium';
*/
export type ProvisioningState = 'Creating' | 'ResolvingDNS' | 'Moving' | 'Deleting' | 'Succeeded' | 'Failed';

/**
* Defines values for NetworkRuleBypassOptions.
* Possible values include: 'AzureServices', 'None'
* @readonly
* @enum {string}
*/
export type NetworkRuleBypassOptions = 'AzureServices' | 'None';

/**
* Defines values for NetworkRuleAction.
* Possible values include: 'Allow', 'Deny'
* @readonly
* @enum {string}
*/
export type NetworkRuleAction = 'Allow' | 'Deny';

/**
* Defines values for KeyName.
* Possible values include: 'Key1', 'Key2'
Expand Down Expand Up @@ -918,3 +1028,23 @@ export type CheckSkuAvailabilityListResponse = CheckSkuAvailabilityResultList &
parsedBody: CheckSkuAvailabilityResultList;
};
};

/**
* Contains response data for the checkDomainAvailability operation.
*/
export type CheckDomainAvailabilityResponse = CheckDomainAvailabilityResult & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;

/**
* The response body as parsed JSON or XML
*/
parsedBody: CheckDomainAvailabilityResult;
};
};
Loading