// This file is auto generated by Teams Toolkit to provide you instructions and reference code to call your API.

/*
Next steps:
1. Run npm install. We added the @microsoft/teamsfx to your package.json.
   You need to run the command under the "{{component}}" folder (instead of your project root folder).
{{#if (equals config.AuthConfig.AuthType "basic")}}
2. Add your user password to TEAMSFX_API_{{capitalName}}_PASSWORD in `{{component}}/.env.teamsfx.local`.
{{else if (equals config.AuthConfig.AuthType "aad")}}
    {{#if (equals config.AuthConfig.ReuseTeamsApp false)}}
2. Replace "<your-api-scope>" in this file with actual scope required by the API.
3. Set `TEAMSFX_API_{{capitalName}}_CLIENT_SECRET` to your client secret in the file `{{component}}/.env.teamsfx.local`.
    {{else}}
2. Replace "<your-api-scope>" in this file with actual scope required by the API.
3. Refer https://aka.ms/teamsfx-connect-api-with-aad for configuring AAD app and consent scopes.
    {{/if}}
{{else if (equals config.AuthConfig.AuthType "apikey")}}
2. Set `TEAMSFX_API_{{capitalName}}_API_KEY` to your API key in the file `{{component}}/.env.teamsfx.local`.
{{else if (equals config.AuthConfig.AuthType "cert")}}
2. Add code to read your certificate content and replace "<your-cert>" and "<your-private-key>" with the actual values.
{{else if (equals config.AuthConfig.AuthType "custom")}}
2. Refer to the sample code and comments in this file to implement your custom auth provider.
{{/if}}

{{#if (equals languageExt "js")}}
It is also recommended to put all the configurations into config.js file.
{{else}}
It is also recommended to put all the configurations into config.ts file.
{{/if}}

You can import the API client (an Axios instance) in another file and call {{config.APIName}} APIs and authentication is now handled for you automatically.

Here is an example for a GET request to "relative_path_of_target_api":
```
{{#if (equals languageExt "js")}}
const { {{config.APIName}}Client } = require("relative_path_to_this_file");
{{else}}
import { {{config.APIName}}Client } from "relative_path_to_this_file";
{{/if}}

const response = await {{config.APIName}}Client.get("relative_path_of_target_api");
// You only need to enter the relative path for your API.
// For example, if you want to call api https://my-api-endpoint/test and you configured https://my-api-endpoint as the API endpoint,
// your code will be: const response = await {{config.APIName}}Client.get("test");

const responseBody = response.data;
```

If you added this API while local debugging, stop local debugging and start again because local debugging will not hot reload changes to `.env.teamsfx.local`.

Refer to https://aka.ms/teamsfx-connect-api to learn more. 
*/