Class OfflineUserDataJobServiceClient
- java.lang.Object
-
- com.google.ads.googleads.v10.services.OfflineUserDataJobServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource,java.lang.AutoCloseable
@Generated("by gapic-generator-java") public class OfflineUserDataJobServiceClient extends java.lang.Object implements com.google.api.gax.core.BackgroundResourceService Description: Service to manage offline user data jobs.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:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { String customerId = "customerId-1581184615"; OfflineUserDataJob job = OfflineUserDataJob.newBuilder().build(); CreateOfflineUserDataJobResponse response = offlineUserDataJobServiceClient.createOfflineUserDataJob(customerId, job); }Note: close() needs to be called on the OfflineUserDataJobServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 OfflineUserDataJobServiceSettings to create(). For example:
To customize credentials:
OfflineUserDataJobServiceSettings offlineUserDataJobServiceSettings = OfflineUserDataJobServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create(offlineUserDataJobServiceSettings);To customize the endpoint:
OfflineUserDataJobServiceSettings offlineUserDataJobServiceSettings = OfflineUserDataJobServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create(offlineUserDataJobServiceSettings);Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOfflineUserDataJobServiceClient(OfflineUserDataJobServiceSettings settings)Constructs an instance of OfflineUserDataJobServiceClient, using the given settings.protectedOfflineUserDataJobServiceClient(OfflineUserDataJobServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AddOfflineUserDataJobOperationsResponseaddOfflineUserDataJobOperations(OfflineUserDataJobName resourceName, java.util.List<OfflineUserDataJobOperation> operations)Adds operations to the offline user data job.AddOfflineUserDataJobOperationsResponseaddOfflineUserDataJobOperations(AddOfflineUserDataJobOperationsRequest request)Adds operations to the offline user data job.AddOfflineUserDataJobOperationsResponseaddOfflineUserDataJobOperations(java.lang.String resourceName, java.util.List<OfflineUserDataJobOperation> operations)Adds operations to the offline user data job.com.google.api.gax.rpc.UnaryCallable<AddOfflineUserDataJobOperationsRequest,AddOfflineUserDataJobOperationsResponse>addOfflineUserDataJobOperationsCallable()Adds operations to the offline user data job.booleanawaitTermination(long duration, java.util.concurrent.TimeUnit unit)voidclose()static OfflineUserDataJobServiceClientcreate()Constructs an instance of OfflineUserDataJobServiceClient with default settings.static OfflineUserDataJobServiceClientcreate(OfflineUserDataJobServiceSettings settings)Constructs an instance of OfflineUserDataJobServiceClient, using the given settings.static OfflineUserDataJobServiceClientcreate(OfflineUserDataJobServiceStub stub)Constructs an instance of OfflineUserDataJobServiceClient, using the given stub for making calls.CreateOfflineUserDataJobResponsecreateOfflineUserDataJob(CreateOfflineUserDataJobRequest request)Creates an offline user data job.CreateOfflineUserDataJobResponsecreateOfflineUserDataJob(java.lang.String customerId, OfflineUserDataJob job)Creates an offline user data job.com.google.api.gax.rpc.UnaryCallable<CreateOfflineUserDataJobRequest,CreateOfflineUserDataJobResponse>createOfflineUserDataJobCallable()Creates an offline user data job.com.google.longrunning.OperationsClientgetOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.OfflineUserDataJobServiceSettingsgetSettings()OfflineUserDataJobServiceStubgetStub()booleanisShutdown()booleanisTerminated()com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata>runOfflineUserDataJobAsync(OfflineUserDataJobName resourceName)Runs the offline user data job.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata>runOfflineUserDataJobAsync(RunOfflineUserDataJobRequest request)Runs the offline user data job.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata>runOfflineUserDataJobAsync(java.lang.String resourceName)Runs the offline user data job.com.google.api.gax.rpc.UnaryCallable<RunOfflineUserDataJobRequest,com.google.longrunning.Operation>runOfflineUserDataJobCallable()Runs the offline user data job.com.google.api.gax.rpc.OperationCallable<RunOfflineUserDataJobRequest,com.google.protobuf.Empty,OfflineUserDataJobMetadata>runOfflineUserDataJobOperationCallable()Runs the offline user data job.voidshutdown()voidshutdownNow()
-
-
-
Constructor Detail
-
OfflineUserDataJobServiceClient
protected OfflineUserDataJobServiceClient(OfflineUserDataJobServiceSettings settings) throws java.io.IOException
Constructs an instance of OfflineUserDataJobServiceClient, 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.- Throws:
java.io.IOException
-
OfflineUserDataJobServiceClient
@BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected OfflineUserDataJobServiceClient(OfflineUserDataJobServiceStub stub)
-
-
Method Detail
-
create
public static final OfflineUserDataJobServiceClient create() throws java.io.IOException
Constructs an instance of OfflineUserDataJobServiceClient with default settings.- Throws:
java.io.IOException
-
create
public static final OfflineUserDataJobServiceClient create(OfflineUserDataJobServiceSettings settings) throws java.io.IOException
Constructs an instance of OfflineUserDataJobServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
java.io.IOException
-
create
@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final OfflineUserDataJobServiceClient create(OfflineUserDataJobServiceStub stub)Constructs an instance of OfflineUserDataJobServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(OfflineUserDataJobServiceSettings).
-
getSettings
public final OfflineUserDataJobServiceSettings getSettings()
-
getStub
@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public OfflineUserDataJobServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
createOfflineUserDataJob
public final CreateOfflineUserDataJobResponse createOfflineUserDataJob(java.lang.String customerId, OfflineUserDataJob job)
Creates an offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [NotAllowlistedError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { String customerId = "customerId-1581184615"; OfflineUserDataJob job = OfflineUserDataJob.newBuilder().build(); CreateOfflineUserDataJobResponse response = offlineUserDataJobServiceClient.createOfflineUserDataJob(customerId, job); }- Parameters:
customerId- Required. The ID of the customer for which to create an offline user data job.job- Required. The offline user data job to be created.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
createOfflineUserDataJob
public final CreateOfflineUserDataJobResponse createOfflineUserDataJob(CreateOfflineUserDataJobRequest request)
Creates an offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [NotAllowlistedError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { CreateOfflineUserDataJobRequest request = CreateOfflineUserDataJobRequest.newBuilder() .setCustomerId("customerId-1581184615") .setJob(OfflineUserDataJob.newBuilder().build()) .setValidateOnly(true) .setEnableMatchRateRangePreview(true) .build(); CreateOfflineUserDataJobResponse response = offlineUserDataJobServiceClient.createOfflineUserDataJob(request); }- Parameters:
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
-
createOfflineUserDataJobCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateOfflineUserDataJobRequest,CreateOfflineUserDataJobResponse> createOfflineUserDataJobCallable()
Creates an offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [NotAllowlistedError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { CreateOfflineUserDataJobRequest request = CreateOfflineUserDataJobRequest.newBuilder() .setCustomerId("customerId-1581184615") .setJob(OfflineUserDataJob.newBuilder().build()) .setValidateOnly(true) .setEnableMatchRateRangePreview(true) .build(); ApiFuture<CreateOfflineUserDataJobResponse> future = offlineUserDataJobServiceClient.createOfflineUserDataJobCallable().futureCall(request); // Do something. CreateOfflineUserDataJobResponse response = future.get(); }
-
addOfflineUserDataJobOperations
public final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(OfflineUserDataJobName resourceName, java.util.List<OfflineUserDataJobOperation> operations)
Adds operations to the offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { OfflineUserDataJobName resourceName = OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]"); List<OfflineUserDataJobOperation> operations = new ArrayList<>(); AddOfflineUserDataJobOperationsResponse response = offlineUserDataJobServiceClient.addOfflineUserDataJobOperations(resourceName, operations); }- Parameters:
resourceName- Required. The resource name of the OfflineUserDataJob.operations- Required. The list of operations to be done.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
addOfflineUserDataJobOperations
public final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(java.lang.String resourceName, java.util.List<OfflineUserDataJobOperation> operations)
Adds operations to the offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { String resourceName = OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]").toString(); List<OfflineUserDataJobOperation> operations = new ArrayList<>(); AddOfflineUserDataJobOperationsResponse response = offlineUserDataJobServiceClient.addOfflineUserDataJobOperations(resourceName, operations); }- Parameters:
resourceName- Required. The resource name of the OfflineUserDataJob.operations- Required. The list of operations to be done.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
addOfflineUserDataJobOperations
public final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(AddOfflineUserDataJobOperationsRequest request)
Adds operations to the offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { AddOfflineUserDataJobOperationsRequest request = AddOfflineUserDataJobOperationsRequest.newBuilder() .setResourceName( OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]") .toString()) .setEnablePartialFailure(true) .setEnableWarnings(true) .addAllOperations(new ArrayList<OfflineUserDataJobOperation>()) .setValidateOnly(true) .build(); AddOfflineUserDataJobOperationsResponse response = offlineUserDataJobServiceClient.addOfflineUserDataJobOperations(request); }- Parameters:
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
-
addOfflineUserDataJobOperationsCallable
public final com.google.api.gax.rpc.UnaryCallable<AddOfflineUserDataJobOperationsRequest,AddOfflineUserDataJobOperationsResponse> addOfflineUserDataJobOperationsCallable()
Adds operations to the offline user data job.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { AddOfflineUserDataJobOperationsRequest request = AddOfflineUserDataJobOperationsRequest.newBuilder() .setResourceName( OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]") .toString()) .setEnablePartialFailure(true) .setEnableWarnings(true) .addAllOperations(new ArrayList<OfflineUserDataJobOperation>()) .setValidateOnly(true) .build(); ApiFuture<AddOfflineUserDataJobOperationsResponse> future = offlineUserDataJobServiceClient .addOfflineUserDataJobOperationsCallable() .futureCall(request); // Do something. AddOfflineUserDataJobOperationsResponse response = future.get(); }
-
runOfflineUserDataJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata> runOfflineUserDataJobAsync(OfflineUserDataJobName resourceName)
Runs the offline user data job.When finished, the long running operation will contain the processing result or failure information, if any.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [HeaderError]() [InternalError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { OfflineUserDataJobName resourceName = OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]"); offlineUserDataJobServiceClient.runOfflineUserDataJobAsync(resourceName).get(); }- Parameters:
resourceName- Required. The resource name of the OfflineUserDataJob to run.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
runOfflineUserDataJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata> runOfflineUserDataJobAsync(java.lang.String resourceName)
Runs the offline user data job.When finished, the long running operation will contain the processing result or failure information, if any.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [HeaderError]() [InternalError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { String resourceName = OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]").toString(); offlineUserDataJobServiceClient.runOfflineUserDataJobAsync(resourceName).get(); }- Parameters:
resourceName- Required. The resource name of the OfflineUserDataJob to run.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
runOfflineUserDataJobAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OfflineUserDataJobMetadata> runOfflineUserDataJobAsync(RunOfflineUserDataJobRequest request)
Runs the offline user data job.When finished, the long running operation will contain the processing result or failure information, if any.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [HeaderError]() [InternalError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { RunOfflineUserDataJobRequest request = RunOfflineUserDataJobRequest.newBuilder() .setResourceName( OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]") .toString()) .setValidateOnly(true) .build(); offlineUserDataJobServiceClient.runOfflineUserDataJobAsync(request).get(); }- Parameters:
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
-
runOfflineUserDataJobOperationCallable
public final com.google.api.gax.rpc.OperationCallable<RunOfflineUserDataJobRequest,com.google.protobuf.Empty,OfflineUserDataJobMetadata> runOfflineUserDataJobOperationCallable()
Runs the offline user data job.When finished, the long running operation will contain the processing result or failure information, if any.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [HeaderError]() [InternalError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { RunOfflineUserDataJobRequest request = RunOfflineUserDataJobRequest.newBuilder() .setResourceName( OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]") .toString()) .setValidateOnly(true) .build(); OperationFuture<Empty, OfflineUserDataJobMetadata> future = offlineUserDataJobServiceClient .runOfflineUserDataJobOperationCallable() .futureCall(request); // Do something. future.get(); }
-
runOfflineUserDataJobCallable
public final com.google.api.gax.rpc.UnaryCallable<RunOfflineUserDataJobRequest,com.google.longrunning.Operation> runOfflineUserDataJobCallable()
Runs the offline user data job.When finished, the long running operation will contain the processing result or failure information, if any.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [HeaderError]() [InternalError]() [OfflineUserDataJobError]() [QuotaError]() [RequestError]()
Sample code:
try (OfflineUserDataJobServiceClient offlineUserDataJobServiceClient = OfflineUserDataJobServiceClient.create()) { RunOfflineUserDataJobRequest request = RunOfflineUserDataJobRequest.newBuilder() .setResourceName( OfflineUserDataJobName.of("[CUSTOMER_ID]", "[OFFLINE_USER_DATA_UPDATE_ID]") .toString()) .setValidateOnly(true) .build(); ApiFuture<Operation> future = offlineUserDataJobServiceClient.runOfflineUserDataJobCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNowin interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
awaitTerminationin interfacecom.google.api.gax.core.BackgroundResource- Throws:
java.lang.InterruptedException
-
-