Before the first execution of the custom generator, you should run the following scripts:
- Execute the script to build the custom C# generator:
scripts\build-custom-csharp-generator.bat
- Execute the script to generate the C# API client:
scripts\generate-csharp-api-client.bat
cd scripts
build-custom-csharp-generator.bat
generate-csharp-api-client.bat
The mustache templates can be found in generators\csharp\src\main\resources\csharp
. They are part of a Maven project for the custom generator that can be found in generators\csharp
.
You can customize the mustache templates and the supporting class generators\csharp\src\main\java\io\swagger\codegen\CsharpGenerator.java
for new mustache templates, but you need to build the Maven project by executing the scripts\build-custom-csharp-generator.bat
script, or by running mvn clean package
in the root folder of the Maven project.
To run the Swagger Codegen CLI and generate the C# API client from the Open API spec, run the scripts\generate-csharp-api-client.bat
script.
Create a class named ApiTests in the Salesforce.MarketingCloud.Test project. It should have the same content as the ApiTests.cs.template file.
To run the tests, enter valid values for the fields: authBasePath, clientId, clientSecret, accountId.