Class GeneratedCatalogCodeGenerator

  • All Implemented Interfaces:
    Generator

    public class GeneratedCatalogCodeGenerator
    extends java.lang.Object
    implements Generator
    Generates code for and writes the GeneratedCatalog class, which provides methods to access a GoogleAdsVersion object for each available version of the library. In turn, each GoogleAdsVersion provides methods to create service clients for every service that is available in a given version of the Google Ads library.

    Example generated code snippets:

      public GoogleAdsVersion getVersion1() {
        return new V1Client(provider, credentials);
      }
      ...
      private static class V1Client implements GoogleAdsVersion {
      ...
        public UserListServiceClient createUserListServiceClient() {
        ...
        }
      ...
      }
      
    • Constructor Summary

      Constructors 
      Constructor Description
      GeneratedCatalogCodeGenerator​(java.util.Set<java.lang.Integer> versions, int latestVersion, com.google.common.collect.ImmutableMap<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor,​java.lang.Class<?>> allVersionDescriptors, java.io.File targetDirectory)
      Creates and instance of the generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.squareup.javapoet.JavaFile generate()
      Generates the code for the GeneratedCatalog class and writes the file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeneratedCatalogCodeGenerator

        public GeneratedCatalogCodeGenerator​(java.util.Set<java.lang.Integer> versions,
                                             int latestVersion,
                                             com.google.common.collect.ImmutableMap<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor,​java.lang.Class<?>> allVersionDescriptors,
                                             java.io.File targetDirectory)
        Creates and instance of the generator.
        Parameters:
        versions - available versions of the Google Ads library.
        latestVersion - the latest available version of the Google Ads library.
        allVersionDescriptors -
    • Method Detail

      • generate

        public com.squareup.javapoet.JavaFile generate()
        Generates the code for the GeneratedCatalog class and writes the file.
        Specified by:
        generate in interface Generator
        Returns: