Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-cognitiveservices] [TestUnifiedPipeline] Swagger Correctness for Cognitive Services #232

Closed
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 @@ -37,7 +37,7 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
Expand All @@ -52,10 +52,10 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
78 changes: 67 additions & 11 deletions sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Sku {
name: string;
/**
* Gets the sku tier. This is based on the SKU name. Possible values include: 'Free', 'Standard',
* 'Premium'
* 'Premium', 'Enterprise'
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly tier?: SkuTier;
Expand Down Expand Up @@ -184,11 +184,12 @@ export interface PrivateEndpointConnectionProperties {
}

/**
* An interface representing Resource.
* Common fields that are returned in the response for all Azure Resource Manager resources
* @summary Resource
*/
export interface Resource extends BaseResource {
/**
* Fully qualified resource Id for the resource. Ex -
* 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.**
*/
Expand All @@ -199,8 +200,8 @@ export interface Resource extends BaseResource {
*/
readonly name?: string;
/**
* The type of the resource. Ex- Microsoft.Compute/virtualMachines or
* Microsoft.Storage/storageAccounts.
* The type of the resource. E.g. "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;
Expand Down Expand Up @@ -236,6 +237,22 @@ export interface CognitiveServicesAccountApiProperties {
* (Personalization Only) The storage account connection string.
*/
storageAccountConnectionString?: string;
/**
* (Metrics Advisor Only) The Azure AD Client Id (Application Id).
*/
aadClientId?: string;
/**
* (Metrics Advisor Only) The Azure AD Tenant Id.
*/
aadTenantId?: string;
/**
* (Metrics Advisor Only) The super user of Metrics Advisor.
*/
superUser?: string;
/**
* (Metrics Advisor Only) The website name of Metrics Advisor.
*/
websiteName?: string;
}

/**
Expand Down Expand Up @@ -294,6 +311,11 @@ export interface CognitiveServicesAccountProperties {
* The api properties for special APIs.
*/
apiProperties?: CognitiveServicesAccountApiProperties;
/**
* Gets the date of cognitive services account creation.
* **NOTE: This property will not be serialized. It can only be populated by the server.**
*/
readonly dateCreated?: string;
}

/**
Expand Down Expand Up @@ -750,6 +772,16 @@ export interface ResourceSku {
readonly restrictions?: ResourceSkuRestrictions[];
}

/**
* A list of private endpoint connections
*/
export interface PrivateEndpointConnectionListResult {
/**
* Array of private endpoint connections
*/
value?: PrivateEndpointConnection[];
}

/**
* Properties of a private link resource.
*/
Expand Down Expand Up @@ -796,14 +828,17 @@ export interface PrivateLinkResourceListResult {
}

/**
* The resource model definition for a ARM proxy resource. It will have everything other than
* required location and tags
* The resource model definition for a Azure Resource Manager proxy resource. It will not have tags
* and a location
* @summary Proxy Resource
*/
export interface ProxyResource extends Resource {
}

/**
* The resource model definition for a ARM tracked top level resource
* The resource model definition for an Azure Resource Manager tracked top level resource which has
* 'tags' and a 'location'
* @summary Tracked Resource
*/
export interface TrackedResource extends Resource {
/**
Expand All @@ -817,7 +852,8 @@ export interface TrackedResource extends Resource {
}

/**
* The resource model definition for a Azure Resource Manager resource with an etag.
* The resource model definition for an Azure Resource Manager resource with an etag.
* @summary Entity Resource
*/
export interface AzureEntityResource extends Resource {
/**
Expand Down Expand Up @@ -883,11 +919,11 @@ export interface OperationEntityListResult extends Array<OperationEntity> {

/**
* Defines values for SkuTier.
* Possible values include: 'Free', 'Standard', 'Premium'
* Possible values include: 'Free', 'Standard', 'Premium', 'Enterprise'
* @readonly
* @enum {string}
*/
export type SkuTier = 'Free' | 'Standard' | 'Premium';
export type SkuTier = 'Free' | 'Standard' | 'Premium' | 'Enterprise';

/**
* Defines values for ProvisioningState.
Expand Down Expand Up @@ -1318,6 +1354,26 @@ export type CheckDomainAvailabilityResponse = CheckDomainAvailabilityResult & {
};
};

/**
* Contains response data for the list operation.
*/
export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult & {
/**
* 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: PrivateEndpointConnectionListResult;
};
};

/**
* Contains response data for the get operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const Sku: msRest.CompositeMapper = {
allowedValues: [
"Free",
"Standard",
"Premium"
"Premium",
"Enterprise"
]
}
}
Expand Down Expand Up @@ -384,6 +385,42 @@ export const CognitiveServicesAccountApiProperties: msRest.CompositeMapper = {
type: {
name: "String"
}
},
aadClientId: {
serializedName: "aadClientId",
constraints: {
MaxLength: 500
},
type: {
name: "String"
}
},
aadTenantId: {
serializedName: "aadTenantId",
constraints: {
MaxLength: 500
},
type: {
name: "String"
}
},
superUser: {
serializedName: "superUser",
constraints: {
MaxLength: 500
},
type: {
name: "String"
}
},
websiteName: {
serializedName: "websiteName",
constraints: {
MaxLength: 500
},
type: {
name: "String"
}
}
}
}
Expand Down Expand Up @@ -485,6 +522,13 @@ export const CognitiveServicesAccountProperties: msRest.CompositeMapper = {
name: "Composite",
className: "CognitiveServicesAccountApiProperties"
}
},
dateCreated: {
readOnly: true,
serializedName: "dateCreated",
type: {
name: "String"
}
}
}
}
Expand Down Expand Up @@ -1252,6 +1296,28 @@ export const ResourceSku: msRest.CompositeMapper = {
}
};

export const PrivateEndpointConnectionListResult: msRest.CompositeMapper = {
serializedName: "PrivateEndpointConnectionListResult",
type: {
name: "Composite",
className: "PrivateEndpointConnectionListResult",
modelProperties: {
value: {
serializedName: "value",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "PrivateEndpointConnection"
}
}
}
}
}
}
};

export const PrivateLinkResourceProperties: msRest.CompositeMapper = {
serializedName: "PrivateLinkResourceProperties",
type: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ export {
CognitiveServicesAccountApiProperties,
CognitiveServicesAccountProperties,
Encryption,
ErrorBody,
ErrorModel,
Identity,
IpRule,
KeyVaultProperties,
NetworkRuleSet,
PrivateEndpoint,
PrivateEndpointConnection,
PrivateEndpointConnectionListResult,
PrivateEndpointConnectionProperties,
PrivateLinkResource,
PrivateLinkResourceProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,38 @@ export class PrivateEndpointConnections {
this.client = client;
}

/**
* Gets the private endpoint connections 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 [options] The optional parameters
* @returns Promise<Models.PrivateEndpointConnectionsListResponse>
*/
list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.PrivateEndpointConnectionsListResponse>;
/**
* @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<Models.PrivateEndpointConnectionListResult>): 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<Models.PrivateEndpointConnectionListResult>): void;
list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PrivateEndpointConnectionListResult>, callback?: msRest.ServiceCallback<Models.PrivateEndpointConnectionListResult>): Promise<Models.PrivateEndpointConnectionsListResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
accountName,
options
},
listOperationSpec,
callback) as Promise<Models.PrivateEndpointConnectionsListResponse>;
}

/**
* 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.
Expand Down Expand Up @@ -152,6 +184,31 @@ export class PrivateEndpointConnections {

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections",
urlParameters: [
Parameters.resourceGroupName,
Parameters.accountName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.PrivateEndpointConnectionListResult
},
default: {
bodyMapper: Mappers.ErrorModel
}
},
serializer
};

const getOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
Expand Down
3 changes: 2 additions & 1 deletion swagger_to_sdk_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"typescript": "",
"license-header": "MICROSOFT_MIT_NO_VERSION",
"sdkrel:typescript-sdks-folder": ".",
"use": "@microsoft.azure/autorest.typescript@4.4.1"
"typescript.clear-output-folder": "",
"use": "@microsoft.azure/autorest.typescript@4.2.2"
},
"advanced_options": {
"clone_dir": "./azure-sdk-for-js",
Expand Down