LindaLawton / Google-Dotnet-Samples

Unoffical Samples for the Google APIs .Net client library.
http://www.daimto.com/google-apis-samples/
Apache License 2.0
246 stars 355 forks source link

Automatic Sample generation #9

Closed LindaLawton closed 7 years ago

LindaLawton commented 9 years ago

I am currently working on an application that automatically generates standardized Sample projects for the Google .net client library.

  1. Reads from the Discovery services API
  2. Uses T4 template files for standardized Generation.
  3. Phase one generates simple console applications.
  4. Samples will be released under the Apache License like the Google .net client library unless someone has a better idea.

I currently have 135 sample projects generated size 85 mb in total. I am generating for all versions of the APIs found in the Discovery services.

My hope is this will give us a way of creating some best practices standards for usage of the Client library. The code should be simple to use and make it easier for new developers to access the Google APIs. Each method supplies a link directly to its documentation on Google developers website, and gives information on the different parameters needed to make the request.

Example

I will upload a single generated example in a branch so that we can do a code review before I upload them all. This will probably be either Google Analytics or Google Drive as i know those APIs the best and we will be able to work out how to show usage of upload and download.

Sample currently under review: Google Analytics v3

Issues

I am unable to programmatic create the packages.config users will have to run the NuGet package manually to get the necessary references to run the application. I have added a link and the command to the README.md for each project directly to the package needed. I was hoping we could have just used NuGet package restore but currently this isn't possible.

I would like to see if i can find a way of validating the public API key, client id, client secret, and service account email addresses for the Authentication methods. Validating Google credentials

Future Plans I would like to automated it so that the application checks for changes in Discovery services and regenerates a new sample when needed and uploads them directly to GitHub. For this to work the application will need to build the sample as well to insure there are no errors. There is a problem with this due to the in ability to generate the packages.config. Build will have to add the NuGet package we can not rely on NuGet package restore.

Note: Because I am using T4 templates it will be possible to create templates for the other client library's at a later date. This issue will only be related to generation of the .net samples.

LindaLawton commented 9 years ago

Update I am working with the Google Analytics API team to automatically import the sample code to the documentation. Once we have templates for all of the langues we will be able to standardize and ensure that we can have up to-date examples in all of the documentation pages.

LindaLawton commented 7 years ago

Samples are now being generated automatically. No way to fix the issue with Google Analytics V4