2222import static org .apache .beam .vendor .guava .v32_1_2_jre .com .google .common .base .Preconditions .checkArgument ;
2323
2424import com .google .ads .googleads .lib .GoogleAdsClient ;
25- import com .google .ads .googleads .v19 .errors .GoogleAdsError ;
26- import com .google .ads .googleads .v19 .errors .GoogleAdsException ;
27- import com .google .ads .googleads .v19 .errors .GoogleAdsFailure ;
28- import com .google .ads .googleads .v19 .errors .InternalErrorEnum ;
29- import com .google .ads .googleads .v19 .errors .QuotaErrorEnum ;
30- import com .google .ads .googleads .v19 .services .GoogleAdsRow ;
31- import com .google .ads .googleads .v19 .services .GoogleAdsServiceClient ;
32- import com .google .ads .googleads .v19 .services .SearchGoogleAdsStreamRequest ;
33- import com .google .ads .googleads .v19 .services .SearchGoogleAdsStreamResponse ;
25+ import com .google .ads .googleads .v23 .errors .GoogleAdsError ;
26+ import com .google .ads .googleads .v23 .errors .GoogleAdsException ;
27+ import com .google .ads .googleads .v23 .errors .GoogleAdsFailure ;
28+ import com .google .ads .googleads .v23 .errors .InternalErrorEnum ;
29+ import com .google .ads .googleads .v23 .errors .QuotaErrorEnum ;
30+ import com .google .ads .googleads .v23 .services .GoogleAdsRow ;
31+ import com .google .ads .googleads .v23 .services .GoogleAdsServiceClient ;
32+ import com .google .ads .googleads .v23 .services .SearchGoogleAdsStreamRequest ;
33+ import com .google .ads .googleads .v23 .services .SearchGoogleAdsStreamResponse ;
3434import com .google .auto .value .AutoValue ;
3535import com .google .protobuf .Message ;
3636import com .google .protobuf .util .Durations ;
5757import org .joda .time .Duration ;
5858
5959/**
60- * {@link GoogleAdsV19 } provides an API to read Google Ads API v19 reports.
60+ * {@link GoogleAdsV23 } provides an API to read Google Ads API v23 reports.
6161 *
6262 * <p>No backward compatibility guaranteed. Do not use directly. Use {@link GoogleAdsIO#current()}
6363 * to access GoogleAdsIO instead.
7979 * --googleAdsDeveloperToken=your-developer-token
8080 * </pre>
8181 *
82- * <p>Use {@link GoogleAdsV19 #read()} to read either a bounded or unbounded {@link PCollection} of
82+ * <p>Use {@link GoogleAdsV23 #read()} to read either a bounded or unbounded {@link PCollection} of
8383 * {@link GoogleAdsRow} from a single <a
8484 * href="https://developers.google.com/google-ads/api/docs/query/overview">Google Ads Query
8585 * Language</a> query using {@link Read#withQuery(String)} and a {@link PCollection} of customer
86- * IDs. Alternatively, use {@link GoogleAdsV19 #readAll()} to read either a bounded or unbounded
86+ * IDs. Alternatively, use {@link GoogleAdsV23 #readAll()} to read either a bounded or unbounded
8787 * {@link PCollection} of {@link GoogleAdsRow} from a {@link PCollection} of {@link
8888 * SearchGoogleAdsStreamRequest} potentially containing many different queries.
8989 *
90- * <p>For example, using {@link GoogleAdsV19 #read()}:
90+ * <p>For example, using {@link GoogleAdsV23 #read()}:
9191 *
9292 * <pre>{@code
9393 * Pipeline p = Pipeline.create();
107107 * p.run();
108108 * }</pre>
109109 *
110- * <p>Alternatively, using {@link GoogleAdsV19 #readAll()} to execute requests from a {@link
110+ * <p>Alternatively, using {@link GoogleAdsV23 #readAll()} to execute requests from a {@link
111111 * PCollection} of {@link SearchGoogleAdsStreamRequest}:
112112 *
113113 * <pre>{@code
132132 *
133133 * <h2>Client-side rate limiting</h2>
134134 *
135- * On construction of a {@link GoogleAdsV19 #read()} or {@link GoogleAdsV19 #readAll()} transform a
135+ * On construction of a {@link GoogleAdsV23 #read()} or {@link GoogleAdsV23 #readAll()} transform a
136136 * rate limiting policy must be specified to stay well under the assigned quota for the Google Ads
137137 * API. The Google Ads API enforces global rate limits from the developer token down to the customer
138138 * ID and depending on the access level of the developer token a limit on the total number of
161161 * @see <a href="https://developers.google.com/google-ads/api/docs/best-practices/overview">Best
162162 * Practices in the Google Ads documentation</a>
163163 */
164- public class GoogleAdsV19 extends GoogleAdsIO <GoogleAdsRow , SearchGoogleAdsStreamRequest > {
165- static final GoogleAdsV19 INSTANCE = new GoogleAdsV19 ();
164+ public class GoogleAdsV23 extends GoogleAdsIO <GoogleAdsRow , SearchGoogleAdsStreamRequest > {
165+ static final GoogleAdsV23 INSTANCE = new GoogleAdsV23 ();
166166
167- private GoogleAdsV19 () {}
167+ private GoogleAdsV23 () {}
168168
169169 @ Override
170170 public Read read () {
171- return new AutoValue_GoogleAdsV19_Read .Builder ()
171+ return new AutoValue_GoogleAdsV23_Read .Builder ()
172172 .setGoogleAdsClientFactory (DefaultGoogleAdsClientFactory .getInstance ())
173173 .build ();
174174 }
175175
176176 @ Override
177177 public ReadAll readAll () {
178- return new AutoValue_GoogleAdsV19_ReadAll .Builder ()
178+ return new AutoValue_GoogleAdsV23_ReadAll .Builder ()
179179 .setGoogleAdsClientFactory (DefaultGoogleAdsClientFactory .getInstance ())
180180 .build ();
181181 }
@@ -450,13 +450,13 @@ static class ReadAllFn extends DoFn<SearchGoogleAdsStreamRequest, GoogleAdsRow>
450450
451451 @ VisibleForTesting static Sleeper sleeper = Sleeper .DEFAULT ;
452452
453- private final GoogleAdsV19 .ReadAll spec ;
453+ private final GoogleAdsV23 .ReadAll spec ;
454454
455455 private transient @ Nullable GoogleAdsClient googleAdsClient ;
456456 private transient @ Nullable GoogleAdsServiceClient googleAdsServiceClient ;
457457 private transient @ Nullable RateLimitPolicy <GoogleAdsError > rateLimitPolicy ;
458458
459- ReadAllFn (GoogleAdsV19 .ReadAll spec ) {
459+ ReadAllFn (GoogleAdsV23 .ReadAll spec ) {
460460 this .spec = spec ;
461461 }
462462
@@ -470,7 +470,7 @@ public void setup(PipelineOptions options) {
470470 .newGoogleAdsClient (
471471 adsOptions , spec .getDeveloperToken (), null , spec .getLoginCustomerId ());
472472 final GoogleAdsServiceClient googleAdsServiceClient =
473- googleAdsClient .getVersion19 ().createGoogleAdsServiceClient ();
473+ googleAdsClient .getVersion23 ().createGoogleAdsServiceClient ();
474474 final RateLimitPolicy <GoogleAdsError > rateLimitPolicy =
475475 checkStateNotNull (spec .getRateLimitPolicyFactory ()).getRateLimitPolicy ();
476476
@@ -578,17 +578,17 @@ private Optional<GoogleAdsError> findFirstRetryableError(GoogleAdsFailure e) {
578578 * global (per pipeline or otherwise) rate limit to requests and should not be used in deployments
579579 * where the Google Ads API quota is shared between multiple applications.
580580 *
581- * <p>This policy can be used to limit requests across all {@link GoogleAdsV19 .Read} or {@link
582- * GoogleAdsV19 .ReadAll} transforms by defining and using a {@link
583- * GoogleAdsV19 .RateLimitPolicyFactory} which holds a shared static {@link
584- * GoogleAdsV19 .SimpleRateLimitPolicy}. Note that the desired rate must be divided by the expected
581+ * <p>This policy can be used to limit requests across all {@link GoogleAdsV23 .Read} or {@link
582+ * GoogleAdsV23 .ReadAll} transforms by defining and using a {@link
583+ * GoogleAdsV23 .RateLimitPolicyFactory} which holds a shared static {@link
584+ * GoogleAdsV23 .SimpleRateLimitPolicy}. Note that the desired rate must be divided by the expected
585585 * maximum number of workers for the pipeline, otherwise the pipeline may exceed the desired rate
586586 * after an upscaling event.
587587 *
588588 * <pre>{@code
589589 * public class SimpleRateLimitPolicyFactory implements GoogleAdsIO.RateLimitPolicyFactory {
590590 * private static final GoogleAdsIO.RateLimitPolicy POLICY =
591- * new GoogleAdsV19 .SimpleRateLimitPolicy(1.0 / 1000.0);
591+ * new GoogleAdsV23 .SimpleRateLimitPolicy(1.0 / 1000.0);
592592 *
593593 * @Override
594594 * public GoogleAdsIO.RateLimitPolicy getRateLimitPolicy() {
0 commit comments