
import {
{{#if importedTypes.length }}
  {{#each importedTypes}}
  {{this}},
  {{/each}}
{{/if}}
  {{clientClassName}}, 
} from "{{clientPackageName}}";
import { DefaultAzureCredential } from "@azure/identity";
import "dotenv/config";

{{#each samples}}
/**
 * This sample demonstrates how to {{this.operationDescription}}
 *
 * @summary {{this.operationDescription}}
 * x-ms-original-file: {{this.originalFileLocation}}
 */
async function {{this.sampleFunctionName}}(): Promise<void> {
  {{#each this.clientParamAssignments}}
  {{this}}
  {{/each}}
  {{#each this.methodParamAssignments}}
  {{this}}
  {{/each}}
  const credential = new DefaultAzureCredential();
  const client = new {{this.clientClassName}}({{this.clientParameterNames}});
  {{#if this.isPaging}}
  const resArray = new Array();
  for await (const item of client{{#unless this.isTopLevel}}.{{this.operationGroupName}}{{/unless}}.{{this.operationName}}({{this.methodParameterNames}})){
    resArray.push(item);
  }
  console.log(resArray);
  {{else}}  
  const result = await client
    {{#unless this.isTopLevel}}
    .{{this.operationGroupName}}
    {{/unless}}
    .{{this.operationName}}({{this.methodParameterNames}});
  console.log(result);
  
  {{/if}}
}

{{/each}}

async function main(): Promise<void> {
{{#each samples}}
  await {{this.sampleFunctionName}}();
{{/each}}
}

main().catch(console.error);
