Class ForecastAdjustmentServiceClient (0.62.0)

GitHub RepositoryProduct Reference

Service Description: Provides methods for handling ForecastAdjustment objects.

This 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:


 // 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ForecastAdjustmentName name =
       ForecastAdjustmentName.of("[NETWORK_CODE]", "[FORECAST_ADJUSTMENT]");
   ForecastAdjustment response = forecastAdjustmentServiceClient.getForecastAdjustment(name);
 }
 

Note: close() needs to be called on the ForecastAdjustmentServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

GetForecastAdjustment

Retrieves a ForecastAdjustment object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getForecastAdjustment(GetForecastAdjustmentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getForecastAdjustment(ForecastAdjustmentName name)

  • getForecastAdjustment(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getForecastAdjustmentCallable()

ListForecastAdjustments

Lists ForecastAdjustment objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listForecastAdjustments(ListForecastAdjustmentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listForecastAdjustments(NetworkName parent)

  • listForecastAdjustments(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listForecastAdjustmentsPagedCallable()

  • listForecastAdjustmentsCallable()

CreateForecastAdjustment

Creates a ForecastAdjustment object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createForecastAdjustment(CreateForecastAdjustmentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createForecastAdjustment(NetworkName parent, ForecastAdjustment forecastAdjustment)

  • createForecastAdjustment(String parent, ForecastAdjustment forecastAdjustment)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createForecastAdjustmentCallable()

BatchCreateForecastAdjustments

Creates ForecastAdjustment objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchCreateForecastAdjustments(NetworkName parent, List<CreateForecastAdjustmentRequest> requests)

  • batchCreateForecastAdjustments(String parent, List<CreateForecastAdjustmentRequest> requests)

  • batchCreateForecastAdjustments(BatchCreateForecastAdjustmentsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchCreateForecastAdjustmentsCallable()

BatchActivateForecastAdjustments

Activates a list of ForecastAdjustment objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchActivateForecastAdjustments(BatchActivateForecastAdjustmentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • batchActivateForecastAdjustments(NetworkName parent, List<String> names)

  • batchActivateForecastAdjustments(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.

  • batchActivateForecastAdjustmentsCallable()

BatchDeactivateForecastAdjustments

Deactivates a list of ForecastAdjustment objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchDeactivateForecastAdjustments(BatchDeactivateForecastAdjustmentsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • batchDeactivateForecastAdjustments(NetworkName parent, List<String> names)

  • batchDeactivateForecastAdjustments(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.

  • batchDeactivateForecastAdjustmentsCallable()

UpdateForecastAdjustment

Updates a ForecastAdjustment object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateForecastAdjustment(UpdateForecastAdjustmentRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateForecastAdjustment(ForecastAdjustment forecastAdjustment, 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.

  • updateForecastAdjustmentCallable()

BatchUpdateForecastAdjustments

Batch updates ForecastAdjustment objects.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • batchUpdateForecastAdjustments(NetworkName parent, List<UpdateForecastAdjustmentRequest> requests)

  • batchUpdateForecastAdjustments(String parent, List<UpdateForecastAdjustmentRequest> requests)

  • batchUpdateForecastAdjustments(BatchUpdateForecastAdjustmentsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • batchUpdateForecastAdjustmentsCallable()

CalculateDailyAdOpportunityCounts

Calculates daily ad opportunity counts for a prospective ForecastAdjustment object.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • calculateDailyAdOpportunityCounts(CalculateDailyAdOpportunityCountsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • calculateDailyAdOpportunityCounts(NetworkName parent, ForecastAdjustment forecastAdjustment)

  • calculateDailyAdOpportunityCounts(String parent, ForecastAdjustment forecastAdjustment)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • calculateDailyAdOpportunityCountsCallable()

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 ForecastAdjustmentServiceSettings to create(). For example:

To customize credentials:


 // 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
 ForecastAdjustmentServiceSettings forecastAdjustmentServiceSettings =
     ForecastAdjustmentServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create(forecastAdjustmentServiceSettings);
 

To customize the endpoint:


 // 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
 ForecastAdjustmentServiceSettings forecastAdjustmentServiceSettings =
     ForecastAdjustmentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create(forecastAdjustmentServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ForecastAdjustmentServiceClient

Static Methods

create()

public static final ForecastAdjustmentServiceClient create()

Constructs an instance of ForecastAdjustmentServiceClient with default settings.

Returns
Type Description
ForecastAdjustmentServiceClient
Exceptions
Type Description
IOException

create(ForecastAdjustmentServiceSettings settings)

public static final ForecastAdjustmentServiceClient create(ForecastAdjustmentServiceSettings settings)

Constructs an instance of ForecastAdjustmentServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings ForecastAdjustmentServiceSettings
Returns
Type Description
ForecastAdjustmentServiceClient
Exceptions
Type Description
IOException

create(ForecastAdjustmentServiceStub stub)

public static final ForecastAdjustmentServiceClient create(ForecastAdjustmentServiceStub stub)

Constructs an instance of ForecastAdjustmentServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ForecastAdjustmentServiceSettings).

Parameter
Name Description
stub ForecastAdjustmentServiceStub
Returns
Type Description
ForecastAdjustmentServiceClient

Constructors

ForecastAdjustmentServiceClient(ForecastAdjustmentServiceSettings settings)

protected ForecastAdjustmentServiceClient(ForecastAdjustmentServiceSettings settings)

Constructs an instance of ForecastAdjustmentServiceClient, 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.

Parameter
Name Description
settings ForecastAdjustmentServiceSettings

ForecastAdjustmentServiceClient(ForecastAdjustmentServiceStub stub)

protected ForecastAdjustmentServiceClient(ForecastAdjustmentServiceStub stub)
Parameter
Name Description
stub ForecastAdjustmentServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

batchActivateForecastAdjustments(@Nullable NetworkName parent, List<String> names)

public final BatchActivateForecastAdjustmentsResponse batchActivateForecastAdjustments(@Nullable NetworkName parent, List<String> names)

Activates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<String> names = new ArrayList<>();
   BatchActivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchActivateForecastAdjustments(parent, names);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. Format: networks/{network_code}

names List<String>

Required. The resource names of the ForecastAdjustment objects to activate.

Returns
Type Description
BatchActivateForecastAdjustmentsResponse

batchActivateForecastAdjustments(BatchActivateForecastAdjustmentsRequest request)

public final BatchActivateForecastAdjustmentsResponse batchActivateForecastAdjustments(BatchActivateForecastAdjustmentsRequest request)

Activates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchActivateForecastAdjustmentsRequest request =
       BatchActivateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   BatchActivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchActivateForecastAdjustments(request);
 }
 
Parameter
Name Description
request BatchActivateForecastAdjustmentsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchActivateForecastAdjustmentsResponse

batchActivateForecastAdjustments(String parent, List<String> names)

public final BatchActivateForecastAdjustmentsResponse batchActivateForecastAdjustments(String parent, List<String> names)

Activates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<String> names = new ArrayList<>();
   BatchActivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchActivateForecastAdjustments(parent, names);
 }
 
Parameters
Name Description
parent String

Required. Format: networks/{network_code}

names List<String>

Required. The resource names of the ForecastAdjustment objects to activate.

Returns
Type Description
BatchActivateForecastAdjustmentsResponse

batchActivateForecastAdjustmentsCallable()

public final UnaryCallable<BatchActivateForecastAdjustmentsRequest,BatchActivateForecastAdjustmentsResponse> batchActivateForecastAdjustmentsCallable()

Activates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchActivateForecastAdjustmentsRequest request =
       BatchActivateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   ApiFuture<BatchActivateForecastAdjustmentsResponse> future =
       forecastAdjustmentServiceClient
           .batchActivateForecastAdjustmentsCallable()
           .futureCall(request);
   // Do something.
   BatchActivateForecastAdjustmentsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchActivateForecastAdjustmentsRequest,BatchActivateForecastAdjustmentsResponse>

batchCreateForecastAdjustments(@Nullable NetworkName parent, List<CreateForecastAdjustmentRequest> requests)

public final BatchCreateForecastAdjustmentsResponse batchCreateForecastAdjustments(@Nullable NetworkName parent, List<CreateForecastAdjustmentRequest> requests)

Creates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<CreateForecastAdjustmentRequest> requests = new ArrayList<>();
   BatchCreateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchCreateForecastAdjustments(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent resource where ForecastAdjustments will be created. Format: networks/{network_code} The parent field in the CreateForecastAdjustmentRequest must match this field.

requests List<CreateForecastAdjustmentRequest>

Required. The ForecastAdjustment objects to create. A maximum of 100 objects can be created in a batch.

Returns
Type Description
BatchCreateForecastAdjustmentsResponse

batchCreateForecastAdjustments(BatchCreateForecastAdjustmentsRequest request)

public final BatchCreateForecastAdjustmentsResponse batchCreateForecastAdjustments(BatchCreateForecastAdjustmentsRequest request)

Creates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchCreateForecastAdjustmentsRequest request =
       BatchCreateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<CreateForecastAdjustmentRequest>())
           .build();
   BatchCreateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchCreateForecastAdjustments(request);
 }
 
Parameter
Name Description
request BatchCreateForecastAdjustmentsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchCreateForecastAdjustmentsResponse

batchCreateForecastAdjustments(String parent, List<CreateForecastAdjustmentRequest> requests)

public final BatchCreateForecastAdjustmentsResponse batchCreateForecastAdjustments(String parent, List<CreateForecastAdjustmentRequest> requests)

Creates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<CreateForecastAdjustmentRequest> requests = new ArrayList<>();
   BatchCreateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchCreateForecastAdjustments(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where ForecastAdjustments will be created. Format: networks/{network_code} The parent field in the CreateForecastAdjustmentRequest must match this field.

requests List<CreateForecastAdjustmentRequest>

Required. The ForecastAdjustment objects to create. A maximum of 100 objects can be created in a batch.

Returns
Type Description
BatchCreateForecastAdjustmentsResponse

batchCreateForecastAdjustmentsCallable()

public final UnaryCallable<BatchCreateForecastAdjustmentsRequest,BatchCreateForecastAdjustmentsResponse> batchCreateForecastAdjustmentsCallable()

Creates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchCreateForecastAdjustmentsRequest request =
       BatchCreateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<CreateForecastAdjustmentRequest>())
           .build();
   ApiFuture<BatchCreateForecastAdjustmentsResponse> future =
       forecastAdjustmentServiceClient
           .batchCreateForecastAdjustmentsCallable()
           .futureCall(request);
   // Do something.
   BatchCreateForecastAdjustmentsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchCreateForecastAdjustmentsRequest,BatchCreateForecastAdjustmentsResponse>

batchDeactivateForecastAdjustments(@Nullable NetworkName parent, List<String> names)

public final BatchDeactivateForecastAdjustmentsResponse batchDeactivateForecastAdjustments(@Nullable NetworkName parent, List<String> names)

Deactivates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<String> names = new ArrayList<>();
   BatchDeactivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchDeactivateForecastAdjustments(parent, names);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. Format: networks/{network_code}

names List<String>

Required. The resource names of the ForecastAdjustment objects to deactivate.

Returns
Type Description
BatchDeactivateForecastAdjustmentsResponse

batchDeactivateForecastAdjustments(BatchDeactivateForecastAdjustmentsRequest request)

public final BatchDeactivateForecastAdjustmentsResponse batchDeactivateForecastAdjustments(BatchDeactivateForecastAdjustmentsRequest request)

Deactivates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchDeactivateForecastAdjustmentsRequest request =
       BatchDeactivateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   BatchDeactivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchDeactivateForecastAdjustments(request);
 }
 
Parameter
Name Description
request BatchDeactivateForecastAdjustmentsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchDeactivateForecastAdjustmentsResponse

batchDeactivateForecastAdjustments(String parent, List<String> names)

public final BatchDeactivateForecastAdjustmentsResponse batchDeactivateForecastAdjustments(String parent, List<String> names)

Deactivates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<String> names = new ArrayList<>();
   BatchDeactivateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchDeactivateForecastAdjustments(parent, names);
 }
 
Parameters
Name Description
parent String

Required. Format: networks/{network_code}

names List<String>

Required. The resource names of the ForecastAdjustment objects to deactivate.

Returns
Type Description
BatchDeactivateForecastAdjustmentsResponse

batchDeactivateForecastAdjustmentsCallable()

public final UnaryCallable<BatchDeactivateForecastAdjustmentsRequest,BatchDeactivateForecastAdjustmentsResponse> batchDeactivateForecastAdjustmentsCallable()

Deactivates a list of ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchDeactivateForecastAdjustmentsRequest request =
       BatchDeactivateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllNames(new ArrayList<String>())
           .build();
   ApiFuture<BatchDeactivateForecastAdjustmentsResponse> future =
       forecastAdjustmentServiceClient
           .batchDeactivateForecastAdjustmentsCallable()
           .futureCall(request);
   // Do something.
   BatchDeactivateForecastAdjustmentsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchDeactivateForecastAdjustmentsRequest,BatchDeactivateForecastAdjustmentsResponse>

batchUpdateForecastAdjustments(@Nullable NetworkName parent, List<UpdateForecastAdjustmentRequest> requests)

public final BatchUpdateForecastAdjustmentsResponse batchUpdateForecastAdjustments(@Nullable NetworkName parent, List<UpdateForecastAdjustmentRequest> requests)

Batch updates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   List<UpdateForecastAdjustmentRequest> requests = new ArrayList<>();
   BatchUpdateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchUpdateForecastAdjustments(parent, requests);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent resource where ForecastAdjustments will be updated. Format: networks/{network_code} The parent field in the UpdateForecastAdjustmentRequest must match this field.

requests List<UpdateForecastAdjustmentRequest>

Required. The ForecastAdjustment objects to update. A maximum of 100 objects can be updated in a batch.

Returns
Type Description
BatchUpdateForecastAdjustmentsResponse

batchUpdateForecastAdjustments(BatchUpdateForecastAdjustmentsRequest request)

public final BatchUpdateForecastAdjustmentsResponse batchUpdateForecastAdjustments(BatchUpdateForecastAdjustmentsRequest request)

Batch updates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchUpdateForecastAdjustmentsRequest request =
       BatchUpdateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<UpdateForecastAdjustmentRequest>())
           .build();
   BatchUpdateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchUpdateForecastAdjustments(request);
 }
 
Parameter
Name Description
request BatchUpdateForecastAdjustmentsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
BatchUpdateForecastAdjustmentsResponse

batchUpdateForecastAdjustments(String parent, List<UpdateForecastAdjustmentRequest> requests)

public final BatchUpdateForecastAdjustmentsResponse batchUpdateForecastAdjustments(String parent, List<UpdateForecastAdjustmentRequest> requests)

Batch updates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   List<UpdateForecastAdjustmentRequest> requests = new ArrayList<>();
   BatchUpdateForecastAdjustmentsResponse response =
       forecastAdjustmentServiceClient.batchUpdateForecastAdjustments(parent, requests);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where ForecastAdjustments will be updated. Format: networks/{network_code} The parent field in the UpdateForecastAdjustmentRequest must match this field.

requests List<UpdateForecastAdjustmentRequest>

Required. The ForecastAdjustment objects to update. A maximum of 100 objects can be updated in a batch.

Returns
Type Description
BatchUpdateForecastAdjustmentsResponse

batchUpdateForecastAdjustmentsCallable()

public final UnaryCallable<BatchUpdateForecastAdjustmentsRequest,BatchUpdateForecastAdjustmentsResponse> batchUpdateForecastAdjustmentsCallable()

Batch updates ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   BatchUpdateForecastAdjustmentsRequest request =
       BatchUpdateForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .addAllRequests(new ArrayList<UpdateForecastAdjustmentRequest>())
           .build();
   ApiFuture<BatchUpdateForecastAdjustmentsResponse> future =
       forecastAdjustmentServiceClient
           .batchUpdateForecastAdjustmentsCallable()
           .futureCall(request);
   // Do something.
   BatchUpdateForecastAdjustmentsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<BatchUpdateForecastAdjustmentsRequest,BatchUpdateForecastAdjustmentsResponse>

calculateDailyAdOpportunityCounts(@Nullable NetworkName parent, ForecastAdjustment forecastAdjustment)

public final CalculateDailyAdOpportunityCountsResponse calculateDailyAdOpportunityCounts(@Nullable NetworkName parent, ForecastAdjustment forecastAdjustment)

Calculates daily ad opportunity counts for a prospective ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   ForecastAdjustment forecastAdjustment = ForecastAdjustment.newBuilder().build();
   CalculateDailyAdOpportunityCountsResponse response =
       forecastAdjustmentServiceClient.calculateDailyAdOpportunityCounts(
           parent, forecastAdjustment);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent resource where this ForecastAdjustment will be calculated. Format: networks/{network_code}

forecastAdjustment ForecastAdjustment

Required. The prospective ForecastAdjustment to calculate daily ad opportunity counts for.

Returns
Type Description
CalculateDailyAdOpportunityCountsResponse

calculateDailyAdOpportunityCounts(CalculateDailyAdOpportunityCountsRequest request)

public final CalculateDailyAdOpportunityCountsResponse calculateDailyAdOpportunityCounts(CalculateDailyAdOpportunityCountsRequest request)

Calculates daily ad opportunity counts for a prospective ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   CalculateDailyAdOpportunityCountsRequest request =
       CalculateDailyAdOpportunityCountsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .build();
   CalculateDailyAdOpportunityCountsResponse response =
       forecastAdjustmentServiceClient.calculateDailyAdOpportunityCounts(request);
 }
 
Parameter
Name Description
request CalculateDailyAdOpportunityCountsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
CalculateDailyAdOpportunityCountsResponse

calculateDailyAdOpportunityCounts(String parent, ForecastAdjustment forecastAdjustment)

public final CalculateDailyAdOpportunityCountsResponse calculateDailyAdOpportunityCounts(String parent, ForecastAdjustment forecastAdjustment)

Calculates daily ad opportunity counts for a prospective ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   ForecastAdjustment forecastAdjustment = ForecastAdjustment.newBuilder().build();
   CalculateDailyAdOpportunityCountsResponse response =
       forecastAdjustmentServiceClient.calculateDailyAdOpportunityCounts(
           parent, forecastAdjustment);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this ForecastAdjustment will be calculated. Format: networks/{network_code}

forecastAdjustment ForecastAdjustment

Required. The prospective ForecastAdjustment to calculate daily ad opportunity counts for.

Returns
Type Description
CalculateDailyAdOpportunityCountsResponse

calculateDailyAdOpportunityCountsCallable()

public final UnaryCallable<CalculateDailyAdOpportunityCountsRequest,CalculateDailyAdOpportunityCountsResponse> calculateDailyAdOpportunityCountsCallable()

Calculates daily ad opportunity counts for a prospective ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   CalculateDailyAdOpportunityCountsRequest request =
       CalculateDailyAdOpportunityCountsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .build();
   ApiFuture<CalculateDailyAdOpportunityCountsResponse> future =
       forecastAdjustmentServiceClient
           .calculateDailyAdOpportunityCountsCallable()
           .futureCall(request);
   // Do something.
   CalculateDailyAdOpportunityCountsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CalculateDailyAdOpportunityCountsRequest,CalculateDailyAdOpportunityCountsResponse>

close()

public final void close()

createForecastAdjustment(@Nullable NetworkName parent, ForecastAdjustment forecastAdjustment)

public final ForecastAdjustment createForecastAdjustment(@Nullable NetworkName parent, ForecastAdjustment forecastAdjustment)

Creates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   ForecastAdjustment forecastAdjustment = ForecastAdjustment.newBuilder().build();
   ForecastAdjustment response =
       forecastAdjustmentServiceClient.createForecastAdjustment(parent, forecastAdjustment);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent resource where this ForecastAdjustment will be created. Format: networks/{network_code}

forecastAdjustment ForecastAdjustment

Required. The ForecastAdjustment to create.

Returns
Type Description
ForecastAdjustment

createForecastAdjustment(CreateForecastAdjustmentRequest request)

public final ForecastAdjustment createForecastAdjustment(CreateForecastAdjustmentRequest request)

Creates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   CreateForecastAdjustmentRequest request =
       CreateForecastAdjustmentRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .build();
   ForecastAdjustment response =
       forecastAdjustmentServiceClient.createForecastAdjustment(request);
 }
 
Parameter
Name Description
request CreateForecastAdjustmentRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ForecastAdjustment

createForecastAdjustment(String parent, ForecastAdjustment forecastAdjustment)

public final ForecastAdjustment createForecastAdjustment(String parent, ForecastAdjustment forecastAdjustment)

Creates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   ForecastAdjustment forecastAdjustment = ForecastAdjustment.newBuilder().build();
   ForecastAdjustment response =
       forecastAdjustmentServiceClient.createForecastAdjustment(parent, forecastAdjustment);
 }
 
Parameters
Name Description
parent String

Required. The parent resource where this ForecastAdjustment will be created. Format: networks/{network_code}

forecastAdjustment ForecastAdjustment

Required. The ForecastAdjustment to create.

Returns
Type Description
ForecastAdjustment

createForecastAdjustmentCallable()

public final UnaryCallable<CreateForecastAdjustmentRequest,ForecastAdjustment> createForecastAdjustmentCallable()

Creates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   CreateForecastAdjustmentRequest request =
       CreateForecastAdjustmentRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .build();
   ApiFuture<ForecastAdjustment> future =
       forecastAdjustmentServiceClient.createForecastAdjustmentCallable().futureCall(request);
   // Do something.
   ForecastAdjustment response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateForecastAdjustmentRequest,ForecastAdjustment>

getForecastAdjustment(@Nullable ForecastAdjustmentName name)

public final ForecastAdjustment getForecastAdjustment(@Nullable ForecastAdjustmentName name)

Retrieves a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ForecastAdjustmentName name =
       ForecastAdjustmentName.of("[NETWORK_CODE]", "[FORECAST_ADJUSTMENT]");
   ForecastAdjustment response = forecastAdjustmentServiceClient.getForecastAdjustment(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.ForecastAdjustmentName

Required. The resource name of the ForecastAdjustment. Format: networks/{network_code}/forecastAdjustments/{forecastAdjustmentId}

Returns
Type Description
ForecastAdjustment

getForecastAdjustment(GetForecastAdjustmentRequest request)

public final ForecastAdjustment getForecastAdjustment(GetForecastAdjustmentRequest request)

Retrieves a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   GetForecastAdjustmentRequest request =
       GetForecastAdjustmentRequest.newBuilder()
           .setName(
               ForecastAdjustmentName.of("[NETWORK_CODE]", "[FORECAST_ADJUSTMENT]").toString())
           .build();
   ForecastAdjustment response = forecastAdjustmentServiceClient.getForecastAdjustment(request);
 }
 
Parameter
Name Description
request GetForecastAdjustmentRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ForecastAdjustment

getForecastAdjustment(String name)

public final ForecastAdjustment getForecastAdjustment(String name)

Retrieves a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String name = ForecastAdjustmentName.of("[NETWORK_CODE]", "[FORECAST_ADJUSTMENT]").toString();
   ForecastAdjustment response = forecastAdjustmentServiceClient.getForecastAdjustment(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the ForecastAdjustment. Format: networks/{network_code}/forecastAdjustments/{forecastAdjustmentId}

Returns
Type Description
ForecastAdjustment

getForecastAdjustmentCallable()

public final UnaryCallable<GetForecastAdjustmentRequest,ForecastAdjustment> getForecastAdjustmentCallable()

Retrieves a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   GetForecastAdjustmentRequest request =
       GetForecastAdjustmentRequest.newBuilder()
           .setName(
               ForecastAdjustmentName.of("[NETWORK_CODE]", "[FORECAST_ADJUSTMENT]").toString())
           .build();
   ApiFuture<ForecastAdjustment> future =
       forecastAdjustmentServiceClient.getForecastAdjustmentCallable().futureCall(request);
   // Do something.
   ForecastAdjustment response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetForecastAdjustmentRequest,ForecastAdjustment>

getSettings()

public final @Nullable ForecastAdjustmentServiceSettings getSettings()
Returns
Type Description
@org.jspecify.annotations.Nullable com.google.ads.admanager.v1.ForecastAdjustmentServiceSettings

getStub()

public ForecastAdjustmentServiceStub getStub()
Returns
Type Description
ForecastAdjustmentServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listForecastAdjustments(@Nullable NetworkName parent)

public final ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse listForecastAdjustments(@Nullable NetworkName parent)

Lists ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   NetworkName parent = NetworkName.of("[NETWORK_CODE]");
   for (ForecastAdjustment element :
       forecastAdjustmentServiceClient.listForecastAdjustments(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.ads.admanager.v1.NetworkName

Required. The parent, which owns this collection of ForecastAdjustments. Format: networks/{network_code}

Returns
Type Description
ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse

listForecastAdjustments(ListForecastAdjustmentsRequest request)

public final ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse listForecastAdjustments(ListForecastAdjustmentsRequest request)

Lists ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ListForecastAdjustmentsRequest request =
       ListForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   for (ForecastAdjustment element :
       forecastAdjustmentServiceClient.listForecastAdjustments(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListForecastAdjustmentsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse

listForecastAdjustments(String parent)

public final ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse listForecastAdjustments(String parent)

Lists ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   String parent = NetworkName.of("[NETWORK_CODE]").toString();
   for (ForecastAdjustment element :
       forecastAdjustmentServiceClient.listForecastAdjustments(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of ForecastAdjustments. Format: networks/{network_code}

Returns
Type Description
ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse

listForecastAdjustmentsCallable()

public final UnaryCallable<ListForecastAdjustmentsRequest,ListForecastAdjustmentsResponse> listForecastAdjustmentsCallable()

Lists ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ListForecastAdjustmentsRequest request =
       ListForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   while (true) {
     ListForecastAdjustmentsResponse response =
         forecastAdjustmentServiceClient.listForecastAdjustmentsCallable().call(request);
     for (ForecastAdjustment element : response.getForecastAdjustmentsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListForecastAdjustmentsRequest,ListForecastAdjustmentsResponse>

listForecastAdjustmentsPagedCallable()

public final UnaryCallable<ListForecastAdjustmentsRequest,ForecastAdjustmentServiceClient.ListForecastAdjustmentsPagedResponse> listForecastAdjustmentsPagedCallable()

Lists ForecastAdjustment objects.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ListForecastAdjustmentsRequest request =
       ListForecastAdjustmentsRequest.newBuilder()
           .setParent(NetworkName.of("[NETWORK_CODE]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .setSkip(3532159)
           .build();
   ApiFuture<ForecastAdjustment> future =
       forecastAdjustmentServiceClient
           .listForecastAdjustmentsPagedCallable()
           .futureCall(request);
   // Do something.
   for (ForecastAdjustment element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListForecastAdjustmentsRequest,ListForecastAdjustmentsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateForecastAdjustment(ForecastAdjustment forecastAdjustment, FieldMask updateMask)

public final ForecastAdjustment updateForecastAdjustment(ForecastAdjustment forecastAdjustment, FieldMask updateMask)

Updates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   ForecastAdjustment forecastAdjustment = ForecastAdjustment.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   ForecastAdjustment response =
       forecastAdjustmentServiceClient.updateForecastAdjustment(forecastAdjustment, updateMask);
 }
 
Parameters
Name Description
forecastAdjustment ForecastAdjustment

Required. The ForecastAdjustment to update.

The ForecastAdjustment's name is used to identify the ForecastAdjustment to update.

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
ForecastAdjustment

updateForecastAdjustment(UpdateForecastAdjustmentRequest request)

public final ForecastAdjustment updateForecastAdjustment(UpdateForecastAdjustmentRequest request)

Updates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   UpdateForecastAdjustmentRequest request =
       UpdateForecastAdjustmentRequest.newBuilder()
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ForecastAdjustment response =
       forecastAdjustmentServiceClient.updateForecastAdjustment(request);
 }
 
Parameter
Name Description
request UpdateForecastAdjustmentRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ForecastAdjustment

updateForecastAdjustmentCallable()

public final UnaryCallable<UpdateForecastAdjustmentRequest,ForecastAdjustment> updateForecastAdjustmentCallable()

Updates a ForecastAdjustment object.

Sample 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 (ForecastAdjustmentServiceClient forecastAdjustmentServiceClient =
     ForecastAdjustmentServiceClient.create()) {
   UpdateForecastAdjustmentRequest request =
       UpdateForecastAdjustmentRequest.newBuilder()
           .setForecastAdjustment(ForecastAdjustment.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<ForecastAdjustment> future =
       forecastAdjustmentServiceClient.updateForecastAdjustmentCallable().futureCall(request);
   // Do something.
   ForecastAdjustment response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateForecastAdjustmentRequest,ForecastAdjustment>