GitHub Repository | Product Reference |
Service Description: Service Interface for the Google Marketing Platform Admin API.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
OrganizationName name = OrganizationName.of("[ORGANIZATION]");
Organization response = marketingplatformAdminServiceClient.getOrganization(name);
}
Note: close() needs to be called on the MarketingplatformAdminServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
Method | Description | Method Variants |
---|---|---|
GetOrganization |
Lookup for a single organization. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAnalyticsAccountLinks |
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateAnalyticsAccountLink |
Creates the link between the Analytics account and the Google Marketing Platform organization. User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAnalyticsAccountLink |
Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization. User needs to be an org user, and admin on the Analytics account in order to delete the link. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetPropertyServiceLevel |
Updates the service level for an Analytics property. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of MarketingplatformAdminServiceSettings 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
MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
MarketingplatformAdminServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
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
MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
MarketingplatformAdminServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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
MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
MarketingplatformAdminServiceSettings.newHttpJsonBuilder().build();
MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final MarketingplatformAdminServiceClient create()
Constructs an instance of MarketingplatformAdminServiceClient with default settings.
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(MarketingplatformAdminServiceSettings settings)
public static final MarketingplatformAdminServiceClient create(MarketingplatformAdminServiceSettings settings)
Constructs an instance of MarketingplatformAdminServiceClient, 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 |
MarketingplatformAdminServiceSettings |
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(MarketingplatformAdminServiceStub stub)
public static final MarketingplatformAdminServiceClient create(MarketingplatformAdminServiceStub stub)
Constructs an instance of MarketingplatformAdminServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(MarketingplatformAdminServiceSettings).
Parameter | |
---|---|
Name | Description |
stub |
MarketingplatformAdminServiceStub |
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient |
Constructors
MarketingplatformAdminServiceClient(MarketingplatformAdminServiceSettings settings)
protected MarketingplatformAdminServiceClient(MarketingplatformAdminServiceSettings settings)
Constructs an instance of MarketingplatformAdminServiceClient, 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 |
MarketingplatformAdminServiceSettings |
MarketingplatformAdminServiceClient(MarketingplatformAdminServiceStub stub)
protected MarketingplatformAdminServiceClient(MarketingplatformAdminServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub |
MarketingplatformAdminServiceStub |
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 |
close()
public final void close()
createAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest request)
public final AnalyticsAccountLink createAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest request)
Creates the link between the Analytics account and the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
CreateAnalyticsAccountLinkRequest request =
CreateAnalyticsAccountLinkRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build())
.build();
AnalyticsAccountLink response =
marketingplatformAdminServiceClient.createAnalyticsAccountLink(request);
}
Parameter | |
---|---|
Name | Description |
request |
CreateAnalyticsAccountLinkRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
AnalyticsAccountLink |
createAnalyticsAccountLink(OrganizationName parent, AnalyticsAccountLink analyticsAccountLink)
public final AnalyticsAccountLink createAnalyticsAccountLink(OrganizationName parent, AnalyticsAccountLink analyticsAccountLink)
Creates the link between the Analytics account and the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build();
AnalyticsAccountLink response =
marketingplatformAdminServiceClient.createAnalyticsAccountLink(
parent, analyticsAccountLink);
}
Parameters | |
---|---|
Name | Description |
parent |
OrganizationName Required. The parent resource where this Analytics account link will be created. Format: organizations/{org_id} |
analyticsAccountLink |
AnalyticsAccountLink Required. The Analytics account link to create. |
Returns | |
---|---|
Type | Description |
AnalyticsAccountLink |
createAnalyticsAccountLink(String parent, AnalyticsAccountLink analyticsAccountLink)
public final AnalyticsAccountLink createAnalyticsAccountLink(String parent, AnalyticsAccountLink analyticsAccountLink)
Creates the link between the Analytics account and the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build();
AnalyticsAccountLink response =
marketingplatformAdminServiceClient.createAnalyticsAccountLink(
parent, analyticsAccountLink);
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. The parent resource where this Analytics account link will be created. Format: organizations/{org_id} |
analyticsAccountLink |
AnalyticsAccountLink Required. The Analytics account link to create. |
Returns | |
---|---|
Type | Description |
AnalyticsAccountLink |
createAnalyticsAccountLinkCallable()
public final UnaryCallable<CreateAnalyticsAccountLinkRequest,AnalyticsAccountLink> createAnalyticsAccountLinkCallable()
Creates the link between the Analytics account and the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
CreateAnalyticsAccountLinkRequest request =
CreateAnalyticsAccountLinkRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build())
.build();
ApiFuture<AnalyticsAccountLink> future =
marketingplatformAdminServiceClient
.createAnalyticsAccountLinkCallable()
.futureCall(request);
// Do something.
AnalyticsAccountLink response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateAnalyticsAccountLinkRequest,AnalyticsAccountLink> |
deleteAnalyticsAccountLink(AnalyticsAccountLinkName name)
public final void deleteAnalyticsAccountLink(AnalyticsAccountLinkName name)
Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account in order to delete the link.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
AnalyticsAccountLinkName name =
AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]");
marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name);
}
Parameter | |
---|---|
Name | Description |
name |
AnalyticsAccountLinkName Required. The name of the Analytics account link to delete. Format: organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} |
deleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest request)
public final void deleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest request)
Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account in order to delete the link.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
DeleteAnalyticsAccountLinkRequest request =
DeleteAnalyticsAccountLinkRequest.newBuilder()
.setName(
AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]")
.toString())
.build();
marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(request);
}
Parameter | |
---|---|
Name | Description |
request |
DeleteAnalyticsAccountLinkRequest The request object containing all of the parameters for the API call. |
deleteAnalyticsAccountLink(String name)
public final void deleteAnalyticsAccountLink(String name)
Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account in order to delete the link.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
String name =
AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]").toString();
marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the Analytics account link to delete. Format: organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} |
deleteAnalyticsAccountLinkCallable()
public final UnaryCallable<DeleteAnalyticsAccountLinkRequest,Empty> deleteAnalyticsAccountLinkCallable()
Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization.
User needs to be an org user, and admin on the Analytics account in order to delete the link.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
DeleteAnalyticsAccountLinkRequest request =
DeleteAnalyticsAccountLinkRequest.newBuilder()
.setName(
AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]")
.toString())
.build();
ApiFuture<Empty> future =
marketingplatformAdminServiceClient
.deleteAnalyticsAccountLinkCallable()
.futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteAnalyticsAccountLinkRequest,Empty> |
getOrganization(GetOrganizationRequest request)
public final Organization getOrganization(GetOrganizationRequest request)
Lookup for a single organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
GetOrganizationRequest request =
GetOrganizationRequest.newBuilder()
.setName(OrganizationName.of("[ORGANIZATION]").toString())
.build();
Organization response = marketingplatformAdminServiceClient.getOrganization(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetOrganizationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Organization |
getOrganization(OrganizationName name)
public final Organization getOrganization(OrganizationName name)
Lookup for a single organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
OrganizationName name = OrganizationName.of("[ORGANIZATION]");
Organization response = marketingplatformAdminServiceClient.getOrganization(name);
}
Parameter | |
---|---|
Name | Description |
name |
OrganizationName Required. The name of the Organization to retrieve. Format: organizations/{org_id} |
Returns | |
---|---|
Type | Description |
Organization |
getOrganization(String name)
public final Organization getOrganization(String name)
Lookup for a single organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
String name = OrganizationName.of("[ORGANIZATION]").toString();
Organization response = marketingplatformAdminServiceClient.getOrganization(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the Organization to retrieve. Format: organizations/{org_id} |
Returns | |
---|---|
Type | Description |
Organization |
getOrganizationCallable()
public final UnaryCallable<GetOrganizationRequest,Organization> getOrganizationCallable()
Lookup for a single organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
GetOrganizationRequest request =
GetOrganizationRequest.newBuilder()
.setName(OrganizationName.of("[ORGANIZATION]").toString())
.build();
ApiFuture<Organization> future =
marketingplatformAdminServiceClient.getOrganizationCallable().futureCall(request);
// Do something.
Organization response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetOrganizationRequest,Organization> |
getSettings()
public final MarketingplatformAdminServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceSettings |
getStub()
public MarketingplatformAdminServiceStub getStub()
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest request)
public final MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest request)
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
ListAnalyticsAccountLinksRequest request =
ListAnalyticsAccountLinksRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (AnalyticsAccountLink element :
marketingplatformAdminServiceClient.listAnalyticsAccountLinks(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListAnalyticsAccountLinksRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse |
listAnalyticsAccountLinks(OrganizationName parent)
public final MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks(OrganizationName parent)
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (AnalyticsAccountLink element :
marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
OrganizationName Required. The parent organization, which owns this collection of Analytics account links. Format: organizations/{org_id} |
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse |
listAnalyticsAccountLinks(String parent)
public final MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks(String parent)
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (AnalyticsAccountLink element :
marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The parent organization, which owns this collection of Analytics account links. Format: organizations/{org_id} |
Returns | |
---|---|
Type | Description |
MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse |
listAnalyticsAccountLinksCallable()
public final UnaryCallable<ListAnalyticsAccountLinksRequest,ListAnalyticsAccountLinksResponse> listAnalyticsAccountLinksCallable()
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
ListAnalyticsAccountLinksRequest request =
ListAnalyticsAccountLinksRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListAnalyticsAccountLinksResponse response =
marketingplatformAdminServiceClient.listAnalyticsAccountLinksCallable().call(request);
for (AnalyticsAccountLink element : response.getAnalyticsAccountLinksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListAnalyticsAccountLinksRequest,ListAnalyticsAccountLinksResponse> |
listAnalyticsAccountLinksPagedCallable()
public final UnaryCallable<ListAnalyticsAccountLinksRequest,MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse> listAnalyticsAccountLinksPagedCallable()
Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
ListAnalyticsAccountLinksRequest request =
ListAnalyticsAccountLinksRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<AnalyticsAccountLink> future =
marketingplatformAdminServiceClient
.listAnalyticsAccountLinksPagedCallable()
.futureCall(request);
// Do something.
for (AnalyticsAccountLink element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListAnalyticsAccountLinksRequest,ListAnalyticsAccountLinksPagedResponse> |
setPropertyServiceLevel(SetPropertyServiceLevelRequest request)
public final SetPropertyServiceLevelResponse setPropertyServiceLevel(SetPropertyServiceLevelRequest request)
Updates the service level for an Analytics property.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
SetPropertyServiceLevelRequest request =
SetPropertyServiceLevelRequest.newBuilder()
.setAnalyticsAccountLink("analyticsAccountLink-397570975")
.setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString())
.setServiceLevel(AnalyticsServiceLevel.forNumber(0))
.build();
SetPropertyServiceLevelResponse response =
marketingplatformAdminServiceClient.setPropertyServiceLevel(request);
}
Parameter | |
---|---|
Name | Description |
request |
SetPropertyServiceLevelRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
SetPropertyServiceLevelResponse |
setPropertyServiceLevel(String analyticsAccountLink)
public final SetPropertyServiceLevelResponse setPropertyServiceLevel(String analyticsAccountLink)
Updates the service level for an Analytics property.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
String analyticsAccountLink = "analyticsAccountLink-397570975";
SetPropertyServiceLevelResponse response =
marketingplatformAdminServiceClient.setPropertyServiceLevel(analyticsAccountLink);
}
Parameter | |
---|---|
Name | Description |
analyticsAccountLink |
String Required. The parent AnalyticsAccountLink scope where this property is in. Format: organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} |
Returns | |
---|---|
Type | Description |
SetPropertyServiceLevelResponse |
setPropertyServiceLevelCallable()
public final UnaryCallable<SetPropertyServiceLevelRequest,SetPropertyServiceLevelResponse> setPropertyServiceLevelCallable()
Updates the service level for an Analytics property.
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 (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
MarketingplatformAdminServiceClient.create()) {
SetPropertyServiceLevelRequest request =
SetPropertyServiceLevelRequest.newBuilder()
.setAnalyticsAccountLink("analyticsAccountLink-397570975")
.setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString())
.setServiceLevel(AnalyticsServiceLevel.forNumber(0))
.build();
ApiFuture<SetPropertyServiceLevelResponse> future =
marketingplatformAdminServiceClient.setPropertyServiceLevelCallable().futureCall(request);
// Do something.
SetPropertyServiceLevelResponse response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SetPropertyServiceLevelRequest,SetPropertyServiceLevelResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()