diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts index 8afd112e353b..7822fa149d26 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts @@ -21,11 +21,13 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien accounts: operations.Accounts; resourceSkus: operations.ResourceSkus; operations: operations.Operations; + privateEndpointConnections: operations.PrivateEndpointConnections; + privateLinkResources: operations.PrivateLinkResources; /** * Initializes a new instance of the CognitiveServicesManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Azure Subscription ID. + * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.CognitiveServicesManagementClientOptions) { @@ -33,6 +35,8 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien this.accounts = new operations.Accounts(this); this.resourceSkus = new operations.ResourceSkus(this); this.operations = new operations.Operations(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); + this.privateLinkResources = new operations.PrivateLinkResources(this); } /** diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts index 828cb43f0e0e..9831be91f183 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts @@ -23,7 +23,7 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS /** * Initializes a new instance of the CognitiveServicesManagementClient class. * @param credentials Credentials needed for the client to connect to Azure. - * @param subscriptionId Azure Subscription ID. + * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.CognitiveServicesManagementClientOptions) { diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/accountsMappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/accountsMappers.ts index ac1c9768b282..3967c44a4a82 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/accountsMappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/accountsMappers.ts @@ -7,6 +7,7 @@ */ export { + AzureEntityResource, BaseResource, CognitiveServicesAccount, CognitiveServicesAccountApiProperties, @@ -23,8 +24,18 @@ export { KeyVaultProperties, MetricName, NetworkRuleSet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkResource, + PrivateLinkResourceProperties, + PrivateLinkServiceConnectionState, + ProxyResource, RegenerateKeyParameters, + Resource, Sku, + SkuCapability, + TrackedResource, Usage, UsagesResult, UserAssignedIdentity, diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts index 150f51cd9164..83037b1bc0fb 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts @@ -27,6 +27,20 @@ export interface Sku { readonly tier?: SkuTier; } +/** + * SkuCapability indicates the capability of a certain feature. + */ +export interface SkuCapability { + /** + * The name of the SkuCapability. + */ + name?: string; + /** + * The value of the SkuCapability. + */ + value?: string; +} + /** * A rule governing the accessibility from a specific ip address or ip range. */ @@ -119,6 +133,89 @@ export interface UserOwnedStorage { resourceId?: string; } +/** + * The Private Endpoint resource. + */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * A collection of information about the state of the connection between service consumer and + * provider. + */ +export interface PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + */ + status?: PrivateEndpointServiceConnectionStatus; + /** + * The reason for approval/rejection of the connection. + */ + description?: string; + /** + * A message indicating if changes on the service provider require any updates on the consumer. + */ + actionRequired?: string; +} + +/** + * Properties of the PrivateEndpointConnectProperties. + */ +export interface PrivateEndpointConnectionProperties { + /** + * The resource of private end point. + */ + privateEndpoint?: PrivateEndpoint; + /** + * A collection of information about the state of the connection between service consumer and + * provider. + */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** + * The private link resource group ids. + */ + groupIds?: string[]; +} + +/** + * An interface representing Resource. + */ +export interface Resource extends BaseResource { + /** + * Fully qualified resource Id for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The name of the resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * The Private Endpoint Connection resource. + */ +export interface PrivateEndpointConnection extends Resource { + /** + * Resource properties. + */ + properties?: PrivateEndpointConnectionProperties; +} + /** * The api properties for special APIs. */ @@ -162,6 +259,12 @@ export interface CognitiveServicesAccountProperties { * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly internalId?: string; + /** + * Gets the capabilities of the cognitive services account. Each item indicates the capability of + * a specific feature. The values are read-only and for reference only. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly capabilities?: SkuCapability[]; /** * Optional subdomain name used for token-based authentication. */ @@ -178,6 +281,15 @@ export interface CognitiveServicesAccountProperties { * The storage accounts for this resource. */ userOwnedStorage?: UserOwnedStorage[]; + /** + * The private endpoint connection associated with the Cognitive Services account. + */ + privateEndpointConnections?: PrivateEndpointConnection[]; + /** + * Whether or not public endpoint access is allowed for this account. Value is optional but if + * passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + */ + publicNetworkAccess?: PublicNetworkAccess; /** * The api properties for special APIs. */ @@ -638,6 +750,83 @@ export interface ResourceSku { readonly restrictions?: ResourceSkuRestrictions[]; } +/** + * Properties of a private link resource. + */ +export interface PrivateLinkResourceProperties { + /** + * The private link resource group id. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly groupId?: string; + /** + * The private link resource display name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly displayName?: string; + /** + * The private link resource required member names. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly requiredMembers?: string[]; + /** + * The private link resource Private link DNS zone name. + */ + requiredZoneNames?: string[]; +} + +/** + * A private link resource + */ +export interface PrivateLinkResource extends Resource { + /** + * Resource properties. + */ + properties?: PrivateLinkResourceProperties; +} + +/** + * A list of private link resources + */ +export interface PrivateLinkResourceListResult { + /** + * Array of private link resources + */ + value?: PrivateLinkResource[]; +} + +/** + * The resource model definition for a ARM proxy resource. It will have everything other than + * required location and tags + */ +export interface ProxyResource extends Resource { +} + +/** + * The resource model definition for a ARM tracked top level resource + */ +export interface TrackedResource extends Resource { + /** + * Resource tags. + */ + tags?: { [propertyName: string]: string }; + /** + * The geo-location where the resource lives + */ + location: string; +} + +/** + * The resource model definition for a Azure Resource Manager resource with an etag. + */ +export interface AzureEntityResource extends Resource { + /** + * Resource Etag. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly etag?: string; +} + /** * Optional Parameters. */ @@ -724,6 +913,22 @@ export type NetworkRuleAction = 'Allow' | 'Deny'; */ export type KeySource = 'Microsoft.CognitiveServices' | 'Microsoft.KeyVault'; +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; + +/** + * Defines values for PublicNetworkAccess. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type PublicNetworkAccess = 'Enabled' | 'Disabled'; + /** * Defines values for IdentityType. * Possible values include: 'None', 'SystemAssigned', 'UserAssigned' @@ -1112,3 +1317,63 @@ export type CheckDomainAvailabilityResponse = CheckDomainAvailabilityResult & { parsedBody: CheckDomainAvailabilityResult; }; }; + +/** + * Contains response data for the get operation. + */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointConnection & { + /** + * 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: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PrivateLinkResourcesListResponse = PrivateLinkResourceListResult & { + /** + * 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: PrivateLinkResourceListResult; + }; +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts index 5e26890f3fca..9971f695d414 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts @@ -41,6 +41,28 @@ export const Sku: msRest.CompositeMapper = { } }; +export const SkuCapability: msRest.CompositeMapper = { + serializedName: "SkuCapability", + type: { + name: "Composite", + className: "SkuCapability", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + export const IpRule: msRest.CompositeMapper = { serializedName: "IpRule", type: { @@ -195,6 +217,136 @@ export const UserOwnedStorage: msRest.CompositeMapper = { } }; +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "PrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionRequired: { + serializedName: "actionRequired", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionProperties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + modelProperties: { + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + required: true, + serializedName: "privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + groupIds: { + serializedName: "groupIds", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties" + } + } + } + } +}; + export const CognitiveServicesAccountApiProperties: msRest.CompositeMapper = { serializedName: "CognitiveServicesAccountApiProperties", type: { @@ -264,6 +416,19 @@ export const CognitiveServicesAccountProperties: msRest.CompositeMapper = { name: "String" } }, + capabilities: { + readOnly: true, + serializedName: "capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SkuCapability" + } + } + } + }, customSubDomainName: { serializedName: "customSubDomainName", type: { @@ -296,6 +461,24 @@ export const CognitiveServicesAccountProperties: msRest.CompositeMapper = { } } }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + }, apiProperties: { serializedName: "apiProperties", type: { @@ -1069,6 +1252,151 @@ export const ResourceSku: msRest.CompositeMapper = { } }; +export const PrivateLinkResourceProperties: msRest.CompositeMapper = { + serializedName: "PrivateLinkResourceProperties", + type: { + name: "Composite", + className: "PrivateLinkResourceProperties", + modelProperties: { + groupId: { + readOnly: true, + serializedName: "groupId", + type: { + name: "String" + } + }, + displayName: { + readOnly: true, + serializedName: "displayName", + type: { + name: "String" + } + }, + requiredMembers: { + readOnly: true, + serializedName: "requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const PrivateLinkResource: msRest.CompositeMapper = { + serializedName: "PrivateLinkResource", + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...Resource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateLinkResourceProperties" + } + } + } + } +}; + +export const PrivateLinkResourceListResult: msRest.CompositeMapper = { + serializedName: "PrivateLinkResourceListResult", + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties + } + } +}; + +export const TrackedResource: msRest.CompositeMapper = { + serializedName: "TrackedResource", + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const AzureEntityResource: msRest.CompositeMapper = { + serializedName: "AzureEntityResource", + type: { + name: "Composite", + className: "AzureEntityResource", + modelProperties: { + ...Resource.type.modelProperties, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + export const CognitiveServicesAccountListResult: msRest.CompositeMapper = { serializedName: "CognitiveServicesAccountListResult", type: { diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts index 6d8020a2396a..7865e981bfd7 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts @@ -40,6 +40,9 @@ export const apiVersion: msRest.OperationQueryParameter = { mapper: { required: true, serializedName: "api-version", + constraints: { + MinLength: 1 + }, type: { name: "String" } @@ -78,11 +81,26 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { required: true, serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, type: { name: "String" } @@ -93,6 +111,9 @@ export const subscriptionId: msRest.OperationURLParameter = { mapper: { required: true, serializedName: "subscriptionId", + constraints: { + MinLength: 1 + }, type: { name: "String" } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateEndpointConnectionsMappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..a7458b249d23 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +export { + AzureEntityResource, + BaseResource, + CloudError, + CognitiveServicesAccount, + CognitiveServicesAccountApiProperties, + CognitiveServicesAccountProperties, + Encryption, + Identity, + IpRule, + KeyVaultProperties, + NetworkRuleSet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkResource, + PrivateLinkResourceProperties, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + Sku, + SkuCapability, + TrackedResource, + UserAssignedIdentity, + UserOwnedStorage, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateLinkResourcesMappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateLinkResourcesMappers.ts new file mode 100644 index 000000000000..9c23d80a285a --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/privateLinkResourcesMappers.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +export { + AzureEntityResource, + BaseResource, + CloudError, + CognitiveServicesAccount, + CognitiveServicesAccountApiProperties, + CognitiveServicesAccountProperties, + Encryption, + Identity, + IpRule, + KeyVaultProperties, + NetworkRuleSet, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkResource, + PrivateLinkResourceListResult, + PrivateLinkResourceProperties, + PrivateLinkServiceConnectionState, + ProxyResource, + Resource, + Sku, + SkuCapability, + TrackedResource, + UserAssignedIdentity, + UserOwnedStorage, + VirtualNetworkRule +} from "../models/mappers"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts index ecc6be333591..a0b41d594d5e 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts @@ -29,7 +29,7 @@ export class Accounts { /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the * keys for developer to access intelligent APIs. It's also the resource type for billing. - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param [options] The optional parameters @@ -37,14 +37,14 @@ export class Accounts { */ create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param callback The callback */ create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param options The optional parameters @@ -65,7 +65,7 @@ export class Accounts { /** * Updates a Cognitive Services account - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param [options] The optional parameters @@ -73,14 +73,14 @@ export class Accounts { */ update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param callback The callback */ update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param account The parameters to provide for the created account. * @param options The optional parameters @@ -101,20 +101,20 @@ export class Accounts { /** * Deletes a Cognitive Services account from the resource group. - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param [options] The optional parameters * @returns Promise */ deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ deleteMethod(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback @@ -133,20 +133,20 @@ export class Accounts { /** * Returns a Cognitive Services account specified by the parameters. - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param [options] The optional parameters * @returns Promise */ getProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ getProperties(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback @@ -165,18 +165,18 @@ export class Accounts { /** * Returns all the resources of a particular type belonging to a resource group - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param [options] The optional parameters * @returns Promise */ listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param callback The callback */ listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The optional parameters * @param callback The callback */ @@ -217,20 +217,20 @@ export class Accounts { /** * Lists the account keys for the specified Cognitive Services account. - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param [options] The optional parameters * @returns Promise */ listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ listKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback @@ -249,7 +249,7 @@ export class Accounts { /** * Regenerates the specified account key for the specified Cognitive Services account. - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @param [options] The optional parameters @@ -257,14 +257,14 @@ export class Accounts { */ regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @param callback The callback */ regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @param options The optional parameters @@ -285,20 +285,20 @@ export class Accounts { /** * List available SKUs for the requested Cognitive Services account - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param [options] The optional parameters * @returns Promise */ listSkus(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ listSkus(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback @@ -317,20 +317,20 @@ export class Accounts { /** * Get usages for the requested Cognitive Services account - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param [options] The optional parameters * @returns Promise */ getUsages(resourceGroupName: string, accountName: string, options?: Models.AccountsGetUsagesOptionalParams): Promise; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ getUsages(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** - * @param resourceGroupName The name of the resource group within the user's subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts index ab8ff4425b47..a463035550cd 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/index.ts @@ -11,3 +11,5 @@ export * from "./accounts"; export * from "./resourceSkus"; export * from "./operations"; +export * from "./privateEndpointConnections"; +export * from "./privateLinkResources"; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..c6e04ad142eb --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts @@ -0,0 +1,237 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: CognitiveServicesManagementClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {CognitiveServicesManagementClientContext} client Reference to the service client. + */ + constructor(client: CognitiveServicesManagementClientContext) { + this.client = client; + } + + /** + * Gets the specified private endpoint connection associated with the Cognitive Services account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Update the state of specified private endpoint connection associated with the Cognitive Services + * account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param properties The private endpoint connection properties. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param properties The private endpoint connection properties. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param properties The private endpoint connection properties. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + properties, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified private endpoint connection associated with the Cognitive Services + * account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with + * the Cognitive Services Account + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + privateEndpointConnectionName, + options + }, + deleteMethodOperationSpec, + callback); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "properties", + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts new file mode 100644 index 000000000000..7c3043b2d1d7 --- /dev/null +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts @@ -0,0 +1,87 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateLinkResourcesMappers"; +import * as Parameters from "../models/parameters"; +import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext"; + +/** Class representing a PrivateLinkResources. */ +export class PrivateLinkResources { + private readonly client: CognitiveServicesManagementClientContext; + + /** + * Create a PrivateLinkResources. + * @param {CognitiveServicesManagementClientContext} client Reference to the service client. + */ + constructor(client: CognitiveServicesManagementClientContext) { + this.client = client; + } + + /** + * Gets the private link resources that need to be created for a Cognitive Services account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +};