Package com.google.ads.googleads.codegen
Class GeneratedCatalogCodeGenerator
java.lang.Object
com.google.ads.googleads.codegen.GeneratedCatalogCodeGenerator
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionGeneratedCatalogCodeGenerator(Set<Integer> versions, int latestVersion, com.google.common.collect.ImmutableMap<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor, Class<?>> allVersionDescriptors, File targetDirectory) Creates and instance of the generator. -
Method Summary
Modifier and TypeMethodDescriptioncom.squareup.javapoet.JavaFilegenerate()Generates the code for the GeneratedCatalog class and writes the file.
-
Constructor Details
-
GeneratedCatalogCodeGenerator
public GeneratedCatalogCodeGenerator(Set<Integer> versions, int latestVersion, com.google.common.collect.ImmutableMap<com.google.ads.googleads.lib.stubs.annotations.VersionDescriptor, Class<?>> allVersionDescriptors, 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 Details