Class CampaignDraftServiceClient
- java.lang.Object
-
- com.google.ads.googleads.v15.services.CampaignDraftServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource,java.lang.AutoCloseable
@Generated("by gapic-generator-java") public class CampaignDraftServiceClient extends java.lang.Object implements com.google.api.gax.core.BackgroundResourceService Description: Service to manage campaign drafts.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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { String customerId = "customerId-1581184615"; List<CampaignDraftOperation> operations = new ArrayList<>(); MutateCampaignDraftsResponse response = campaignDraftServiceClient.mutateCampaignDrafts(customerId, operations); }Note: close() needs to be called on the CampaignDraftServiceClient 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 MutateCampaignDrafts
Creates, updates, or removes campaign drafts. Operation statuses are returned.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
mutateCampaignDrafts(MutateCampaignDraftsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
mutateCampaignDrafts(String customerId, List<CampaignDraftOperation> operations)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
mutateCampaignDraftsCallable()
PromoteCampaignDraft
Promotes the changes in a draft back to the base campaign.
This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
promoteCampaignDraftAsync(PromoteCampaignDraftRequest request)
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
promoteCampaignDraftAsync(CampaignDraftName campaignDraft)
promoteCampaignDraftAsync(String campaignDraft)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
promoteCampaignDraftOperationCallable()
promoteCampaignDraftCallable()
ListCampaignDraftAsyncErrors
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
listCampaignDraftAsyncErrors(ListCampaignDraftAsyncErrorsRequest request)
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
listCampaignDraftAsyncErrors(CampaignDraftName resourceName)
listCampaignDraftAsyncErrors(String resourceName)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
listCampaignDraftAsyncErrorsPagedCallable()
listCampaignDraftAsyncErrorsCallable()
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 CampaignDraftServiceSettings 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 CampaignDraftServiceSettings campaignDraftServiceSettings = CampaignDraftServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create(campaignDraftServiceSettings);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 CampaignDraftServiceSettings campaignDraftServiceSettings = CampaignDraftServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create(campaignDraftServiceSettings);Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCampaignDraftServiceClient.ListCampaignDraftAsyncErrorsFixedSizeCollectionstatic classCampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagestatic classCampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protectedCampaignDraftServiceClient(CampaignDraftServiceSettings settings)Constructs an instance of CampaignDraftServiceClient, using the given settings.protectedCampaignDraftServiceClient(CampaignDraftServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long duration, java.util.concurrent.TimeUnit unit)voidclose()static CampaignDraftServiceClientcreate()Constructs an instance of CampaignDraftServiceClient with default settings.static CampaignDraftServiceClientcreate(CampaignDraftServiceSettings settings)Constructs an instance of CampaignDraftServiceClient, using the given settings.static CampaignDraftServiceClientcreate(CampaignDraftServiceStub stub)Constructs an instance of CampaignDraftServiceClient, using the given stub for making calls.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.CampaignDraftServiceSettingsgetSettings()CampaignDraftServiceStubgetStub()booleanisShutdown()booleanisTerminated()CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponselistCampaignDraftAsyncErrors(CampaignDraftName resourceName)Returns all errors that occurred during CampaignDraft promote.CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponselistCampaignDraftAsyncErrors(ListCampaignDraftAsyncErrorsRequest request)Returns all errors that occurred during CampaignDraft promote.CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponselistCampaignDraftAsyncErrors(java.lang.String resourceName)Returns all errors that occurred during CampaignDraft promote.com.google.api.gax.rpc.UnaryCallable<ListCampaignDraftAsyncErrorsRequest,ListCampaignDraftAsyncErrorsResponse>listCampaignDraftAsyncErrorsCallable()Returns all errors that occurred during CampaignDraft promote.com.google.api.gax.rpc.UnaryCallable<ListCampaignDraftAsyncErrorsRequest,CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse>listCampaignDraftAsyncErrorsPagedCallable()Returns all errors that occurred during CampaignDraft promote.MutateCampaignDraftsResponsemutateCampaignDrafts(MutateCampaignDraftsRequest request)Creates, updates, or removes campaign drafts.MutateCampaignDraftsResponsemutateCampaignDrafts(java.lang.String customerId, java.util.List<CampaignDraftOperation> operations)Creates, updates, or removes campaign drafts.com.google.api.gax.rpc.UnaryCallable<MutateCampaignDraftsRequest,MutateCampaignDraftsResponse>mutateCampaignDraftsCallable()Creates, updates, or removes campaign drafts.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty>promoteCampaignDraftAsync(CampaignDraftName campaignDraft)Promotes the changes in a draft back to the base campaign.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty>promoteCampaignDraftAsync(PromoteCampaignDraftRequest request)Promotes the changes in a draft back to the base campaign.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty>promoteCampaignDraftAsync(java.lang.String campaignDraft)Promotes the changes in a draft back to the base campaign.com.google.api.gax.rpc.UnaryCallable<PromoteCampaignDraftRequest,com.google.longrunning.Operation>promoteCampaignDraftCallable()Promotes the changes in a draft back to the base campaign.com.google.api.gax.rpc.OperationCallable<PromoteCampaignDraftRequest,com.google.protobuf.Empty,com.google.protobuf.Empty>promoteCampaignDraftOperationCallable()Promotes the changes in a draft back to the base campaign.voidshutdown()voidshutdownNow()
-
-
-
Constructor Detail
-
CampaignDraftServiceClient
protected CampaignDraftServiceClient(CampaignDraftServiceSettings settings) throws java.io.IOException
Constructs an instance of CampaignDraftServiceClient, 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
-
CampaignDraftServiceClient
protected CampaignDraftServiceClient(CampaignDraftServiceStub stub)
-
-
Method Detail
-
create
public static final CampaignDraftServiceClient create() throws java.io.IOException
Constructs an instance of CampaignDraftServiceClient with default settings.- Throws:
java.io.IOException
-
create
public static final CampaignDraftServiceClient create(CampaignDraftServiceSettings settings) throws java.io.IOException
Constructs an instance of CampaignDraftServiceClient, 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
public static final CampaignDraftServiceClient create(CampaignDraftServiceStub stub)
Constructs an instance of CampaignDraftServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(CampaignDraftServiceSettings).
-
getSettings
public final CampaignDraftServiceSettings getSettings()
-
getStub
public CampaignDraftServiceStub 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.
-
mutateCampaignDrafts
public final MutateCampaignDraftsResponse mutateCampaignDrafts(java.lang.String customerId, java.util.List<CampaignDraftOperation> operations)
Creates, updates, or removes campaign drafts. Operation statuses are returned.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { String customerId = "customerId-1581184615"; List<CampaignDraftOperation> operations = new ArrayList<>(); MutateCampaignDraftsResponse response = campaignDraftServiceClient.mutateCampaignDrafts(customerId, operations); }- Parameters:
customerId- Required. The ID of the customer whose campaign drafts are being modified.operations- Required. The list of operations to perform on individual campaign drafts.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
mutateCampaignDrafts
public final MutateCampaignDraftsResponse mutateCampaignDrafts(MutateCampaignDraftsRequest request)
Creates, updates, or removes campaign drafts. Operation statuses are returned.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { MutateCampaignDraftsRequest request = MutateCampaignDraftsRequest.newBuilder() .setCustomerId("customerId-1581184615") .addAllOperations(new ArrayList<CampaignDraftOperation>()) .setPartialFailure(true) .setValidateOnly(true) .build(); MutateCampaignDraftsResponse response = campaignDraftServiceClient.mutateCampaignDrafts(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
-
mutateCampaignDraftsCallable
public final com.google.api.gax.rpc.UnaryCallable<MutateCampaignDraftsRequest,MutateCampaignDraftsResponse> mutateCampaignDraftsCallable()
Creates, updates, or removes campaign drafts. Operation statuses are returned.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { MutateCampaignDraftsRequest request = MutateCampaignDraftsRequest.newBuilder() .setCustomerId("customerId-1581184615") .addAllOperations(new ArrayList<CampaignDraftOperation>()) .setPartialFailure(true) .setValidateOnly(true) .build(); ApiFuture<MutateCampaignDraftsResponse> future = campaignDraftServiceClient.mutateCampaignDraftsCallable().futureCall(request); // Do something. MutateCampaignDraftsResponse response = future.get(); }
-
promoteCampaignDraftAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty> promoteCampaignDraftAsync(CampaignDraftName campaignDraft)
Promotes the changes in a draft back to the base campaign.This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { CampaignDraftName campaignDraft = CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]"); campaignDraftServiceClient.promoteCampaignDraftAsync(campaignDraft).get(); }- Parameters:
campaignDraft- Required. The resource name of the campaign draft to promote.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
promoteCampaignDraftAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty> promoteCampaignDraftAsync(java.lang.String campaignDraft)
Promotes the changes in a draft back to the base campaign.This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { String campaignDraft = CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]").toString(); campaignDraftServiceClient.promoteCampaignDraftAsync(campaignDraft).get(); }- Parameters:
campaignDraft- Required. The resource name of the campaign draft to promote.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
promoteCampaignDraftAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Empty> promoteCampaignDraftAsync(PromoteCampaignDraftRequest request)
Promotes the changes in a draft back to the base campaign.This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { PromoteCampaignDraftRequest request = PromoteCampaignDraftRequest.newBuilder() .setCampaignDraft( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setValidateOnly(true) .build(); campaignDraftServiceClient.promoteCampaignDraftAsync(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
-
promoteCampaignDraftOperationCallable
public final com.google.api.gax.rpc.OperationCallable<PromoteCampaignDraftRequest,com.google.protobuf.Empty,com.google.protobuf.Empty> promoteCampaignDraftOperationCallable()
Promotes the changes in a draft back to the base campaign.This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { PromoteCampaignDraftRequest request = PromoteCampaignDraftRequest.newBuilder() .setCampaignDraft( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setValidateOnly(true) .build(); OperationFuture<Empty, Empty> future = campaignDraftServiceClient.promoteCampaignDraftOperationCallable().futureCall(request); // Do something. future.get(); }
-
promoteCampaignDraftCallable
public final com.google.api.gax.rpc.UnaryCallable<PromoteCampaignDraftRequest,com.google.longrunning.Operation> promoteCampaignDraftCallable()
Promotes the changes in a draft back to the base campaign.This method returns a Long Running Operation (LRO) indicating if the Promote is done. Use [Operations.GetOperation] to poll the LRO until it is done. Only a done status is returned in the response. See the status in the Campaign Draft resource to determine if the promotion was successful. If the LRO failed, use [CampaignDraftService.ListCampaignDraftAsyncErrors][google.ads.googleads.v15.services.CampaignDraftService.ListCampaignDraftAsyncErrors] to view the list of error reasons.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignDraftError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { PromoteCampaignDraftRequest request = PromoteCampaignDraftRequest.newBuilder() .setCampaignDraft( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setValidateOnly(true) .build(); ApiFuture<Operation> future = campaignDraftServiceClient.promoteCampaignDraftCallable().futureCall(request); // Do something. future.get(); }
-
listCampaignDraftAsyncErrors
public final CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(CampaignDraftName resourceName)
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { CampaignDraftName resourceName = CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]"); for (Status element : campaignDraftServiceClient.listCampaignDraftAsyncErrors(resourceName).iterateAll()) { // doThingsWith(element); } }- Parameters:
resourceName- Required. The name of the campaign draft from which to retrieve the async errors.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listCampaignDraftAsyncErrors
public final CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(java.lang.String resourceName)
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { String resourceName = CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]").toString(); for (Status element : campaignDraftServiceClient.listCampaignDraftAsyncErrors(resourceName).iterateAll()) { // doThingsWith(element); } }- Parameters:
resourceName- Required. The name of the campaign draft from which to retrieve the async errors.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listCampaignDraftAsyncErrors
public final CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse listCampaignDraftAsyncErrors(ListCampaignDraftAsyncErrorsRequest request)
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { ListCampaignDraftAsyncErrorsRequest request = ListCampaignDraftAsyncErrorsRequest.newBuilder() .setResourceName( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (Status element : campaignDraftServiceClient.listCampaignDraftAsyncErrors(request).iterateAll()) { // doThingsWith(element); } }- 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
-
listCampaignDraftAsyncErrorsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListCampaignDraftAsyncErrorsRequest,CampaignDraftServiceClient.ListCampaignDraftAsyncErrorsPagedResponse> listCampaignDraftAsyncErrorsPagedCallable()
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { ListCampaignDraftAsyncErrorsRequest request = ListCampaignDraftAsyncErrorsRequest.newBuilder() .setResourceName( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<Status> future = campaignDraftServiceClient .listCampaignDraftAsyncErrorsPagedCallable() .futureCall(request); // Do something. for (Status element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listCampaignDraftAsyncErrorsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListCampaignDraftAsyncErrorsRequest,ListCampaignDraftAsyncErrorsResponse> listCampaignDraftAsyncErrorsCallable()
Returns all errors that occurred during CampaignDraft promote. Throws an error if called before campaign draft is promoted. Supports standard list paging.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [HeaderError]() [InternalError]() [QuotaError]() [RequestError]()
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 (CampaignDraftServiceClient campaignDraftServiceClient = CampaignDraftServiceClient.create()) { ListCampaignDraftAsyncErrorsRequest request = ListCampaignDraftAsyncErrorsRequest.newBuilder() .setResourceName( CampaignDraftName.of("[CUSTOMER_ID]", "[BASE_CAMPAIGN_ID]", "[DRAFT_ID]") .toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListCampaignDraftAsyncErrorsResponse response = campaignDraftServiceClient.listCampaignDraftAsyncErrorsCallable().call(request); for (Status element : response.getErrorsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
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
-
-