Class AudienceInsightsServiceClient
- java.lang.Object
-
- com.google.ads.googleads.v14.services.AudienceInsightsServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource,java.lang.AutoCloseable
@Generated("by gapic-generator-java") public class AudienceInsightsServiceClient extends java.lang.Object implements com.google.api.gax.core.BackgroundResourceService Description: Audience Insights Service helps users find information about groups of people and how they can be reached with Google Ads. Accessible to allowlisted customers only.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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { String customerId = "customerId-1581184615"; BasicInsightsAudience baselineAudience = BasicInsightsAudience.newBuilder().build(); BasicInsightsAudience specificAudience = BasicInsightsAudience.newBuilder().build(); GenerateInsightsFinderReportResponse response = audienceInsightsServiceClient.generateInsightsFinderReport( customerId, baselineAudience, specificAudience); }Note: close() needs to be called on the AudienceInsightsServiceClient 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 GenerateInsightsFinderReport
Creates a saved report that can be viewed in the Insights Finder tool.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
generateInsightsFinderReport(GenerateInsightsFinderReportRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
generateInsightsFinderReport(String customerId, BasicInsightsAudience baselineAudience, BasicInsightsAudience specificAudience)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
generateInsightsFinderReportCallable()
ListAudienceInsightsAttributes
Searches for audience attributes that can be used to generate insights.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
listAudienceInsightsAttributes(ListAudienceInsightsAttributesRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
listAudienceInsightsAttributes(String customerId, List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions, String queryText)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
listAudienceInsightsAttributesCallable()
ListInsightsEligibleDates
Lists date ranges for which audience insights data can be requested.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
listInsightsEligibleDates(ListInsightsEligibleDatesRequest request)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
listInsightsEligibleDatesCallable()
GenerateAudienceCompositionInsights
Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.
List of thrown errors: [AudienceInsightsError]() [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [RequestError]()
Request object method variants only take one parameter, a request object, which must be constructed before the call.
generateAudienceCompositionInsights(GenerateAudienceCompositionInsightsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
generateAudienceCompositionInsights(String customerId, InsightsAudience audience, List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
generateAudienceCompositionInsightsCallable()
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 AudienceInsightsServiceSettings 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 AudienceInsightsServiceSettings audienceInsightsServiceSettings = AudienceInsightsServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create(audienceInsightsServiceSettings);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 AudienceInsightsServiceSettings audienceInsightsServiceSettings = AudienceInsightsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create(audienceInsightsServiceSettings);Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAudienceInsightsServiceClient(AudienceInsightsServiceSettings settings)Constructs an instance of AudienceInsightsServiceClient, using the given settings.protectedAudienceInsightsServiceClient(AudienceInsightsServiceStub 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 AudienceInsightsServiceClientcreate()Constructs an instance of AudienceInsightsServiceClient with default settings.static AudienceInsightsServiceClientcreate(AudienceInsightsServiceSettings settings)Constructs an instance of AudienceInsightsServiceClient, using the given settings.static AudienceInsightsServiceClientcreate(AudienceInsightsServiceStub stub)Constructs an instance of AudienceInsightsServiceClient, using the given stub for making calls.GenerateAudienceCompositionInsightsResponsegenerateAudienceCompositionInsights(GenerateAudienceCompositionInsightsRequest request)Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.GenerateAudienceCompositionInsightsResponsegenerateAudienceCompositionInsights(java.lang.String customerId, InsightsAudience audience, java.util.List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions)Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.com.google.api.gax.rpc.UnaryCallable<GenerateAudienceCompositionInsightsRequest,GenerateAudienceCompositionInsightsResponse>generateAudienceCompositionInsightsCallable()Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.GenerateInsightsFinderReportResponsegenerateInsightsFinderReport(GenerateInsightsFinderReportRequest request)Creates a saved report that can be viewed in the Insights Finder tool.GenerateInsightsFinderReportResponsegenerateInsightsFinderReport(java.lang.String customerId, BasicInsightsAudience baselineAudience, BasicInsightsAudience specificAudience)Creates a saved report that can be viewed in the Insights Finder tool.com.google.api.gax.rpc.UnaryCallable<GenerateInsightsFinderReportRequest,GenerateInsightsFinderReportResponse>generateInsightsFinderReportCallable()Creates a saved report that can be viewed in the Insights Finder tool.AudienceInsightsServiceSettingsgetSettings()AudienceInsightsServiceStubgetStub()booleanisShutdown()booleanisTerminated()ListAudienceInsightsAttributesResponselistAudienceInsightsAttributes(ListAudienceInsightsAttributesRequest request)Searches for audience attributes that can be used to generate insights.ListAudienceInsightsAttributesResponselistAudienceInsightsAttributes(java.lang.String customerId, java.util.List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions, java.lang.String queryText)Searches for audience attributes that can be used to generate insights.com.google.api.gax.rpc.UnaryCallable<ListAudienceInsightsAttributesRequest,ListAudienceInsightsAttributesResponse>listAudienceInsightsAttributesCallable()Searches for audience attributes that can be used to generate insights.ListInsightsEligibleDatesResponselistInsightsEligibleDates(ListInsightsEligibleDatesRequest request)Lists date ranges for which audience insights data can be requested.com.google.api.gax.rpc.UnaryCallable<ListInsightsEligibleDatesRequest,ListInsightsEligibleDatesResponse>listInsightsEligibleDatesCallable()Lists date ranges for which audience insights data can be requested.voidshutdown()voidshutdownNow()
-
-
-
Constructor Detail
-
AudienceInsightsServiceClient
protected AudienceInsightsServiceClient(AudienceInsightsServiceSettings settings) throws java.io.IOException
Constructs an instance of AudienceInsightsServiceClient, 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
-
AudienceInsightsServiceClient
protected AudienceInsightsServiceClient(AudienceInsightsServiceStub stub)
-
-
Method Detail
-
create
public static final AudienceInsightsServiceClient create() throws java.io.IOException
Constructs an instance of AudienceInsightsServiceClient with default settings.- Throws:
java.io.IOException
-
create
public static final AudienceInsightsServiceClient create(AudienceInsightsServiceSettings settings) throws java.io.IOException
Constructs an instance of AudienceInsightsServiceClient, 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 AudienceInsightsServiceClient create(AudienceInsightsServiceStub stub)
Constructs an instance of AudienceInsightsServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(AudienceInsightsServiceSettings).
-
getSettings
public final AudienceInsightsServiceSettings getSettings()
-
getStub
public AudienceInsightsServiceStub getStub()
-
generateInsightsFinderReport
public final GenerateInsightsFinderReportResponse generateInsightsFinderReport(java.lang.String customerId, BasicInsightsAudience baselineAudience, BasicInsightsAudience specificAudience)
Creates a saved report that can be viewed in the Insights Finder tool.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { String customerId = "customerId-1581184615"; BasicInsightsAudience baselineAudience = BasicInsightsAudience.newBuilder().build(); BasicInsightsAudience specificAudience = BasicInsightsAudience.newBuilder().build(); GenerateInsightsFinderReportResponse response = audienceInsightsServiceClient.generateInsightsFinderReport( customerId, baselineAudience, specificAudience); }- Parameters:
customerId- Required. The ID of the customer.baselineAudience- Required. A baseline audience for this report, typically all people in a region.specificAudience- Required. The specific audience of interest for this report. The insights in the report will be based on attributes more prevalent in this audience than in the report's baseline audience.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
generateInsightsFinderReport
public final GenerateInsightsFinderReportResponse generateInsightsFinderReport(GenerateInsightsFinderReportRequest request)
Creates a saved report that can be viewed in the Insights Finder tool.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { GenerateInsightsFinderReportRequest request = GenerateInsightsFinderReportRequest.newBuilder() .setCustomerId("customerId-1581184615") .setBaselineAudience(BasicInsightsAudience.newBuilder().build()) .setSpecificAudience(BasicInsightsAudience.newBuilder().build()) .setCustomerInsightsGroup("customerInsightsGroup1092118566") .build(); GenerateInsightsFinderReportResponse response = audienceInsightsServiceClient.generateInsightsFinderReport(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
-
generateInsightsFinderReportCallable
public final com.google.api.gax.rpc.UnaryCallable<GenerateInsightsFinderReportRequest,GenerateInsightsFinderReportResponse> generateInsightsFinderReportCallable()
Creates a saved report that can be viewed in the Insights Finder tool.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { GenerateInsightsFinderReportRequest request = GenerateInsightsFinderReportRequest.newBuilder() .setCustomerId("customerId-1581184615") .setBaselineAudience(BasicInsightsAudience.newBuilder().build()) .setSpecificAudience(BasicInsightsAudience.newBuilder().build()) .setCustomerInsightsGroup("customerInsightsGroup1092118566") .build(); ApiFuture<GenerateInsightsFinderReportResponse> future = audienceInsightsServiceClient.generateInsightsFinderReportCallable().futureCall(request); // Do something. GenerateInsightsFinderReportResponse response = future.get(); }
-
listAudienceInsightsAttributes
public final ListAudienceInsightsAttributesResponse listAudienceInsightsAttributes(java.lang.String customerId, java.util.List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions, java.lang.String queryText)
Searches for audience attributes that can be used to generate insights.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { String customerId = "customerId-1581184615"; List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions = new ArrayList<>(); String queryText = "queryText-1806881259"; ListAudienceInsightsAttributesResponse response = audienceInsightsServiceClient.listAudienceInsightsAttributes( customerId, dimensions, queryText); }- Parameters:
customerId- Required. The ID of the customer.dimensions- Required. The types of attributes to be returned.queryText- Required. A free text query. If the requested dimensions include Attributes CATEGORY or KNOWLEDGE_GRAPH, then the attributes returned for those dimensions will match or be related to this string. For other dimensions, this field is ignored and all available attributes are returned.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
listAudienceInsightsAttributes
public final ListAudienceInsightsAttributesResponse listAudienceInsightsAttributes(ListAudienceInsightsAttributesRequest request)
Searches for audience attributes that can be used to generate insights.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { ListAudienceInsightsAttributesRequest request = ListAudienceInsightsAttributesRequest.newBuilder() .setCustomerId("customerId-1581184615") .addAllDimensions( new ArrayList<AudienceInsightsDimensionEnum.AudienceInsightsDimension>()) .setQueryText("queryText-1806881259") .setCustomerInsightsGroup("customerInsightsGroup1092118566") .addAllLocationCountryFilters(new ArrayList<LocationInfo>()) .build(); ListAudienceInsightsAttributesResponse response = audienceInsightsServiceClient.listAudienceInsightsAttributes(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
-
listAudienceInsightsAttributesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListAudienceInsightsAttributesRequest,ListAudienceInsightsAttributesResponse> listAudienceInsightsAttributesCallable()
Searches for audience attributes that can be used to generate insights.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { ListAudienceInsightsAttributesRequest request = ListAudienceInsightsAttributesRequest.newBuilder() .setCustomerId("customerId-1581184615") .addAllDimensions( new ArrayList<AudienceInsightsDimensionEnum.AudienceInsightsDimension>()) .setQueryText("queryText-1806881259") .setCustomerInsightsGroup("customerInsightsGroup1092118566") .addAllLocationCountryFilters(new ArrayList<LocationInfo>()) .build(); ApiFuture<ListAudienceInsightsAttributesResponse> future = audienceInsightsServiceClient .listAudienceInsightsAttributesCallable() .futureCall(request); // Do something. ListAudienceInsightsAttributesResponse response = future.get(); }
-
listInsightsEligibleDates
public final ListInsightsEligibleDatesResponse listInsightsEligibleDates(ListInsightsEligibleDatesRequest request)
Lists date ranges for which audience insights data can be requested.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { ListInsightsEligibleDatesRequest request = ListInsightsEligibleDatesRequest.newBuilder().build(); ListInsightsEligibleDatesResponse response = audienceInsightsServiceClient.listInsightsEligibleDates(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
-
listInsightsEligibleDatesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListInsightsEligibleDatesRequest,ListInsightsEligibleDatesResponse> listInsightsEligibleDatesCallable()
Lists date ranges for which audience insights data can be requested.List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { ListInsightsEligibleDatesRequest request = ListInsightsEligibleDatesRequest.newBuilder().build(); ApiFuture<ListInsightsEligibleDatesResponse> future = audienceInsightsServiceClient.listInsightsEligibleDatesCallable().futureCall(request); // Do something. ListInsightsEligibleDatesResponse response = future.get(); }
-
generateAudienceCompositionInsights
public final GenerateAudienceCompositionInsightsResponse generateAudienceCompositionInsights(java.lang.String customerId, InsightsAudience audience, java.util.List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions)
Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.List of thrown errors: [AudienceInsightsError]() [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { String customerId = "customerId-1581184615"; InsightsAudience audience = InsightsAudience.newBuilder().build(); List<AudienceInsightsDimensionEnum.AudienceInsightsDimension> dimensions = new ArrayList<>(); GenerateAudienceCompositionInsightsResponse response = audienceInsightsServiceClient.generateAudienceCompositionInsights( customerId, audience, dimensions); }- Parameters:
customerId- Required. The ID of the customer.audience- Required. The audience of interest for which insights are being requested.dimensions- Required. The audience dimensions for which composition insights should be returned.- Throws:
com.google.api.gax.rpc.ApiException- if the remote call fails
-
generateAudienceCompositionInsights
public final GenerateAudienceCompositionInsightsResponse generateAudienceCompositionInsights(GenerateAudienceCompositionInsightsRequest request)
Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.List of thrown errors: [AudienceInsightsError]() [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { GenerateAudienceCompositionInsightsRequest request = GenerateAudienceCompositionInsightsRequest.newBuilder() .setCustomerId("customerId-1581184615") .setAudience(InsightsAudience.newBuilder().build()) .setBaselineAudience(InsightsAudience.newBuilder().build()) .setDataMonth("dataMonth-380142346") .addAllDimensions( new ArrayList<AudienceInsightsDimensionEnum.AudienceInsightsDimension>()) .setCustomerInsightsGroup("customerInsightsGroup1092118566") .build(); GenerateAudienceCompositionInsightsResponse response = audienceInsightsServiceClient.generateAudienceCompositionInsights(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
-
generateAudienceCompositionInsightsCallable
public final com.google.api.gax.rpc.UnaryCallable<GenerateAudienceCompositionInsightsRequest,GenerateAudienceCompositionInsightsResponse> generateAudienceCompositionInsightsCallable()
Returns a collection of attributes that are represented in an audience of interest, with metrics that compare each attribute's share of the audience with its share of a baseline audience.List of thrown errors: [AudienceInsightsError]() [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [QuotaError]() [RangeError]() [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 (AudienceInsightsServiceClient audienceInsightsServiceClient = AudienceInsightsServiceClient.create()) { GenerateAudienceCompositionInsightsRequest request = GenerateAudienceCompositionInsightsRequest.newBuilder() .setCustomerId("customerId-1581184615") .setAudience(InsightsAudience.newBuilder().build()) .setBaselineAudience(InsightsAudience.newBuilder().build()) .setDataMonth("dataMonth-380142346") .addAllDimensions( new ArrayList<AudienceInsightsDimensionEnum.AudienceInsightsDimension>()) .setCustomerInsightsGroup("customerInsightsGroup1092118566") .build(); ApiFuture<GenerateAudienceCompositionInsightsResponse> future = audienceInsightsServiceClient .generateAudienceCompositionInsightsCallable() .futureCall(request); // Do something. GenerateAudienceCompositionInsightsResponse response = 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
-
-