diff --git a/src/generators/modelsGenerator.ts b/src/generators/modelsGenerator.ts index 802856564c..e3ad400f96 100644 --- a/src/generators/modelsGenerator.ts +++ b/src/generators/modelsGenerator.ts @@ -77,6 +77,12 @@ export function generateModels(clientDetails: ClientDetails, project: Project) { writeOperationModels(clientDetails, modelsIndexFile); writeClientModels(clientDetails, modelsIndexFile); modelsIndexFile.fixUnusedIdentifiers(); + const allTypes = modelsIndexFile.getTypeAliases(); + clientDetails.allTypes = allTypes.filter(item => { + return item.isExported() + }).map(item => { + return item.getName() + }); } const writeClientModels = ( @@ -771,6 +777,10 @@ function getPropertyTypeName( ignoreNullableOnOptional: boolean ) { if (property.isConstant) { + if (property.type === SchemaType.Number + || property.type === SchemaType.Boolean) { + return `${property.defaultValue}`; + } return `"${getStringForValue( property.defaultValue, property.type, diff --git a/src/generators/static/samples.ts.hbs b/src/generators/static/samples.ts.hbs index 4c91a85db8..223f74b2c5 100644 --- a/src/generators/static/samples.ts.hbs +++ b/src/generators/static/samples.ts.hbs @@ -8,8 +8,10 @@ * x-ms-original-file: {{originalFileLocation}} */ import { -{{#if hasBody }} - {{bodySchemaName}}, +{{#if importedTypes.length }} + {{#each importedTypes}} + {{this}}, + {{/each}} {{/if}} {{clientClassName}}, } from "{{clientPackageName}}"; diff --git a/src/models/clientDetails.ts b/src/models/clientDetails.ts index 099e729af2..5503e6f4f5 100644 --- a/src/models/clientDetails.ts +++ b/src/models/clientDetails.ts @@ -34,4 +34,5 @@ export interface ClientDetails { options: ClientOptions; endpoint: EndpointDetails; samples?: SampleDetails[]; + allTypes: string[]; } diff --git a/src/models/modelDetails.ts b/src/models/modelDetails.ts index a801d2b913..ee5a603f05 100644 --- a/src/models/modelDetails.ts +++ b/src/models/modelDetails.ts @@ -65,7 +65,7 @@ export type PolymorphicObjectDetails = BasicObjectDetails & { export interface PropertyDetails { name: string; description?: string; - defaultValue?: string; + defaultValue?: string | number | boolean; serializedName: string; type: string; required: boolean; @@ -83,7 +83,7 @@ export interface TypeDetails { typeName: string; isConstant?: boolean; nullable?: boolean; - defaultValue?: string; + defaultValue?: string | number | boolean; kind: PropertyKind; usedModels: string[]; } diff --git a/src/models/sampleDetails.ts b/src/models/sampleDetails.ts index e0a453a6b7..98944d16cb 100644 --- a/src/models/sampleDetails.ts +++ b/src/models/sampleDetails.ts @@ -15,4 +15,6 @@ export interface SampleDetails { isTopLevel: boolean, isPaging: boolean, originalFileLocation?: string + isAnyTypeBody?: boolean, + importedTypes?: string[] } \ No newline at end of file diff --git a/src/transforms/samplesTransforms.ts b/src/transforms/samplesTransforms.ts index 2cfcc81080..0bb1c34851 100644 --- a/src/transforms/samplesTransforms.ts +++ b/src/transforms/samplesTransforms.ts @@ -18,6 +18,8 @@ import { calculateMethodName } from "../generators/utils/operationsUtils"; import { camelCase } from "@azure-tools/codegen"; import { OperationGroupDetails } from "../models/operationDetails"; import { getPublicMethodName } from '../generators/utils/pagingOperations'; +import { BodiedNode } from "ts-morph"; +import { getTypeForSchema } from "../utils/schemaHelpers"; export async function transformSamples( codeModel: CodeModel, @@ -69,12 +71,13 @@ export async function getAllExamples(codeModel: TestCodeModel, clientDetails: Cl example.operation.language ).description, operationName: methodName, - operationGroupName: normalizeName(opGroupName, NameType.Property), + operationGroupName: normalizeName(opGroupName, NameType.Property, true), clientClassName: clientName, clientPackageName: packageDetails.name, clientParameterNames: "", methodParameterNames: "", bodySchemaName: "", + isAnyTypeBody: false, hasBody: false, hasOptional: false, sampleFunctionName: camelCase(example.name.replace(/\//g, " Or ").replace(/,|\.|\(|\)/g, " ").replace('\'s ', ' ')), @@ -82,7 +85,8 @@ export async function getAllExamples(codeModel: TestCodeModel, clientDetails: Cl clientParamAssignments: [], isTopLevel: ogDetails.isTopLevel, isPaging: opDetails.pagination !== undefined, - originalFileLocation: example.originalFile + originalFileLocation: example.originalFile, + importedTypes: [] }; const clientParameterNames = ["credential"]; const requiredParams = clientDetails.parameters.filter( @@ -100,7 +104,8 @@ export async function getAllExamples(codeModel: TestCodeModel, clientDetails: Cl } const parameterName = normalizeName( getLanguageMetadata(clientParameter.exampleValue.language).name, - NameType.Parameter + NameType.Parameter, + true ); const paramAssignment = `const ${parameterName} = ` + @@ -117,22 +122,31 @@ export async function getAllExamples(codeModel: TestCodeModel, clientDetails: Cl sample.clientParameterNames = clientParameterNames.join(", "); } const methodParameterNames = []; - const optionalParams = []; + const optionalParams: [string, string][]= []; for (const methodParameter of example.methodParameters) { if ( methodParameter.exampleValue.schema.type === SchemaType.Constant ) { continue; } - const parameterName = getLanguageMetadata( - methodParameter.exampleValue.language - ).name; + const parameterName = normalizeName( + getLanguageMetadata(methodParameter.exampleValue.language).name, + NameType.Parameter, + true + ); + const parameterTypeDetails = getTypeForSchema( + methodParameter.exampleValue.schema + ); + const parameterTypeName = parameterTypeDetails.typeName; let paramAssignment = ""; if (methodParameter.parameter.protocol?.http?.["in"] === "body") { sample.hasBody = true; - sample.bodySchemaName = getLanguageMetadata( - methodParameter.exampleValue.schema.language - ).name; + sample.bodySchemaName = parameterTypeName; + sample.importedTypes?.push(parameterTypeName); + if (methodParameter.exampleValue.schema.type === SchemaType.AnyObject || methodParameter.exampleValue.schema.type === SchemaType.Any) { + sample.bodySchemaName = "Record" + sample.isAnyTypeBody = true; + } paramAssignment = `const ${parameterName}: ${sample.bodySchemaName} = ` + getParameterAssignment(methodParameter.exampleValue); @@ -142,17 +156,17 @@ export async function getAllExamples(codeModel: TestCodeModel, clientDetails: Cl getParameterAssignment(methodParameter.exampleValue); } if (!methodParameter.parameter.required) { - optionalParams.push(parameterName); + optionalParams.push([ parameterName, parameterTypeName ]); } else { methodParameterNames.push(parameterName); } sample.methodParamAssignments.push(paramAssignment); } if (optionalParams.length > 0) { - const optionAssignment = `const options = {${optionalParams - .map(item => { - return item + ": " + item; - }) + const optionTypeName = `${opDetails.typeDetails.typeName}OptionalParams` + sample.importedTypes?.push(optionTypeName); + const optionAssignment = `const options: ${optionTypeName} = {${optionalParams + .map(item => { return item[0];}) .join(", ")}}`; sample.methodParamAssignments.push(optionAssignment); methodParameterNames.push("options"); @@ -193,6 +207,7 @@ function getParameterAssignment(exampleValue: ExampleValue) { case SchemaType.Object: case SchemaType.Any: case SchemaType.Dictionary: + case SchemaType.AnyObject: retValue = `{}`; break; case SchemaType.Array: diff --git a/src/transforms/transforms.ts b/src/transforms/transforms.ts index 210cd9ae77..2118736d24 100644 --- a/src/transforms/transforms.ts +++ b/src/transforms/transforms.ts @@ -121,7 +121,8 @@ export async function transformCodeModel( operationGroups, parameters, options, - endpoint: baseUrl + endpoint: baseUrl, + allTypes: [] }; } diff --git a/src/typescriptGenerator.ts b/src/typescriptGenerator.ts index 4add87983b..35511febbb 100755 --- a/src/typescriptGenerator.ts +++ b/src/typescriptGenerator.ts @@ -70,11 +70,11 @@ export async function generateTypeScriptLibrary( const clientDetails = await transformCodeModel(codeModel); conflictResolver(clientDetails); + + generateModels(clientDetails, project); if (generateSample) { clientDetails.samples = await transformSamples(codeModel, clientDetails); } - - // Skip metadata generation if `generate-metadata` is explicitly false generatePackageJson(project, clientDetails); generateLicenseFile(project); @@ -87,7 +87,6 @@ export async function generateTypeScriptLibrary( generateApiExtractorConfig(project); generateClient(clientDetails, project); - generateModels(clientDetails, project); generateMappers(clientDetails, project); generateOperations(clientDetails, project); diff --git a/src/utils/schemaHelpers.ts b/src/utils/schemaHelpers.ts index 97b1c0af16..f666a1ada7 100644 --- a/src/utils/schemaHelpers.ts +++ b/src/utils/schemaHelpers.ts @@ -68,7 +68,7 @@ export function getTypeForSchema( ): TypeDetails { let typeName: string = ""; let usedModels: string[] = []; - let defaultValue: string = ""; + let defaultValue = undefined; let kind: PropertyKind = PropertyKind.Primitive; switch (schema.type) { case SchemaType.Any: @@ -194,7 +194,7 @@ export function getTypeForSchema( usedModels, isConstant: schema.type === SchemaType.Constant, nullable: isNullable, - ...(defaultValue && { defaultValue }) + defaultValue }; } diff --git a/test/integration/bodyComplex.spec.ts b/test/integration/bodyComplex.spec.ts index b14c2b9d72..2015f61560 100644 --- a/test/integration/bodyComplex.spec.ts +++ b/test/integration/bodyComplex.spec.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; import * as moment from "moment"; -import { BodyComplexWithTracing } from "./generated/bodyComplexWithTracing/src"; +import { BodyComplexWithTracing, DotFishUnion } from "./generated/bodyComplexWithTracing/src"; import { BodyComplexClient, Sawshark, diff --git a/test/integration/generated/azureSpecialProperties/src/models/index.ts b/test/integration/generated/azureSpecialProperties/src/models/index.ts index af2e0ca1df..95ad7275fc 100644 --- a/test/integration/generated/azureSpecialProperties/src/models/index.ts +++ b/test/integration/generated/azureSpecialProperties/src/models/index.ts @@ -10,7 +10,7 @@ import * as coreClient from "@azure/core-client"; export interface ErrorModel { status?: number; - constantId: "1"; + constantId: 1; message?: string; } diff --git a/test/integration/generated/validation/src/models/index.ts b/test/integration/generated/validation/src/models/index.ts index 32b2ac259c..d970a4528e 100644 --- a/test/integration/generated/validation/src/models/index.ts +++ b/test/integration/generated/validation/src/models/index.ts @@ -21,7 +21,7 @@ export interface Product { /** The product documentation. */ constChild: ConstantProduct; /** Constant int */ - constInt: "undefined"; + constInt: 0; /** Constant string */ constString: "constant"; /** Constant string as Enum */ diff --git a/test/integration/validation.spec.ts b/test/integration/validation.spec.ts index 95f177da2c..326452453e 100644 --- a/test/integration/validation.spec.ts +++ b/test/integration/validation.spec.ts @@ -7,7 +7,7 @@ const constantBody: Product = { constProperty: "constant", constProperty2: "constant2" }, - constInt: "undefined", + constInt: 0, constString: "constant" }; diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithMultipleRoles.ts b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithMultipleRoles.ts index ed5cac9d75..0fa527a18c 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithMultipleRoles.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithMultipleRoles.ts @@ -16,6 +16,7 @@ */ import { CloudService, + CloudServicesCreateOrUpdateOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -64,7 +65,7 @@ async function createNewCloudServiceWithMultipleRoles() { upgradeMode: "Auto" } }; - const options = { parameters: parameters }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginCreateOrUpdateAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRole.ts b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRole.ts index 5be44b2031..1e4e11d671 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRole.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRole.ts @@ -16,6 +16,7 @@ */ import { CloudService, + CloudServicesCreateOrUpdateOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -60,7 +61,7 @@ async function createNewCloudServiceWithSingleRole() { upgradeMode: "Auto" } }; - const options = { parameters: parameters }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginCreateOrUpdateAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault.ts b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault.ts index 184347aed3..46caab02d7 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault.ts @@ -16,6 +16,7 @@ */ import { CloudService, + CloudServicesCreateOrUpdateOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -76,7 +77,7 @@ async function createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { upgradeMode: "Auto" } }; - const options = { parameters: parameters }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginCreateOrUpdateAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndRdpExtension.ts b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndRdpExtension.ts index cb746b2671..d226a30a66 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndRdpExtension.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/createNewCloudServiceWithSingleRoleAndRdpExtension.ts @@ -16,6 +16,7 @@ */ import { CloudService, + CloudServicesCreateOrUpdateOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -77,7 +78,7 @@ async function createNewCloudServiceWithSingleRoleAndRdpExtension() { upgradeMode: "Auto" } }; - const options = { parameters: parameters }; + const options: CloudServicesCreateOrUpdateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginCreateOrUpdateAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/deleteCloudServiceRoleInstances.ts b/test/smoke/generated/compute-resource-manager/samples-dev/deleteCloudServiceRoleInstances.ts index befec40fb1..c81f1079c7 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/deleteCloudServiceRoleInstances.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/deleteCloudServiceRoleInstances.ts @@ -16,6 +16,7 @@ */ import { RoleInstances, + CloudServicesDeleteInstancesOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -27,7 +28,7 @@ async function deleteCloudServiceRoleInstances() { const parameters: RoleInstances = { roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] }; - const options = { parameters: parameters }; + const options: CloudServicesDeleteInstancesOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginDeleteInstancesAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVM.ts b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVM.ts index bd5a5a8139..a6fcfa27a2 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVM.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVM.ts @@ -14,7 +14,10 @@ * @summary The operation to delete a virtual machine. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachine.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + VirtualMachinesDeleteOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function forceDeleteAVM() { @@ -22,7 +25,7 @@ async function forceDeleteAVM() { const resourceGroupName = "myResourceGroup"; const vmName = "myVM"; const forceDeletion = true; - const options = { forceDeletion: forceDeletion }; + const options: VirtualMachinesDeleteOptionalParams = { forceDeletion }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachines.beginDeleteAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVMScaleSet.ts b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVMScaleSet.ts index 4215ae0d1d..1301387a18 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVMScaleSet.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVMScaleSet.ts @@ -14,7 +14,10 @@ * @summary Deletes a VM scale set. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachineScaleSets.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + VirtualMachineScaleSetsDeleteOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function forceDeleteAVMScaleSet() { @@ -22,7 +25,9 @@ async function forceDeleteAVMScaleSet() { const resourceGroupName = "myResourceGroup"; const vmScaleSetName = "myvmScaleSet"; const forceDeletion = true; - const options = { forceDeletion: forceDeletion }; + const options: VirtualMachineScaleSetsDeleteOptionalParams = { + forceDeletion + }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSets.beginDeleteAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVirtualMachineFromAVMScaleSet.ts b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVirtualMachineFromAVMScaleSet.ts index d8a2ce7eba..8f33dad7b0 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVirtualMachineFromAVMScaleSet.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/forceDeleteAVirtualMachineFromAVMScaleSet.ts @@ -14,7 +14,10 @@ * @summary Deletes a virtual machine from a VM scale set. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ForceDeleteVirtualMachineScaleSetVM.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + VirtualMachineScaleSetVMsDeleteOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function forceDeleteAVirtualMachineFromAVMScaleSet() { @@ -23,7 +26,9 @@ async function forceDeleteAVirtualMachineFromAVMScaleSet() { const vmScaleSetName = "myvmScaleSet"; const instanceId = "0"; const forceDeletion = true; - const options = { forceDeletion: forceDeletion }; + const options: VirtualMachineScaleSetVMsDeleteOptionalParams = { + forceDeletion + }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachineScaleSetVMs.beginDeleteAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryApplicationVersionWithReplicationStatus.ts b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryApplicationVersionWithReplicationStatus.ts index 9c3fb7f873..cd96ca1c90 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryApplicationVersionWithReplicationStatus.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryApplicationVersionWithReplicationStatus.ts @@ -14,7 +14,10 @@ * @summary Retrieves information about a gallery Application Version. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + GalleryApplicationVersionsGetOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getAGalleryApplicationVersionWithReplicationStatus() { @@ -24,7 +27,7 @@ async function getAGalleryApplicationVersionWithReplicationStatus() { const galleryApplicationName = "myGalleryApplicationName"; const galleryApplicationVersionName = "1.0.0"; const expand = "ReplicationStatus"; - const options = { expand: expand }; + const options: GalleryApplicationVersionsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryApplicationVersions.get( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryImageVersionWithReplicationStatus.ts b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryImageVersionWithReplicationStatus.ts index c92ccb8381..b037f54e0e 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryImageVersionWithReplicationStatus.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryImageVersionWithReplicationStatus.ts @@ -14,7 +14,10 @@ * @summary Retrieves information about a gallery image version. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + GalleryImageVersionsGetOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getAGalleryImageVersionWithReplicationStatus() { @@ -24,7 +27,7 @@ async function getAGalleryImageVersionWithReplicationStatus() { const galleryImageName = "myGalleryImageName"; const galleryImageVersionName = "1.0.0"; const expand = "ReplicationStatus"; - const options = { expand: expand }; + const options: GalleryImageVersionsGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleryImageVersions.get( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryWithSelectPermissions.ts b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryWithSelectPermissions.ts index 3cebd82a01..374b1e5adb 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryWithSelectPermissions.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/getAGalleryWithSelectPermissions.ts @@ -14,7 +14,10 @@ * @summary Retrieves information about a Shared Image Gallery. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/gallery/GetAGalleryWithSelectPermissions.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + GalleriesGetOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getAGalleryWithSelectPermissions() { @@ -22,7 +25,7 @@ async function getAGalleryWithSelectPermissions() { const resourceGroupName = "myResourceGroup"; const galleryName = "myGalleryName"; const select = "Permissions"; - const options = { select: select }; + const options: GalleriesGetOptionalParams = { select }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.galleries.get( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/listAvailabilitySetsInASubscription.ts b/test/smoke/generated/compute-resource-manager/samples-dev/listAvailabilitySetsInASubscription.ts index 6cddc6b0fd..01c340eb9b 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/listAvailabilitySetsInASubscription.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/listAvailabilitySetsInASubscription.ts @@ -14,13 +14,16 @@ * @summary Lists all availability sets in a subscription. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListAvailabilitySetsInASubscription.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + AvailabilitySetsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listAvailabilitySetsInASubscription() { const subscriptionId = "{subscriptionId}"; const expand = "virtualMachines$ref"; - const options = { expand: expand }; + const options: AvailabilitySetsListBySubscriptionOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInResourceGroup.ts b/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInResourceGroup.ts index 57d7d0346b..749c813382 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInResourceGroup.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInResourceGroup.ts @@ -14,14 +14,19 @@ * @summary Lists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListCapacityReservationGroupsInResourceGroup.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + CapacityReservationGroupsListByResourceGroupOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listCapacityReservationGroupsInResourceGroup() { const subscriptionId = "{subscription-id}"; const resourceGroupName = "myResourceGroup"; const expand = "virtualMachines/$ref"; - const options = { expand: expand }; + const options: CapacityReservationGroupsListByResourceGroupOptionalParams = { + expand + }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInSubscription.ts b/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInSubscription.ts index f1e0844e8f..caa88a2ea7 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInSubscription.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/listCapacityReservationGroupsInSubscription.ts @@ -14,13 +14,18 @@ * @summary Lists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/ListCapacityReservationGroupsInSubscription.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + CapacityReservationGroupsListBySubscriptionOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listCapacityReservationGroupsInSubscription() { const subscriptionId = "{subscription-id}"; const expand = "virtualMachines/$ref"; - const options = { expand: expand }; + const options: CapacityReservationGroupsListBySubscriptionOptionalParams = { + expand + }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsForTheSpecifiedRegion.ts b/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsForTheSpecifiedRegion.ts index 023524c08b..0ca75420fc 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsForTheSpecifiedRegion.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsForTheSpecifiedRegion.ts @@ -14,13 +14,16 @@ * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + ResourceSkusListOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listsAllAvailableResourceSkUsForTheSpecifiedRegion() { const subscriptionId = "{subscription-id}"; const filter = "location eq 'westus'"; - const options = { filter: filter }; + const options: ResourceSkusListOptionalParams = { filter }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsWithExtendedLocationInformation.ts b/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsWithExtendedLocationInformation.ts index 50a38be721..56e30059aa 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsWithExtendedLocationInformation.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/listsAllAvailableResourceSkUsWithExtendedLocationInformation.ts @@ -14,13 +14,16 @@ * @summary Gets the list of Microsoft.Compute SKUs available for your Subscription. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + ResourceSkusListOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listsAllAvailableResourceSkUsWithExtendedLocationInformation() { const subscriptionId = "{subscription-id}"; const includeExtendedLocations = "true"; - const options = { includeExtendedLocations: includeExtendedLocations }; + const options: ResourceSkusListOptionalParams = { includeExtendedLocations }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/rebuildCloudServiceRoleInstances.ts b/test/smoke/generated/compute-resource-manager/samples-dev/rebuildCloudServiceRoleInstances.ts index da99266ac4..1a2dad65e0 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/rebuildCloudServiceRoleInstances.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/rebuildCloudServiceRoleInstances.ts @@ -16,6 +16,7 @@ */ import { RoleInstances, + CloudServicesRebuildOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -27,7 +28,7 @@ async function rebuildCloudServiceRoleInstances() { const parameters: RoleInstances = { roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] }; - const options = { parameters: parameters }; + const options: CloudServicesRebuildOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginRebuildAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/reimageAVirtualMachine.ts b/test/smoke/generated/compute-resource-manager/samples-dev/reimageAVirtualMachine.ts index 99ab599f63..462942ba27 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/reimageAVirtualMachine.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/reimageAVirtualMachine.ts @@ -16,6 +16,7 @@ */ import { VirtualMachineReimageParameters, + VirtualMachinesReimageOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -25,7 +26,7 @@ async function reimageAVirtualMachine() { const resourceGroupName = "myResourceGroup"; const vmName = "myVMName"; const parameters: VirtualMachineReimageParameters = { tempDisk: true }; - const options = { parameters: parameters }; + const options: VirtualMachinesReimageOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.virtualMachines.beginReimageAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/reimageCloudServiceRoleInstances.ts b/test/smoke/generated/compute-resource-manager/samples-dev/reimageCloudServiceRoleInstances.ts index 5d21fdf6c5..4bf89c1950 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/reimageCloudServiceRoleInstances.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/reimageCloudServiceRoleInstances.ts @@ -16,6 +16,7 @@ */ import { RoleInstances, + CloudServicesReimageOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -27,7 +28,7 @@ async function reimageCloudServiceRoleInstances() { const parameters: RoleInstances = { roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] }; - const options = { parameters: parameters }; + const options: CloudServicesReimageOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginReimageAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/restartCloudServiceRoleInstances.ts b/test/smoke/generated/compute-resource-manager/samples-dev/restartCloudServiceRoleInstances.ts index 602337fcc1..2c9ecad779 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/restartCloudServiceRoleInstances.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/restartCloudServiceRoleInstances.ts @@ -16,6 +16,7 @@ */ import { RoleInstances, + CloudServicesRestartOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -27,7 +28,7 @@ async function restartCloudServiceRoleInstances() { const parameters: RoleInstances = { roleInstances: ["ContosoFrontend_IN_0", "ContosoBackend_IN_1"] }; - const options = { parameters: parameters }; + const options: CloudServicesRestartOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginRestartAndWait( diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/retrieveBootDiagnosticsDataOfAVirtualMachine.ts b/test/smoke/generated/compute-resource-manager/samples-dev/retrieveBootDiagnosticsDataOfAVirtualMachine.ts index 3321af944c..ae8c8885d5 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/retrieveBootDiagnosticsDataOfAVirtualMachine.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/retrieveBootDiagnosticsDataOfAVirtualMachine.ts @@ -14,7 +14,10 @@ * @summary The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set. * x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/compute/RetrieveBootDiagnosticsDataVMScaleSetVM.json */ -import { ComputeManagementClient } from "@msinternal/compute-resource-manager"; +import { + VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams, + ComputeManagementClient +} from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function retrieveBootDiagnosticsDataOfAVirtualMachine() { @@ -23,8 +26,8 @@ async function retrieveBootDiagnosticsDataOfAVirtualMachine() { const vmScaleSetName = "myvmScaleSet"; const instanceId = "0"; const sasUriExpirationTimeInMinutes = 60; - const options = { - sasUriExpirationTimeInMinutes: sasUriExpirationTimeInMinutes + const options: VirtualMachineScaleSetVMsRetrieveBootDiagnosticsDataOptionalParams = { + sasUriExpirationTimeInMinutes }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/compute-resource-manager/samples-dev/updateExistingCloudServiceToAddTags.ts b/test/smoke/generated/compute-resource-manager/samples-dev/updateExistingCloudServiceToAddTags.ts index fc95083eab..d6017d349e 100644 --- a/test/smoke/generated/compute-resource-manager/samples-dev/updateExistingCloudServiceToAddTags.ts +++ b/test/smoke/generated/compute-resource-manager/samples-dev/updateExistingCloudServiceToAddTags.ts @@ -16,6 +16,7 @@ */ import { CloudServiceUpdate, + CloudServicesUpdateOptionalParams, ComputeManagementClient } from "@msinternal/compute-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -25,7 +26,7 @@ async function updateExistingCloudServiceToAddTags() { const resourceGroupName = "ConstosoRG"; const cloudServiceName = "{cs-name}"; const parameters: CloudServiceUpdate = { tags: { documentation: "RestAPI" } }; - const options = { parameters: parameters }; + const options: CloudServicesUpdateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new ComputeManagementClient(credential, subscriptionId); const result = await client.cloudServices.beginUpdateAndWait( diff --git a/test/smoke/generated/graphrbac-data-plane/review/graphrbac-data-plane.api.md b/test/smoke/generated/graphrbac-data-plane/review/graphrbac-data-plane.api.md index ba4d02aa88..4b23f3e3fc 100644 --- a/test/smoke/generated/graphrbac-data-plane/review/graphrbac-data-plane.api.md +++ b/test/smoke/generated/graphrbac-data-plane/review/graphrbac-data-plane.api.md @@ -390,9 +390,9 @@ export interface GroupAddMemberParameters { export interface GroupCreateParameters { [property: string]: any; displayName: string; - mailEnabled: "undefined"; + mailEnabled: false; mailNickname: string; - securityEnabled: "true"; + securityEnabled: true; } // @public diff --git a/test/smoke/generated/graphrbac-data-plane/src/models/index.ts b/test/smoke/generated/graphrbac-data-plane/src/models/index.ts index 4fd01b3f94..a714f2443b 100644 --- a/test/smoke/generated/graphrbac-data-plane/src/models/index.ts +++ b/test/smoke/generated/graphrbac-data-plane/src/models/index.ts @@ -343,11 +343,11 @@ export interface GroupCreateParameters { /** Group display name */ displayName: string; /** Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API. */ - mailEnabled: "undefined"; + mailEnabled: false; /** Mail nickname */ mailNickname: string; /** Whether the group is a security group. Must be true. This is because only pure security groups can be created using the Graph API. */ - securityEnabled: "true"; + securityEnabled: true; } /** Server response for Get tenant groups API call */ diff --git a/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedResourceGroup.ts b/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedResourceGroup.ts index 23777a4b12..bda396bee7 100644 --- a/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedResourceGroup.ts +++ b/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedResourceGroup.ts @@ -14,14 +14,17 @@ * @summary The List operation gets information about the vaults associated with the subscription and within the specified resource group. * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVaultByResourceGroup.json */ -import { KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager"; +import { + VaultsListByResourceGroupOptionalParams, + KeyVaultManagementClient +} from "@msinternal/keyvault-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listVaultsInTheSpecifiedResourceGroup() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const resourceGroupName = "sample-group"; const top = 1; - const options = { top: top }; + const options: VaultsListByResourceGroupOptionalParams = { top }; const credential = new DefaultAzureCredential(); const client = new KeyVaultManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedSubscription.ts b/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedSubscription.ts index 01c3262b4e..9b20337392 100644 --- a/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedSubscription.ts +++ b/test/smoke/generated/keyvault-resource-manager/samples-dev/listVaultsInTheSpecifiedSubscription.ts @@ -14,13 +14,16 @@ * @summary The List operation gets information about the vaults associated with the subscription. * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVault.json */ -import { KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager"; +import { + VaultsListOptionalParams, + KeyVaultManagementClient +} from "@msinternal/keyvault-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listVaultsInTheSpecifiedSubscription() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; const top = 1; - const options = { top: top }; + const options: VaultsListOptionalParams = { top }; const credential = new DefaultAzureCredential(); const client = new KeyVaultManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForAConnectionResource.ts b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForAConnectionResource.ts index 5476d8cc38..79943678f9 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForAConnectionResource.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForAConnectionResource.ts @@ -16,6 +16,7 @@ */ import { EffectiveRoutesParameters, + VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -29,7 +30,9 @@ async function effectiveRoutesForAConnectionResource() { "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", virtualWanResourceType: "ExpressRouteConnection" }; - const options = { effectiveRoutesParameters: effectiveRoutesParameters }; + const options: VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams = { + effectiveRoutesParameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualHubs.beginGetEffectiveVirtualHubRoutesAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForARouteTableResource.ts b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForARouteTableResource.ts index a7b1b34f61..17927374b0 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForARouteTableResource.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForARouteTableResource.ts @@ -16,6 +16,7 @@ */ import { EffectiveRoutesParameters, + VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -29,7 +30,9 @@ async function effectiveRoutesForARouteTableResource() { "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1", virtualWanResourceType: "RouteTable" }; - const options = { effectiveRoutesParameters: effectiveRoutesParameters }; + const options: VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams = { + effectiveRoutesParameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualHubs.beginGetEffectiveVirtualHubRoutesAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForTheVirtualHub.ts b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForTheVirtualHub.ts index b82c7fe74a..4f1b9aef80 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForTheVirtualHub.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/effectiveRoutesForTheVirtualHub.ts @@ -16,6 +16,7 @@ */ import { EffectiveRoutesParameters, + VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -25,7 +26,9 @@ async function effectiveRoutesForTheVirtualHub() { const resourceGroupName = "rg1"; const virtualHubName = "virtualHub1"; const effectiveRoutesParameters: EffectiveRoutesParameters = {}; - const options = { effectiveRoutesParameters: effectiveRoutesParameters }; + const options: VirtualHubsGetEffectiveVirtualHubRoutesOptionalParams = { + effectiveRoutesParameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualHubs.beginGetEffectiveVirtualHubRoutesAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithNoAddressPrefixes.ts b/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithNoAddressPrefixes.ts index 338830fd9d..06ca462226 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithNoAddressPrefixes.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithNoAddressPrefixes.ts @@ -14,14 +14,19 @@ * @summary Gets a list of service tag information resources with pagination. * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ServiceTagInformationListResultWithNoAddressPrefixes.json */ -import { NetworkManagementClient } from "@msinternal/network-resource-manager"; +import { + ServiceTagInformationListOptionalParams, + NetworkManagementClient +} from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getListOfServiceTagsWithNoAddressPrefixes() { const subscriptionId = "subid"; const location = "westeurope"; const noAddressPrefixes = true; - const options = { noAddressPrefixes: noAddressPrefixes }; + const options: ServiceTagInformationListOptionalParams = { + noAddressPrefixes + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithTagName.ts b/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithTagName.ts index 991f6c301b..456a7536d8 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithTagName.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/getListOfServiceTagsWithTagName.ts @@ -14,14 +14,17 @@ * @summary Gets a list of service tag information resources with pagination. * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/examples/ServiceTagInformationListResultWithTagname.json */ -import { NetworkManagementClient } from "@msinternal/network-resource-manager"; +import { + ServiceTagInformationListOptionalParams, + NetworkManagementClient +} from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getListOfServiceTagsWithTagName() { const subscriptionId = "subid"; const location = "westeurope"; const tagName = "ApiManagement"; - const options = { tagName: tagName }; + const options: ServiceTagInformationListOptionalParams = { tagName }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter.ts b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter.ts index 53510814b7..748762eb6e 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter.ts @@ -16,6 +16,7 @@ */ import { VpnPacketCaptureStartParameters, + VirtualNetworkGatewayConnectionsStartPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -28,7 +29,9 @@ async function startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter() { filterData: "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}" }; - const options = { parameters: parameters }; + const options: VirtualNetworkGatewayConnectionsStartPacketCaptureOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualNetworkGatewayConnections.beginStartPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayWithFilter.ts b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayWithFilter.ts index 4c4555a84b..095aa53a28 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayWithFilter.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVirtualNetworkGatewayWithFilter.ts @@ -16,6 +16,7 @@ */ import { VpnPacketCaptureStartParameters, + VirtualNetworkGatewaysStartPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -28,7 +29,9 @@ async function startPacketCaptureOnVirtualNetworkGatewayWithFilter() { filterData: "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}" }; - const options = { parameters: parameters }; + const options: VirtualNetworkGatewaysStartPacketCaptureOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualNetworkGateways.beginStartPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithFilter.ts b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithFilter.ts index 16f566d5ec..0f5cf71f53 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithFilter.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithFilter.ts @@ -16,6 +16,7 @@ */ import { VpnConnectionPacketCaptureStartParameters, + VpnConnectionsStartPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -30,7 +31,9 @@ async function startPacketCaptureOnVpnConnectionWithFilter() { "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}", linkConnectionNames: ["siteLink1", "siteLink2"] }; - const options = { parameters: parameters }; + const options: VpnConnectionsStartPacketCaptureOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.vpnConnections.beginStartPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithoutFilter.ts b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithoutFilter.ts index e4abe12cc5..3ba9f74985 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithoutFilter.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnConnectionWithoutFilter.ts @@ -16,6 +16,7 @@ */ import { VpnConnectionPacketCaptureStopParameters, + VpnConnectionsStopPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -30,7 +31,7 @@ async function startPacketCaptureOnVpnConnectionWithoutFilter() { sasUrl: "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D" }; - const options = { parameters: parameters }; + const options: VpnConnectionsStopPacketCaptureOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.vpnConnections.beginStopPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnGatewayWithFilter.ts b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnGatewayWithFilter.ts index c764f2e13a..b67a5a6177 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnGatewayWithFilter.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/startPacketCaptureOnVpnGatewayWithFilter.ts @@ -16,6 +16,7 @@ */ import { VpnGatewayPacketCaptureStartParameters, + VpnGatewaysStartPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -28,7 +29,7 @@ async function startPacketCaptureOnVpnGatewayWithFilter() { filterData: "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}" }; - const options = { parameters: parameters }; + const options: VpnGatewaysStartPacketCaptureOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.vpnGateways.beginStartPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/stopPacketCaptureOnVpnGateway.ts b/test/smoke/generated/network-resource-manager/samples-dev/stopPacketCaptureOnVpnGateway.ts index 9c215ad07f..e702c4746f 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/stopPacketCaptureOnVpnGateway.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/stopPacketCaptureOnVpnGateway.ts @@ -16,6 +16,7 @@ */ import { VpnGatewayPacketCaptureStopParameters, + VpnGatewaysStopPacketCaptureOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -28,7 +29,7 @@ async function stopPacketCaptureOnVpnGateway() { sasUrl: "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D" }; - const options = { parameters: parameters }; + const options: VpnGatewaysStopPacketCaptureOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.vpnGateways.beginStopPacketCaptureAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/syncPeering.ts b/test/smoke/generated/network-resource-manager/samples-dev/syncPeering.ts index 582ddf91fd..970f1742fe 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/syncPeering.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/syncPeering.ts @@ -16,6 +16,7 @@ */ import { VirtualNetworkPeering, + VirtualNetworkPeeringsCreateOrUpdateOptionalParams, NetworkManagementClient } from "@msinternal/network-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -36,7 +37,9 @@ async function syncPeering() { }, useRemoteGateways: false }; - const options = { syncRemoteAddressSpace: syncRemoteAddressSpace }; + const options: VirtualNetworkPeeringsCreateOrUpdateOptionalParams = { + syncRemoteAddressSpace + }; const credential = new DefaultAzureCredential(); const client = new NetworkManagementClient(credential, subscriptionId); const result = await client.virtualNetworkPeerings.beginCreateOrUpdateAndWait( diff --git a/test/smoke/generated/network-resource-manager/samples-dev/virtualWanCreate.ts b/test/smoke/generated/network-resource-manager/samples-dev/virtualWanCreate.ts index 29328315f9..fa964cfde4 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/virtualWanCreate.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/virtualWanCreate.ts @@ -24,7 +24,7 @@ async function virtualWanCreate() { const subscriptionId = "subid"; const resourceGroupName = "rg1"; const virtualWANName = "wan1"; - const WANParameters: VirtualWAN = { + const wANParameters: VirtualWAN = { typePropertiesType: "Basic", disableVpnEncryption: false, location: "West US", @@ -35,7 +35,7 @@ async function virtualWanCreate() { const result = await client.virtualWans.beginCreateOrUpdateAndWait( resourceGroupName, virtualWANName, - WANParameters + wANParameters ); console.log(result); } diff --git a/test/smoke/generated/network-resource-manager/samples-dev/virtualWanUpdate.ts b/test/smoke/generated/network-resource-manager/samples-dev/virtualWanUpdate.ts index 3650721442..0903b6e024 100644 --- a/test/smoke/generated/network-resource-manager/samples-dev/virtualWanUpdate.ts +++ b/test/smoke/generated/network-resource-manager/samples-dev/virtualWanUpdate.ts @@ -24,7 +24,7 @@ async function virtualWanUpdate() { const subscriptionId = "subid"; const resourceGroupName = "rg1"; const virtualWANName = "wan1"; - const WANParameters: TagsObject = { + const wANParameters: TagsObject = { tags: { key1: "value1", key2: "value2" } }; const credential = new DefaultAzureCredential(); @@ -32,7 +32,7 @@ async function virtualWanUpdate() { const result = await client.virtualWans.updateTags( resourceGroupName, virtualWANName, - WANParameters + wANParameters ); console.log(result); } diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/failoverAManagedInstance.ts b/test/smoke/generated/sql-resource-manager/samples-dev/failoverAManagedInstance.ts index d826db8fef..fc68692afc 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/failoverAManagedInstance.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/failoverAManagedInstance.ts @@ -14,7 +14,10 @@ * @summary Failovers a managed instance. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedInstancesFailoverOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function failoverAManagedInstance() { @@ -22,7 +25,7 @@ async function failoverAManagedInstance() { const resourceGroupName = "group1"; const managedInstanceName = "instanceName"; const replicaType = "Primary"; - const options = { replicaType: replicaType }; + const options: ManagedInstancesFailoverOptionalParams = { replicaType }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const result = await client.managedInstances.beginFailoverAndWait( diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/failoverAnDatabase.ts b/test/smoke/generated/sql-resource-manager/samples-dev/failoverAnDatabase.ts index 7fa6543c78..373aa9f70b 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/failoverAnDatabase.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/failoverAnDatabase.ts @@ -14,7 +14,10 @@ * @summary Failovers a database. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverDatabase.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + DatabasesFailoverOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function failoverAnDatabase() { @@ -23,7 +26,7 @@ async function failoverAnDatabase() { const serverName = "testServer"; const databaseName = "testDatabase"; const replicaType = "Primary"; - const options = { replicaType: replicaType }; + const options: DatabasesFailoverOptionalParams = { replicaType }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const result = await client.databases.beginFailoverAndWait( diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/filterDatabaseColumns.ts b/test/smoke/generated/sql-resource-manager/samples-dev/filterDatabaseColumns.ts index 509e9865de..dda3322db6 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/filterDatabaseColumns.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/filterDatabaseColumns.ts @@ -14,7 +14,10 @@ * @summary List database columns * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + DatabaseColumnsListByDatabaseOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function filterDatabaseColumns() { @@ -26,11 +29,11 @@ async function filterDatabaseColumns() { const table = ["customer", "address"]; const column = ["username"]; const orderBy = ["schema asc", "table", "column desc"]; - const options = { - schema: schema, - table: table, - column: column, - orderBy: orderBy + const options: DatabaseColumnsListByDatabaseOptionalParams = { + schema, + table, + column, + orderBy }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/filterManagedDatabaseColumns.ts b/test/smoke/generated/sql-resource-manager/samples-dev/filterManagedDatabaseColumns.ts index d090d7ed5d..eb59aadd19 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/filterManagedDatabaseColumns.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/filterManagedDatabaseColumns.ts @@ -14,7 +14,10 @@ * @summary List managed database columns * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedDatabaseColumnsListByDatabaseOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function filterManagedDatabaseColumns() { @@ -26,11 +29,11 @@ async function filterManagedDatabaseColumns() { const table = ["customer", "address"]; const column = ["username"]; const orderBy = ["schema asc", "table", "column desc"]; - const options = { - schema: schema, - table: table, - column: column, - orderBy: orderBy + const options: ManagedDatabaseColumnsListByDatabaseOptionalParams = { + schema, + table, + column, + orderBy }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/getSyncGroupLogs.ts b/test/smoke/generated/sql-resource-manager/samples-dev/getSyncGroupLogs.ts index 7a432de82e..b08b206251 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/getSyncGroupLogs.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/getSyncGroupLogs.ts @@ -25,7 +25,7 @@ async function getSyncGroupLogs() { const syncGroupName = "syncgroupcrud-3187"; const startTime = "2017-01-01T00:00:00"; const endTime = "2017-12-31T00:00:00"; - const type = "All"; + const typeParam = "All"; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -36,7 +36,7 @@ async function getSyncGroupLogs() { syncGroupName, startTime, endTime, - type + typeParam )) { resArray.push(item); } diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/getTheManagedDatabaseSecurityEventsWithMaximalParameters.ts b/test/smoke/generated/sql-resource-manager/samples-dev/getTheManagedDatabaseSecurityEventsWithMaximalParameters.ts index 41dd1e4bba..d246f15045 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/getTheManagedDatabaseSecurityEventsWithMaximalParameters.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/getTheManagedDatabaseSecurityEventsWithMaximalParameters.ts @@ -14,7 +14,10 @@ * @summary Gets a list of security events. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedDatabaseSecurityEventsListByDatabaseOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getTheManagedDatabaseSecurityEventsWithMaximalParameters() { @@ -27,11 +30,11 @@ async function getTheManagedDatabaseSecurityEventsWithMaximalParameters() { const top = 1; const skiptoken = "eyJCbG9iTmFtZURhdGVUaW1lIjoiXC9EYXRlKDE1MTIyODg4MTIwMTArMDIwMClcLyIsIkJsb2JOYW1lUm9sbG92ZXJJbmRleCI6IjAiLCJFbmREYXRlIjoiXC9EYXRlKDE1MTI0NjYyMDA1MjkpXC8iLCJJc1NraXBUb2tlblNldCI6ZmFsc2UsIklzVjJCbG9iVGltZUZvcm1hdCI6dHJ1ZSwiU2hvd1NlcnZlclJlY29yZHMiOmZhbHNlLCJTa2lwVmFsdWUiOjAsIlRha2VWYWx1ZSI6MTB9"; - const options = { - filter: filter, - skip: skip, - top: top, - skiptoken: skiptoken + const options: ManagedDatabaseSecurityEventsListByDatabaseOptionalParams = { + filter, + skip, + top, + skiptoken }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/listAllJobExecutionsInAJobAgentWithFiltering.ts b/test/smoke/generated/sql-resource-manager/samples-dev/listAllJobExecutionsInAJobAgentWithFiltering.ts index 3f6f707995..e687b09ebb 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/listAllJobExecutionsInAJobAgentWithFiltering.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/listAllJobExecutionsInAJobAgentWithFiltering.ts @@ -14,7 +14,10 @@ * @summary Lists all executions in a job agent. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + JobExecutionsListByAgentOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listAllJobExecutionsInAJobAgentWithFiltering() { @@ -27,12 +30,12 @@ async function listAllJobExecutionsInAJobAgentWithFiltering() { const endTimeMin = new Date("2017-03-21T19:20:00Z"); const endTimeMax = new Date("2017-03-21T19:25:00Z"); const isActive = false; - const options = { - createTimeMin: createTimeMin, - createTimeMax: createTimeMax, - endTimeMin: endTimeMin, - endTimeMax: endTimeMax, - isActive: isActive + const options: JobExecutionsListByAgentOptionalParams = { + createTimeMin, + createTimeMax, + endTimeMin, + endTimeMax, + isActive }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/listInstancePoolUsagesExpandedWithChildren.ts b/test/smoke/generated/sql-resource-manager/samples-dev/listInstancePoolUsagesExpandedWithChildren.ts index d9ad7b3458..14146b3364 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/listInstancePoolUsagesExpandedWithChildren.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/listInstancePoolUsagesExpandedWithChildren.ts @@ -14,7 +14,10 @@ * @summary Gets all instance pool usage metrics * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + UsagesListByInstancePoolOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listInstancePoolUsagesExpandedWithChildren() { @@ -22,7 +25,7 @@ async function listInstancePoolUsagesExpandedWithChildren() { const resourceGroupName = "group1"; const instancePoolName = "testIP"; const expandChildren = true; - const options = { expandChildren: expandChildren }; + const options: UsagesListByInstancePoolOptionalParams = { expandChildren }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/listOfDatabaseRecommendedActionsForAllAdvisors.ts b/test/smoke/generated/sql-resource-manager/samples-dev/listOfDatabaseRecommendedActionsForAllAdvisors.ts index 5f9359a190..0a2aec1e24 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/listOfDatabaseRecommendedActionsForAllAdvisors.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/listOfDatabaseRecommendedActionsForAllAdvisors.ts @@ -14,7 +14,10 @@ * @summary Gets a list of database advisors. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + DatabaseAdvisorsListByDatabaseOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listOfDatabaseRecommendedActionsForAllAdvisors() { @@ -23,7 +26,7 @@ async function listOfDatabaseRecommendedActionsForAllAdvisors() { const serverName = "misosisvr"; const databaseName = "IndexAdvisor_test_3"; const expand = "recommendedActions"; - const options = { expand: expand }; + const options: DatabaseAdvisorsListByDatabaseOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const result = await client.databaseAdvisors.listByDatabase( diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/listOfServerRecommendedActionsForAllAdvisors.ts b/test/smoke/generated/sql-resource-manager/samples-dev/listOfServerRecommendedActionsForAllAdvisors.ts index b8faf0f6af..485ccac8a8 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/listOfServerRecommendedActionsForAllAdvisors.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/listOfServerRecommendedActionsForAllAdvisors.ts @@ -14,7 +14,10 @@ * @summary Gets a list of server advisors. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ServerAdvisorsListByServerOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listOfServerRecommendedActionsForAllAdvisors() { @@ -22,7 +25,7 @@ async function listOfServerRecommendedActionsForAllAdvisors() { const resourceGroupName = "workloadinsight-demos"; const serverName = "misosisvr"; const expand = "recommendedActions"; - const options = { expand: expand }; + const options: ServerAdvisorsListByServerOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const result = await client.serverAdvisors.listByServer( diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueries.ts b/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueries.ts index 2c1f116a3f..812a4b1ba9 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueries.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueries.ts @@ -14,7 +14,10 @@ * @summary Get top resource consuming queries of a managed instance. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedInstancesListByManagedInstanceOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function obtainListOfInstanceTopResourceConsumingQueries() { @@ -23,7 +26,10 @@ async function obtainListOfInstanceTopResourceConsumingQueries() { const managedInstanceName = "sqlcrudtest-4645"; const interval = "PT1H"; const observationMetric = "duration"; - const options = { interval: interval, observationMetric: observationMetric }; + const options: ManagedInstancesListByManagedInstanceOptionalParams = { + interval, + observationMetric + }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAndResponse.ts b/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAndResponse.ts index 9f3a920876..188d301faf 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAndResponse.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAndResponse.ts @@ -14,7 +14,10 @@ * @summary Get top resource consuming queries of a managed instance. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesListMax.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedInstancesListByManagedInstanceOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAndResponse() { @@ -26,12 +29,12 @@ async function obtainListOfInstanceTopResourceConsumingQueriesFullBlownRequestAn const endTime = "2020-03-12T12:00:00Z"; const interval = "P1D"; const observationMetric = "cpu"; - const options = { - databases: databases, - startTime: startTime, - endTime: endTime, - interval: interval, - observationMetric: observationMetric + const options: ManagedInstancesListByManagedInstanceOptionalParams = { + databases, + startTime, + endTime, + interval, + observationMetric }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsExampleWithAllRequestParameters.ts b/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsExampleWithAllRequestParameters.ts index 752fffbbbb..f2ff48a951 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsExampleWithAllRequestParameters.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsExampleWithAllRequestParameters.ts @@ -14,7 +14,10 @@ * @summary Get query execution statistics by query id. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedDatabaseQueriesListByQueryOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function obtainQueryExecutionStatisticsExampleWithAllRequestParameters() { @@ -26,10 +29,10 @@ async function obtainQueryExecutionStatisticsExampleWithAllRequestParameters() { const startTime = "03/01/2020 16:23:09"; const endTime = "03/11/2020 14:00:00"; const interval = "P1D"; - const options = { - startTime: startTime, - endTime: endTime, - interval: interval + const options: ManagedDatabaseQueriesListByQueryOptionalParams = { + startTime, + endTime, + interval }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); diff --git a/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters.ts b/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters.ts index 1a356e3dff..50932e6947 100644 --- a/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters.ts +++ b/test/smoke/generated/sql-resource-manager/samples-dev/obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters.ts @@ -14,7 +14,10 @@ * @summary Get query execution statistics by query id. * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json */ -import { SqlManagementClient } from "@msinternal/sql-resource-manager"; +import { + ManagedDatabaseQueriesListByQueryOptionalParams, + SqlManagementClient +} from "@msinternal/sql-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters() { @@ -24,7 +27,7 @@ async function obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequ const databaseName = "database_1"; const queryId = "42"; const interval = "PT1H"; - const options = { interval: interval }; + const options: ManagedDatabaseQueriesListByQueryOptionalParams = { interval }; const credential = new DefaultAzureCredential(); const client = new SqlManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAContainer.ts b/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAContainer.ts index 7a8d40e425..bd503192c6 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAContainer.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAContainer.ts @@ -16,6 +16,7 @@ */ import { LeaseContainerRequest, + BlobContainersLeaseOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -32,7 +33,7 @@ async function acquireALeaseOnAContainer() { leaseId: undefined, proposedLeaseId: undefined }; - const options = { parameters: parameters }; + const options: BlobContainersLeaseOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.blobContainers.lease( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAShare.ts b/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAShare.ts index fc1371976c..4a0c1a24c7 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAShare.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/acquireALeaseOnAShare.ts @@ -16,6 +16,7 @@ */ import { LeaseShareRequest, + FileSharesLeaseOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -32,7 +33,7 @@ async function acquireALeaseOnAShare() { leaseId: undefined, proposedLeaseId: undefined }; - const options = { parameters: parameters }; + const options: FileSharesLeaseOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.fileShares.lease( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAContainer.ts b/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAContainer.ts index 281f5a9b90..9e834ed013 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAContainer.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAContainer.ts @@ -16,6 +16,7 @@ */ import { LeaseContainerRequest, + BlobContainersLeaseOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -32,7 +33,7 @@ async function breakALeaseOnAContainer() { leaseId: "8698f513-fa75-44a1-b8eb-30ba336af27d", proposedLeaseId: undefined }; - const options = { parameters: parameters }; + const options: BlobContainersLeaseOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.blobContainers.lease( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAShare.ts b/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAShare.ts index 498950601a..891bb7a11c 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAShare.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/breakALeaseOnAShare.ts @@ -16,6 +16,7 @@ */ import { LeaseShareRequest, + FileSharesLeaseOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -32,7 +33,7 @@ async function breakALeaseOnAShare() { leaseId: "8698f513-fa75-44a1-b8eb-30ba336af27d", proposedLeaseId: undefined }; - const options = { parameters: parameters }; + const options: FileSharesLeaseOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.fileShares.lease( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicy.ts b/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicy.ts index fe88b55efb..a47fb83a8f 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicy.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicy.ts @@ -16,6 +16,7 @@ */ import { ImmutabilityPolicy, + BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -29,7 +30,9 @@ async function createOrUpdateImmutabilityPolicy() { allowProtectedAppendWrites: true, immutabilityPeriodSinceCreationInDays: 3 }; - const options = { parameters: parameters }; + const options: BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.blobContainers.createOrUpdateImmutabilityPolicy( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll.ts b/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll.ts index 40081b2c2a..a6165a2368 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll.ts @@ -16,6 +16,7 @@ */ import { ImmutabilityPolicy, + BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -29,7 +30,9 @@ async function createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll allowProtectedAppendWritesAll: true, immutabilityPeriodSinceCreationInDays: 3 }; - const options = { parameters: parameters }; + const options: BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.blobContainers.createOrUpdateImmutabilityPolicy( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/extendImmutabilityPolicy.ts b/test/smoke/generated/storage-resource-manager/samples-dev/extendImmutabilityPolicy.ts index 39ce92ef8d..ef4f1c43af 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/extendImmutabilityPolicy.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/extendImmutabilityPolicy.ts @@ -16,6 +16,7 @@ */ import { ImmutabilityPolicy, + BlobContainersExtendImmutabilityPolicyOptionalParams, StorageManagementClient } from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -29,7 +30,9 @@ async function extendImmutabilityPolicy() { const parameters: ImmutabilityPolicy = { immutabilityPeriodSinceCreationInDays: 100 }; - const options = { parameters: parameters }; + const options: BlobContainersExtendImmutabilityPolicyOptionalParams = { + parameters + }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.blobContainers.extendImmutabilityPolicy( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/getShareStats.ts b/test/smoke/generated/storage-resource-manager/samples-dev/getShareStats.ts index 6675c3d5b6..ea6607d751 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/getShareStats.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/getShareStats.ts @@ -14,7 +14,10 @@ * @summary Gets properties of a specified share. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-06-01/examples/FileSharesGet_Stats.json */ -import { StorageManagementClient } from "@msinternal/storage-resource-manager"; +import { + FileSharesGetOptionalParams, + StorageManagementClient +} from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function getShareStats() { @@ -23,7 +26,7 @@ async function getShareStats() { const accountName = "sto6217"; const shareName = "share1634"; const expand = "stats"; - const options = { expand: expand }; + const options: FileSharesGetOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const result = await client.fileShares.get( diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedContainers.ts b/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedContainers.ts index eb5ba39ab4..19e09b8701 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedContainers.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedContainers.ts @@ -14,7 +14,10 @@ * @summary Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-06-01/examples/DeletedBlobContainersList.json */ -import { StorageManagementClient } from "@msinternal/storage-resource-manager"; +import { + BlobContainersListOptionalParams, + StorageManagementClient +} from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listDeletedContainers() { @@ -22,7 +25,7 @@ async function listDeletedContainers() { const resourceGroupName = "res9290"; const accountName = "sto1590"; const include = "deleted"; - const options = { include: include }; + const options: BlobContainersListOptionalParams = { include }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedShares.ts b/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedShares.ts index dc3b81eb0e..593aae9e1f 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedShares.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/listDeletedShares.ts @@ -14,7 +14,10 @@ * @summary Lists all shares. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-06-01/examples/DeletedFileSharesList.json */ -import { StorageManagementClient } from "@msinternal/storage-resource-manager"; +import { + FileSharesListOptionalParams, + StorageManagementClient +} from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listDeletedShares() { @@ -22,7 +25,7 @@ async function listDeletedShares() { const resourceGroupName = "res9290"; const accountName = "sto1590"; const expand = "deleted"; - const options = { expand: expand }; + const options: FileSharesListOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/storage-resource-manager/samples-dev/listShareSnapshots.ts b/test/smoke/generated/storage-resource-manager/samples-dev/listShareSnapshots.ts index 6f278446d5..3a9235a527 100644 --- a/test/smoke/generated/storage-resource-manager/samples-dev/listShareSnapshots.ts +++ b/test/smoke/generated/storage-resource-manager/samples-dev/listShareSnapshots.ts @@ -14,7 +14,10 @@ * @summary Lists all shares. * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2021-06-01/examples/FileShareSnapshotsList.json */ -import { StorageManagementClient } from "@msinternal/storage-resource-manager"; +import { + FileSharesListOptionalParams, + StorageManagementClient +} from "@msinternal/storage-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function listShareSnapshots() { @@ -22,7 +25,7 @@ async function listShareSnapshots() { const resourceGroupName = "res9290"; const accountName = "sto1590"; const expand = "snapshots"; - const options = { expand: expand }; + const options: FileSharesListOptionalParams = { expand }; const credential = new DefaultAzureCredential(); const client = new StorageManagementClient(credential, subscriptionId); const resArray = new Array(); diff --git a/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSite.ts b/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSite.ts index ccf84a22a0..c3c8a54c71 100644 --- a/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSite.ts +++ b/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSite.ts @@ -16,6 +16,7 @@ */ import { StaticSiteUserProvidedFunctionAppARMResource, + StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteOptionalParams, WebSiteManagementClient } from "@msinternal/web-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -31,7 +32,9 @@ async function registerAUserProvidedFunctionAppWithAStaticSite() { functionAppResourceId: "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/functionRG/providers/Microsoft.Web/sites/testFunctionApp" }; - const options = { isForced: isForced }; + const options: StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteOptionalParams = { + isForced + }; const credential = new DefaultAzureCredential(); const client = new WebSiteManagementClient(credential, subscriptionId); const result = await client.staticSites.beginRegisterUserProvidedFunctionAppWithStaticSiteAndWait( diff --git a/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSiteBuild.ts b/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSiteBuild.ts index f93eb71efe..bbddfac8d8 100644 --- a/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSiteBuild.ts +++ b/test/smoke/generated/web-resource-manager/samples-dev/registerAUserProvidedFunctionAppWithAStaticSiteBuild.ts @@ -16,6 +16,7 @@ */ import { StaticSiteUserProvidedFunctionAppARMResource, + StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildOptionalParams, WebSiteManagementClient } from "@msinternal/web-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; @@ -32,7 +33,9 @@ async function registerAUserProvidedFunctionAppWithAStaticSiteBuild() { functionAppResourceId: "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/functionRG/providers/Microsoft.Web/sites/testFunctionApp" }; - const options = { isForced: isForced }; + const options: StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildOptionalParams = { + isForced + }; const credential = new DefaultAzureCredential(); const client = new WebSiteManagementClient(credential, subscriptionId); const result = await client.staticSites.beginRegisterUserProvidedFunctionAppWithStaticSiteBuildAndWait( diff --git a/test/smoke/generated/web-resource-manager/samples-dev/startANewNetworkTraceOperationForASite.ts b/test/smoke/generated/web-resource-manager/samples-dev/startANewNetworkTraceOperationForASite.ts index aa53adec7d..b615b2124f 100644 --- a/test/smoke/generated/web-resource-manager/samples-dev/startANewNetworkTraceOperationForASite.ts +++ b/test/smoke/generated/web-resource-manager/samples-dev/startANewNetworkTraceOperationForASite.ts @@ -14,7 +14,10 @@ * @summary Description for Start capturing network packets for the site. * x-ms-original-file: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StartWebSiteNetworkTraceOperation.json */ -import { WebSiteManagementClient } from "@msinternal/web-resource-manager"; +import { + WebAppsStartNetworkTraceOptionalParams, + WebSiteManagementClient +} from "@msinternal/web-resource-manager"; import { DefaultAzureCredential } from "@azure/identity"; async function startANewNetworkTraceOperationForASite() { @@ -22,7 +25,7 @@ async function startANewNetworkTraceOperationForASite() { const resourceGroupName = "testrg123"; const name = "SampleApp"; const durationInSeconds = 60; - const options = { durationInSeconds: durationInSeconds }; + const options: WebAppsStartNetworkTraceOptionalParams = { durationInSeconds }; const credential = new DefaultAzureCredential(); const client = new WebSiteManagementClient(credential, subscriptionId); const result = await client.webApps.beginStartNetworkTraceAndWait( diff --git a/test/unit/utils/schemaHelpers.spec.ts b/test/unit/utils/schemaHelpers.spec.ts index efa696dcf9..3335eb7f49 100644 --- a/test/unit/utils/schemaHelpers.spec.ts +++ b/test/unit/utils/schemaHelpers.spec.ts @@ -32,7 +32,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -46,7 +47,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -65,7 +67,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -84,7 +87,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -128,7 +132,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Enum, - usedModels: ["ChoiceSchema"] + usedModels: ["ChoiceSchema"], + defaultValue: undefined }); }); @@ -145,7 +150,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -162,7 +168,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Dictionary, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -173,7 +180,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); typeDetails = getTypeForSchema(new DateTimeSchema("DateTimeSchema", "")); @@ -182,7 +190,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); typeDetails = getTypeForSchema(new UnixTimeSchema("UnixTimeSchema", "")); @@ -191,7 +200,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -204,7 +214,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Primitive, - usedModels: [] + usedModels: [], + defaultValue: undefined }); }); @@ -218,7 +229,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Composite, - usedModels: [typeName] + usedModels: [typeName], + defaultValue: undefined }); }); @@ -248,7 +260,8 @@ describe("SchemaHelpers", () => { isConstant: false, nullable: false, kind: PropertyKind.Composite, - usedModels: [typeName] + usedModels: [typeName], + defaultValue: undefined }); }); });