diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 31a38fbb06be..8c3df5194ac4 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.64.1 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.64.2 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} diff --git a/generation_config.yaml b/generation_config.yaml index 4de31477e58a..90119750970a 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ -gapic_generator_version: 2.64.1 -googleapis_commitish: c9578f6385fe0fb9067c5dba8d7cdda39efac0ff +gapic_generator_version: 2.64.2 +googleapis_commitish: 05f65958eb7f2a8bc59db87ad40487f0fb093097 libraries_bom_version: 26.72.0 # the libraries are ordered with respect to library name, which is diff --git a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/AdUnitServiceClient.java b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/AdUnitServiceClient.java index 46ba651aa350..01c33a7ba335 100644 --- a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/AdUnitServiceClient.java +++ b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/AdUnitServiceClient.java @@ -27,6 +27,7 @@ import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -120,6 +121,132 @@ * * * + *
CreateAdUnit
API to create an `AdUnit` object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *createAdUnit(CreateAdUnitRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *createAdUnit(NetworkName parent, AdUnit adUnit) + *
createAdUnit(String parent, AdUnit adUnit) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *createAdUnitCallable() + *
UpdateAdUnit
API to update an `AdUnit` object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *updateAdUnit(UpdateAdUnitRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *updateAdUnit(AdUnit adUnit, FieldMask updateMask) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *updateAdUnitCallable() + *
BatchCreateAdUnits
API to batch create `AdUnit` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchCreateAdUnits(NetworkName parent, List<CreateAdUnitRequest> requests) + *
batchCreateAdUnits(String parent, List<CreateAdUnitRequest> requests) + *
batchCreateAdUnits(BatchCreateAdUnitsRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchCreateAdUnitsCallable() + *
BatchUpdateAdUnits
API to batch update `AdUnit` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchUpdateAdUnits(NetworkName parent, List<UpdateAdUnitRequest> requests) + *
batchUpdateAdUnits(String parent, List<UpdateAdUnitRequest> requests) + *
batchUpdateAdUnits(BatchUpdateAdUnitsRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchUpdateAdUnitsCallable() + *
BatchActivateAdUnits
API to batch activate `AdUnit` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchActivateAdUnits(BatchActivateAdUnitsRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *batchActivateAdUnits(NetworkName parent, List<String> names) + *
batchActivateAdUnits(String parent, List<String> names) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchActivateAdUnitsCallable() + *
BatchDeactivateAdUnits
Deactivates a list of `AdUnit` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchDeactivateAdUnits(BatchDeactivateAdUnitsRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *batchDeactivateAdUnits(NetworkName parent, List<String> names) + *
batchDeactivateAdUnits(String parent, List<String> names) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchDeactivateAdUnitsCallable() + *
BatchArchiveAdUnits
Archives a list of `AdUnit` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchArchiveAdUnits(BatchArchiveAdUnitsRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *batchArchiveAdUnits(NetworkName parent, List<String> names) + *
batchArchiveAdUnits(String parent, List<String> names) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchArchiveAdUnitsCallable() + *
See the individual methods for example code. @@ -668,6 +795,851 @@ public final ListAdUnitSizesPagedResponse listAdUnitSizes(ListAdUnitSizesRequest return stub.listAdUnitSizesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * API to create an `AdUnit` object. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * AdUnit adUnit = AdUnit.newBuilder().build();
+ * AdUnit response = adUnitServiceClient.createAdUnit(parent, adUnit);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this `AdUnit` will be created. Format:
+ * `networks/{network_code}`
+ * @param adUnit Required. The `AdUnit` to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AdUnit createAdUnit(NetworkName parent, AdUnit adUnit) {
+ CreateAdUnitRequest request =
+ CreateAdUnitRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setAdUnit(adUnit)
+ .build();
+ return createAdUnit(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create an `AdUnit` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * AdUnit adUnit = AdUnit.newBuilder().build();
+ * AdUnit response = adUnitServiceClient.createAdUnit(parent, adUnit);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this `AdUnit` will be created. Format:
+ * `networks/{network_code}`
+ * @param adUnit Required. The `AdUnit` to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AdUnit createAdUnit(String parent, AdUnit adUnit) {
+ CreateAdUnitRequest request =
+ CreateAdUnitRequest.newBuilder().setParent(parent).setAdUnit(adUnit).build();
+ return createAdUnit(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create an `AdUnit` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * CreateAdUnitRequest request =
+ * CreateAdUnitRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setAdUnit(AdUnit.newBuilder().build())
+ * .build();
+ * AdUnit response = adUnitServiceClient.createAdUnit(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AdUnit createAdUnit(CreateAdUnitRequest request) {
+ return createAdUnitCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create an `AdUnit` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * CreateAdUnitRequest request =
+ * CreateAdUnitRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setAdUnit(AdUnit.newBuilder().build())
+ * .build();
+ * ApiFuture future = adUnitServiceClient.createAdUnitCallable().futureCall(request);
+ * // Do something.
+ * AdUnit response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * AdUnit adUnit = AdUnit.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * AdUnit response = adUnitServiceClient.updateAdUnit(adUnit, updateMask);
+ * }
+ * }
+ *
+ * @param adUnit Required. The `AdUnit` to update.
+ * The `AdUnit`'s name is used to identify the `AdUnit` to update. Format: + * `networks/{network_code}/adUnits/{ad_unit_id}` + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AdUnit updateAdUnit(AdUnit adUnit, FieldMask updateMask) { + UpdateAdUnitRequest request = + UpdateAdUnitRequest.newBuilder().setAdUnit(adUnit).setUpdateMask(updateMask).build(); + return updateAdUnit(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * API to update an `AdUnit` object. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * UpdateAdUnitRequest request =
+ * UpdateAdUnitRequest.newBuilder()
+ * .setAdUnit(AdUnit.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * AdUnit response = adUnitServiceClient.updateAdUnit(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AdUnit updateAdUnit(UpdateAdUnitRequest request) {
+ return updateAdUnitCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to update an `AdUnit` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * UpdateAdUnitRequest request =
+ * UpdateAdUnitRequest.newBuilder()
+ * .setAdUnit(AdUnit.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future = adUnitServiceClient.updateAdUnitCallable().futureCall(request);
+ * // Do something.
+ * AdUnit response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List requests = new ArrayList<>();
+ * BatchCreateAdUnitsResponse response =
+ * adUnitServiceClient.batchCreateAdUnits(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `AdUnits` will be created. Format:
+ * `networks/{network_code}` The parent field in the CreateAdUnitRequest must match this
+ * field.
+ * @param requests Required. The `AdUnit` objects to create. A maximum of 100 objects can be
+ * created in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateAdUnitsResponse batchCreateAdUnits(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List requests = new ArrayList<>();
+ * BatchCreateAdUnitsResponse response =
+ * adUnitServiceClient.batchCreateAdUnits(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `AdUnits` will be created. Format:
+ * `networks/{network_code}` The parent field in the CreateAdUnitRequest must match this
+ * field.
+ * @param requests Required. The `AdUnit` objects to create. A maximum of 100 objects can be
+ * created in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateAdUnitsResponse batchCreateAdUnits(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchCreateAdUnitsRequest request =
+ * BatchCreateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * BatchCreateAdUnitsResponse response = adUnitServiceClient.batchCreateAdUnits(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateAdUnitsResponse batchCreateAdUnits(BatchCreateAdUnitsRequest request) {
+ return batchCreateAdUnitsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch create `AdUnit` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchCreateAdUnitsRequest request =
+ * BatchCreateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * adUnitServiceClient.batchCreateAdUnitsCallable().futureCall(request);
+ * // Do something.
+ * BatchCreateAdUnitsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List requests = new ArrayList<>();
+ * BatchUpdateAdUnitsResponse response =
+ * adUnitServiceClient.batchUpdateAdUnits(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `AdUnits` will be updated. Format:
+ * `networks/{network_code}` The parent field in the UpdateAdUnitRequest must match this
+ * field.
+ * @param requests Required. The `AdUnit` objects to update. A maximum of 100 objects can be
+ * updated in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateAdUnitsResponse batchUpdateAdUnits(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List requests = new ArrayList<>();
+ * BatchUpdateAdUnitsResponse response =
+ * adUnitServiceClient.batchUpdateAdUnits(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `AdUnits` will be updated. Format:
+ * `networks/{network_code}` The parent field in the UpdateAdUnitRequest must match this
+ * field.
+ * @param requests Required. The `AdUnit` objects to update. A maximum of 100 objects can be
+ * updated in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateAdUnitsResponse batchUpdateAdUnits(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchUpdateAdUnitsRequest request =
+ * BatchUpdateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * BatchUpdateAdUnitsResponse response = adUnitServiceClient.batchUpdateAdUnits(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateAdUnitsResponse batchUpdateAdUnits(BatchUpdateAdUnitsRequest request) {
+ return batchUpdateAdUnitsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch update `AdUnit` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchUpdateAdUnitsRequest request =
+ * BatchUpdateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * adUnitServiceClient.batchUpdateAdUnitsCallable().futureCall(request);
+ * // Do something.
+ * BatchUpdateAdUnitsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List names = new ArrayList<>();
+ * BatchActivateAdUnitsResponse response =
+ * adUnitServiceClient.batchActivateAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to activate. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateAdUnitsResponse batchActivateAdUnits(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List names = new ArrayList<>();
+ * BatchActivateAdUnitsResponse response =
+ * adUnitServiceClient.batchActivateAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to activate. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateAdUnitsResponse batchActivateAdUnits(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchActivateAdUnitsRequest request =
+ * BatchActivateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * BatchActivateAdUnitsResponse response = adUnitServiceClient.batchActivateAdUnits(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateAdUnitsResponse batchActivateAdUnits(
+ BatchActivateAdUnitsRequest request) {
+ return batchActivateAdUnitsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch activate `AdUnit` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchActivateAdUnitsRequest request =
+ * BatchActivateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * adUnitServiceClient.batchActivateAdUnitsCallable().futureCall(request);
+ * // Do something.
+ * BatchActivateAdUnitsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List names = new ArrayList<>();
+ * BatchDeactivateAdUnitsResponse response =
+ * adUnitServiceClient.batchDeactivateAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to deactivate. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateAdUnitsResponse batchDeactivateAdUnits(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List names = new ArrayList<>();
+ * BatchDeactivateAdUnitsResponse response =
+ * adUnitServiceClient.batchDeactivateAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to deactivate. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateAdUnitsResponse batchDeactivateAdUnits(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchDeactivateAdUnitsRequest request =
+ * BatchDeactivateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * BatchDeactivateAdUnitsResponse response = adUnitServiceClient.batchDeactivateAdUnits(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateAdUnitsResponse batchDeactivateAdUnits(
+ BatchDeactivateAdUnitsRequest request) {
+ return batchDeactivateAdUnitsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deactivates a list of `AdUnit` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchDeactivateAdUnitsRequest request =
+ * BatchDeactivateAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * adUnitServiceClient.batchDeactivateAdUnitsCallable().futureCall(request);
+ * // Do something.
+ * BatchDeactivateAdUnitsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List names = new ArrayList<>();
+ * BatchArchiveAdUnitsResponse response = adUnitServiceClient.batchArchiveAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to archive. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchArchiveAdUnitsResponse batchArchiveAdUnits(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List names = new ArrayList<>();
+ * BatchArchiveAdUnitsResponse response = adUnitServiceClient.batchArchiveAdUnits(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `AdUnit`s to archive. Format:
+ * `networks/{network_code}/adUnits/{ad_unit_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchArchiveAdUnitsResponse batchArchiveAdUnits(String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchArchiveAdUnitsRequest request =
+ * BatchArchiveAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * BatchArchiveAdUnitsResponse response = adUnitServiceClient.batchArchiveAdUnits(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchArchiveAdUnitsResponse batchArchiveAdUnits(BatchArchiveAdUnitsRequest request) {
+ return batchArchiveAdUnitsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a list of `AdUnit` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdUnitServiceClient adUnitServiceClient = AdUnitServiceClient.create()) {
+ * BatchArchiveAdUnitsRequest request =
+ * BatchArchiveAdUnitsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * adUnitServiceClient.batchArchiveAdUnitsCallable().futureCall(request);
+ * // Do something.
+ * BatchArchiveAdUnitsResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableGetCmsMetadataValue
API to retrieve a `CmsMetadataKey` object.
API to retrieve a `CmsMetadataValue` object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
*Sample code: * @@ -215,7 +215,7 @@ public CmsMetadataValueServiceStub getStub() { * } * } * - * @param name Required. The resource name of the CmsMetadataKey. Format: + * @param name Required. The resource name of the CmsMetadataValue. Format: * `networks/{network_code}/cmsMetadataValues/{cms_metadata_value_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -229,7 +229,7 @@ public final CmsMetadataValue getCmsMetadataValue(CmsMetadataValueName name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * API to retrieve a `CmsMetadataKey` object. + * API to retrieve a `CmsMetadataValue` object. * *
Sample code: * @@ -246,7 +246,7 @@ public final CmsMetadataValue getCmsMetadataValue(CmsMetadataValueName name) { * } * } * - * @param name Required. The resource name of the CmsMetadataKey. Format: + * @param name Required. The resource name of the CmsMetadataValue. Format: * `networks/{network_code}/cmsMetadataValues/{cms_metadata_value_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -258,7 +258,7 @@ public final CmsMetadataValue getCmsMetadataValue(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * API to retrieve a `CmsMetadataKey` object. + * API to retrieve a `CmsMetadataValue` object. * *
Sample code: * @@ -287,7 +287,7 @@ public final CmsMetadataValue getCmsMetadataValue(GetCmsMetadataValueRequest req // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * API to retrieve a `CmsMetadataKey` object. + * API to retrieve a `CmsMetadataValue` object. * *
Sample code: * diff --git a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceClient.java b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceClient.java index 5ce3c0035f66..e6b976960a06 100644 --- a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceClient.java +++ b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceClient.java @@ -27,6 +27,7 @@ import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit; @@ -103,6 +104,113 @@ *
CreateCustomTargetingKey
API to create a `CustomTargetingKey` object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *createCustomTargetingKey(CreateCustomTargetingKeyRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *createCustomTargetingKey(NetworkName parent, CustomTargetingKey customTargetingKey) + *
createCustomTargetingKey(String parent, CustomTargetingKey customTargetingKey) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *createCustomTargetingKeyCallable() + *
BatchCreateCustomTargetingKeys
API to batch create `CustomTargetingKey` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchCreateCustomTargetingKeys(NetworkName parent, List<CreateCustomTargetingKeyRequest> requests) + *
batchCreateCustomTargetingKeys(String parent, List<CreateCustomTargetingKeyRequest> requests) + *
batchCreateCustomTargetingKeys(BatchCreateCustomTargetingKeysRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchCreateCustomTargetingKeysCallable() + *
UpdateCustomTargetingKey
API to update a `CustomTargetingKey` object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *updateCustomTargetingKey(UpdateCustomTargetingKeyRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *updateCustomTargetingKey(CustomTargetingKey customTargetingKey, FieldMask updateMask) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *updateCustomTargetingKeyCallable() + *
BatchUpdateCustomTargetingKeys
API to batch update `CustomTargetingKey` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchUpdateCustomTargetingKeys(NetworkName parent, List<UpdateCustomTargetingKeyRequest> requests) + *
batchUpdateCustomTargetingKeys(String parent, List<UpdateCustomTargetingKeyRequest> requests) + *
batchUpdateCustomTargetingKeys(BatchUpdateCustomTargetingKeysRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchUpdateCustomTargetingKeysCallable() + *
BatchActivateCustomTargetingKeys
API to batch activate `CustomTargetingKey` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchActivateCustomTargetingKeys(BatchActivateCustomTargetingKeysRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *batchActivateCustomTargetingKeys(NetworkName parent, List<String> names) + *
batchActivateCustomTargetingKeys(String parent, List<String> names) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchActivateCustomTargetingKeysCallable() + *
BatchDeactivateCustomTargetingKeys
Deactivates a list of `CustomTargetingKey` objects.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *batchDeactivateCustomTargetingKeys(BatchDeactivateCustomTargetingKeysRequest request) + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *batchDeactivateCustomTargetingKeys(NetworkName parent, List<String> names) + *
batchDeactivateCustomTargetingKeys(String parent, List<String> names) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *batchDeactivateCustomTargetingKeysCallable() + *
See the individual methods for example code. @@ -508,6 +616,801 @@ public final ListCustomTargetingKeysPagedResponse listCustomTargetingKeys( return stub.listCustomTargetingKeysCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * API to create a `CustomTargetingKey` object. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
+ * CustomTargetingKey response =
+ * customTargetingKeyServiceClient.createCustomTargetingKey(parent, customTargetingKey);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this `CustomTargetingKey` will be created.
+ * Format: `networks/{network_code}`
+ * @param customTargetingKey Required. The `CustomTargetingKey` to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomTargetingKey createCustomTargetingKey(
+ NetworkName parent, CustomTargetingKey customTargetingKey) {
+ CreateCustomTargetingKeyRequest request =
+ CreateCustomTargetingKeyRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setCustomTargetingKey(customTargetingKey)
+ .build();
+ return createCustomTargetingKey(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create a `CustomTargetingKey` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
+ * CustomTargetingKey response =
+ * customTargetingKeyServiceClient.createCustomTargetingKey(parent, customTargetingKey);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this `CustomTargetingKey` will be created.
+ * Format: `networks/{network_code}`
+ * @param customTargetingKey Required. The `CustomTargetingKey` to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomTargetingKey createCustomTargetingKey(
+ String parent, CustomTargetingKey customTargetingKey) {
+ CreateCustomTargetingKeyRequest request =
+ CreateCustomTargetingKeyRequest.newBuilder()
+ .setParent(parent)
+ .setCustomTargetingKey(customTargetingKey)
+ .build();
+ return createCustomTargetingKey(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create a `CustomTargetingKey` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * CreateCustomTargetingKeyRequest request =
+ * CreateCustomTargetingKeyRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
+ * .build();
+ * CustomTargetingKey response =
+ * customTargetingKeyServiceClient.createCustomTargetingKey(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomTargetingKey createCustomTargetingKey(
+ CreateCustomTargetingKeyRequest request) {
+ return createCustomTargetingKeyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to create a `CustomTargetingKey` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * CreateCustomTargetingKeyRequest request =
+ * CreateCustomTargetingKeyRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient.createCustomTargetingKeyCallable().futureCall(request);
+ * // Do something.
+ * CustomTargetingKey response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List requests = new ArrayList<>();
+ * BatchCreateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `CustomTargetingKeys` will be created.
+ * Format: `networks/{network_code}` The parent field in the CreateCustomTargetingKeyRequest
+ * must match this field.
+ * @param requests Required. The `CustomTargetingKey` objects to create. A maximum of 100 objects
+ * can be created in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List requests = new ArrayList<>();
+ * BatchCreateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `CustomTargetingKeys` will be created.
+ * Format: `networks/{network_code}` The parent field in the CreateCustomTargetingKeyRequest
+ * must match this field.
+ * @param requests Required. The `CustomTargetingKey` objects to create. A maximum of 100 objects
+ * can be created in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchCreateCustomTargetingKeysRequest request =
+ * BatchCreateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * BatchCreateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchCreateCustomTargetingKeys(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchCreateCustomTargetingKeysResponse batchCreateCustomTargetingKeys(
+ BatchCreateCustomTargetingKeysRequest request) {
+ return batchCreateCustomTargetingKeysCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch create `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchCreateCustomTargetingKeysRequest request =
+ * BatchCreateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient
+ * .batchCreateCustomTargetingKeysCallable()
+ * .futureCall(request);
+ * // Do something.
+ * BatchCreateCustomTargetingKeysResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ BatchCreateCustomTargetingKeysRequest, BatchCreateCustomTargetingKeysResponse>
+ batchCreateCustomTargetingKeysCallable() {
+ return stub.batchCreateCustomTargetingKeysCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to update a `CustomTargetingKey` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * CustomTargetingKey customTargetingKey = CustomTargetingKey.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CustomTargetingKey response =
+ * customTargetingKeyServiceClient.updateCustomTargetingKey(customTargetingKey, updateMask);
+ * }
+ * }
+ *
+ * @param customTargetingKey Required. The `CustomTargetingKey` to update.
+ * The `CustomTargetingKey`'s `name` is used to identify the `CustomTargetingKey` to + * update. + * @param updateMask Required. The list of fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomTargetingKey updateCustomTargetingKey( + CustomTargetingKey customTargetingKey, FieldMask updateMask) { + UpdateCustomTargetingKeyRequest request = + UpdateCustomTargetingKeyRequest.newBuilder() + .setCustomTargetingKey(customTargetingKey) + .setUpdateMask(updateMask) + .build(); + return updateCustomTargetingKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * API to update a `CustomTargetingKey` object. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * UpdateCustomTargetingKeyRequest request =
+ * UpdateCustomTargetingKeyRequest.newBuilder()
+ * .setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * CustomTargetingKey response =
+ * customTargetingKeyServiceClient.updateCustomTargetingKey(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomTargetingKey updateCustomTargetingKey(
+ UpdateCustomTargetingKeyRequest request) {
+ return updateCustomTargetingKeyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to update a `CustomTargetingKey` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * UpdateCustomTargetingKeyRequest request =
+ * UpdateCustomTargetingKeyRequest.newBuilder()
+ * .setCustomTargetingKey(CustomTargetingKey.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient.updateCustomTargetingKeyCallable().futureCall(request);
+ * // Do something.
+ * CustomTargetingKey response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List requests = new ArrayList<>();
+ * BatchUpdateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `CustomTargetingKeys` will be updated.
+ * Format: `networks/{network_code}` The parent field in the UpdateCustomTargetingKeyRequest
+ * must match this field.
+ * @param requests Required. The `CustomTargetingKey` objects to update. A maximum of 100 objects
+ * can be updated in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List requests = new ArrayList<>();
+ * BatchUpdateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(parent, requests);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where `CustomTargetingKeys` will be updated.
+ * Format: `networks/{network_code}` The parent field in the UpdateCustomTargetingKeyRequest
+ * must match this field.
+ * @param requests Required. The `CustomTargetingKey` objects to update. A maximum of 100 objects
+ * can be updated in a batch.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchUpdateCustomTargetingKeysRequest request =
+ * BatchUpdateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * BatchUpdateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchUpdateCustomTargetingKeys(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchUpdateCustomTargetingKeysResponse batchUpdateCustomTargetingKeys(
+ BatchUpdateCustomTargetingKeysRequest request) {
+ return batchUpdateCustomTargetingKeysCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch update `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchUpdateCustomTargetingKeysRequest request =
+ * BatchUpdateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllRequests(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient
+ * .batchUpdateCustomTargetingKeysCallable()
+ * .futureCall(request);
+ * // Do something.
+ * BatchUpdateCustomTargetingKeysResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ BatchUpdateCustomTargetingKeysRequest, BatchUpdateCustomTargetingKeysResponse>
+ batchUpdateCustomTargetingKeysCallable() {
+ return stub.batchUpdateCustomTargetingKeysCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch activate `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List names = new ArrayList<>();
+ * BatchActivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `CustomTargetingKey`s to activate. Format:
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List names = new ArrayList<>();
+ * BatchActivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `CustomTargetingKey`s to activate. Format:
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchActivateCustomTargetingKeysRequest request =
+ * BatchActivateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * BatchActivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchActivateCustomTargetingKeys(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchActivateCustomTargetingKeysResponse batchActivateCustomTargetingKeys(
+ BatchActivateCustomTargetingKeysRequest request) {
+ return batchActivateCustomTargetingKeysCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to batch activate `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchActivateCustomTargetingKeysRequest request =
+ * BatchActivateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient
+ * .batchActivateCustomTargetingKeysCallable()
+ * .futureCall(request);
+ * // Do something.
+ * BatchActivateCustomTargetingKeysResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ BatchActivateCustomTargetingKeysRequest, BatchActivateCustomTargetingKeysResponse>
+ batchActivateCustomTargetingKeysCallable() {
+ return stub.batchActivateCustomTargetingKeysCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deactivates a list of `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * List names = new ArrayList<>();
+ * BatchDeactivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `CustomTargetingKey`s to deactivate. Format:
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(
+ NetworkName parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * List names = new ArrayList<>();
+ * BatchDeactivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(parent, names);
+ * }
+ * }
+ *
+ * @param parent Required. Format: `networks/{network_code}`
+ * @param names Required. The resource names of the `CustomTargetingKey`s to deactivate. Format:
+ * `networks/{network_code}/customTargetingKeys/{custom_targeting_key_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(
+ String parent, ListSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchDeactivateCustomTargetingKeysRequest request =
+ * BatchDeactivateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * BatchDeactivateCustomTargetingKeysResponse response =
+ * customTargetingKeyServiceClient.batchDeactivateCustomTargetingKeys(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BatchDeactivateCustomTargetingKeysResponse batchDeactivateCustomTargetingKeys(
+ BatchDeactivateCustomTargetingKeysRequest request) {
+ return batchDeactivateCustomTargetingKeysCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deactivates a list of `CustomTargetingKey` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CustomTargetingKeyServiceClient customTargetingKeyServiceClient =
+ * CustomTargetingKeyServiceClient.create()) {
+ * BatchDeactivateCustomTargetingKeysRequest request =
+ * BatchDeactivateCustomTargetingKeysRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .addAllNames(new ArrayList())
+ * .build();
+ * ApiFuture future =
+ * customTargetingKeyServiceClient
+ * .batchDeactivateCustomTargetingKeysCallable()
+ * .futureCall(request);
+ * // Do something.
+ * BatchDeactivateCustomTargetingKeysResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ BatchDeactivateCustomTargetingKeysRequest, BatchDeactivateCustomTargetingKeysResponse>
+ batchDeactivateCustomTargetingKeysCallable() {
+ return stub.batchDeactivateCustomTargetingKeysCallable();
+ }
+
@Override
public final void close() {
stub.close();
diff --git a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceSettings.java b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceSettings.java
index b073614fe91a..8bf674cc52d2 100644
--- a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceSettings.java
+++ b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/CustomTargetingKeyServiceSettings.java
@@ -105,6 +105,52 @@ public class CustomTargetingKeyServiceSettings
.listCustomTargetingKeysSettings();
}
+ /** Returns the object with the settings used for calls to createCustomTargetingKey. */
+ public UnaryCallSettingsThis class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * LineItemName name = LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]");
+ * LineItem response = lineItemServiceClient.getLineItem(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the LineItemServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *
| Method | + *Description | + *Method Variants | + *
|---|---|---|
GetLineItem |
+ * API to retrieve a `LineItem` object. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListLineItems |
+ * API to retrieve a list of `LineItem` objects. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of LineItemServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LineItemServiceSettings lineItemServiceSettings =
+ * LineItemServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * LineItemServiceClient lineItemServiceClient =
+ * LineItemServiceClient.create(lineItemServiceSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LineItemServiceSettings lineItemServiceSettings =
+ * LineItemServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LineItemServiceClient lineItemServiceClient =
+ * LineItemServiceClient.create(lineItemServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class LineItemServiceClient implements BackgroundResource { + private final LineItemServiceSettings settings; + private final LineItemServiceStub stub; + + /** Constructs an instance of LineItemServiceClient with default settings. */ + public static final LineItemServiceClient create() throws IOException { + return create(LineItemServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LineItemServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final LineItemServiceClient create(LineItemServiceSettings settings) + throws IOException { + return new LineItemServiceClient(settings); + } + + /** + * Constructs an instance of LineItemServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(LineItemServiceSettings). + */ + public static final LineItemServiceClient create(LineItemServiceStub stub) { + return new LineItemServiceClient(stub); + } + + /** + * Constructs an instance of LineItemServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected LineItemServiceClient(LineItemServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LineItemServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected LineItemServiceClient(LineItemServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LineItemServiceSettings getSettings() { + return settings; + } + + public LineItemServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * API to retrieve a `LineItem` object. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * LineItemName name = LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]");
+ * LineItem response = lineItemServiceClient.getLineItem(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the LineItem. Format:
+ * `networks/{network_code}/lineItems/{line_item_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LineItem getLineItem(LineItemName name) {
+ GetLineItemRequest request =
+ GetLineItemRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getLineItem(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a `LineItem` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * String name = LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]").toString();
+ * LineItem response = lineItemServiceClient.getLineItem(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the LineItem. Format:
+ * `networks/{network_code}/lineItems/{line_item_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LineItem getLineItem(String name) {
+ GetLineItemRequest request = GetLineItemRequest.newBuilder().setName(name).build();
+ return getLineItem(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a `LineItem` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * GetLineItemRequest request =
+ * GetLineItemRequest.newBuilder()
+ * .setName(LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]").toString())
+ * .build();
+ * LineItem response = lineItemServiceClient.getLineItem(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LineItem getLineItem(GetLineItemRequest request) {
+ return getLineItemCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a `LineItem` object.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * GetLineItemRequest request =
+ * GetLineItemRequest.newBuilder()
+ * .setName(LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]").toString())
+ * .build();
+ * ApiFuture future = lineItemServiceClient.getLineItemCallable().futureCall(request);
+ * // Do something.
+ * LineItem response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * NetworkName parent = NetworkName.of("[NETWORK_CODE]");
+ * for (LineItem element : lineItemServiceClient.listLineItems(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of LineItems. Format:
+ * `networks/{network_code}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLineItemsPagedResponse listLineItems(NetworkName parent) {
+ ListLineItemsRequest request =
+ ListLineItemsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listLineItems(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a list of `LineItem` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * String parent = NetworkName.of("[NETWORK_CODE]").toString();
+ * for (LineItem element : lineItemServiceClient.listLineItems(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent, which owns this collection of LineItems. Format:
+ * `networks/{network_code}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLineItemsPagedResponse listLineItems(String parent) {
+ ListLineItemsRequest request = ListLineItemsRequest.newBuilder().setParent(parent).build();
+ return listLineItems(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a list of `LineItem` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * ListLineItemsRequest request =
+ * ListLineItemsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setSkip(3532159)
+ * .build();
+ * for (LineItem element : lineItemServiceClient.listLineItems(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLineItemsPagedResponse listLineItems(ListLineItemsRequest request) {
+ return listLineItemsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * API to retrieve a list of `LineItem` objects.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * ListLineItemsRequest request =
+ * ListLineItemsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setSkip(3532159)
+ * .build();
+ * ApiFuture future =
+ * lineItemServiceClient.listLineItemsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (LineItem element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * ListLineItemsRequest request =
+ * ListLineItemsRequest.newBuilder()
+ * .setParent(NetworkName.of("[NETWORK_CODE]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setSkip(3532159)
+ * .build();
+ * while (true) {
+ * ListLineItemsResponse response =
+ * lineItemServiceClient.listLineItemsCallable().call(request);
+ * for (LineItem element : response.getLineItemsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLineItem: + * + *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LineItemServiceSettings.Builder lineItemServiceSettingsBuilder =
+ * LineItemServiceSettings.newBuilder();
+ * lineItemServiceSettingsBuilder
+ * .getLineItemSettings()
+ * .setRetrySettings(
+ * lineItemServiceSettingsBuilder
+ * .getLineItemSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * LineItemServiceSettings lineItemServiceSettings = lineItemServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
+ * additional support in setting retries.
+ */
+@Generated("by gapic-generator-java")
+public class LineItemServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listNetworksPagedCallable()
* listNetworksCallable()
* Sample code:
+ *
+ * ======================= LineItemServiceClient =======================
+ *
+ * Service Description: Provides methods for handling `LineItem` objects.
+ *
+ * Sample for LineItemServiceClient:
+ *
+ * ======================= MobileCarrierServiceClient =======================
*
* Service Description: Provides methods for handling `MobileCarrier` objects.
diff --git a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/stub/AdUnitServiceStub.java b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/stub/AdUnitServiceStub.java
index 17692204c601..7eff6fb50c77 100644
--- a/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/stub/AdUnitServiceStub.java
+++ b/java-admanager/ad-manager/src/main/java/com/google/ads/admanager/v1/stub/AdUnitServiceStub.java
@@ -20,11 +20,23 @@
import static com.google.ads.admanager.v1.AdUnitServiceClient.ListAdUnitsPagedResponse;
import com.google.ads.admanager.v1.AdUnit;
+import com.google.ads.admanager.v1.BatchActivateAdUnitsRequest;
+import com.google.ads.admanager.v1.BatchActivateAdUnitsResponse;
+import com.google.ads.admanager.v1.BatchArchiveAdUnitsRequest;
+import com.google.ads.admanager.v1.BatchArchiveAdUnitsResponse;
+import com.google.ads.admanager.v1.BatchCreateAdUnitsRequest;
+import com.google.ads.admanager.v1.BatchCreateAdUnitsResponse;
+import com.google.ads.admanager.v1.BatchDeactivateAdUnitsRequest;
+import com.google.ads.admanager.v1.BatchDeactivateAdUnitsResponse;
+import com.google.ads.admanager.v1.BatchUpdateAdUnitsRequest;
+import com.google.ads.admanager.v1.BatchUpdateAdUnitsResponse;
+import com.google.ads.admanager.v1.CreateAdUnitRequest;
import com.google.ads.admanager.v1.GetAdUnitRequest;
import com.google.ads.admanager.v1.ListAdUnitSizesRequest;
import com.google.ads.admanager.v1.ListAdUnitSizesResponse;
import com.google.ads.admanager.v1.ListAdUnitsRequest;
import com.google.ads.admanager.v1.ListAdUnitsResponse;
+import com.google.ads.admanager.v1.UpdateAdUnitRequest;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import javax.annotation.Generated;
@@ -59,6 +71,39 @@ public UnaryCallable
+ *
*
@@ -298,16 +307,23 @@ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (NetworkServiceClient networkServiceClient = NetworkServiceClient.create()) {
+ * ListNetworksRequest request =
+ * ListNetworksRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setSkip(3532159)
+ * .build();
+ * while (true) {
+ * ListNetworksResponse response = networkServiceClient.listNetworksCallable().call(request);
+ * for (Network element : response.getNetworksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
* }
* }
*/
@@ -364,4 +426,79 @@ public void shutdownNow() {
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return stub.awaitTermination(duration, unit);
}
+
+ public static class ListNetworksPagedResponse
+ extends AbstractPagedListResponse<
+ ListNetworksRequest,
+ ListNetworksResponse,
+ Network,
+ ListNetworksPage,
+ ListNetworksFixedSizeCollection> {
+
+ public static ApiFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LineItemServiceClient lineItemServiceClient = LineItemServiceClient.create()) {
+ * LineItemName name = LineItemName.of("[NETWORK_CODE]", "[LINE_ITEM]");
+ * LineItem response = lineItemServiceClient.getLineItem(name);
+ * }
+ * }
+ *
*