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: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AccountName name = AccountName.of("[ACCOUNT]");
+ * Account response = analyticsAdminServiceClient.getAccount(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the AnalyticsAdminServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
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 AnalyticsAdminServiceSettings + * to create(). For example: + * + *
To customize credentials: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AnalyticsAdminServiceSettings analyticsAdminServiceSettings =
+ * AnalyticsAdminServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create(analyticsAdminServiceSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AnalyticsAdminServiceSettings analyticsAdminServiceSettings =
+ * AnalyticsAdminServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create(analyticsAdminServiceSettings);
+ * }
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AnalyticsAdminServiceSettings analyticsAdminServiceSettings =
+ * AnalyticsAdminServiceSettings.newBuilder()
+ * .setTransportChannelProvider(
+ * AnalyticsAdminServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ * .build();
+ * AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create(analyticsAdminServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsAdminServiceClient implements BackgroundResource { + private final AnalyticsAdminServiceSettings settings; + private final AnalyticsAdminServiceStub stub; + + /** Constructs an instance of AnalyticsAdminServiceClient with default settings. */ + public static final AnalyticsAdminServiceClient create() throws IOException { + return create(AnalyticsAdminServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AnalyticsAdminServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AnalyticsAdminServiceClient create(AnalyticsAdminServiceSettings settings) + throws IOException { + return new AnalyticsAdminServiceClient(settings); + } + + /** + * Constructs an instance of AnalyticsAdminServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(AnalyticsAdminServiceSettings). + */ + public static final AnalyticsAdminServiceClient create(AnalyticsAdminServiceStub stub) { + return new AnalyticsAdminServiceClient(stub); + } + + /** + * Constructs an instance of AnalyticsAdminServiceClient, 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. + */ + protected AnalyticsAdminServiceClient(AnalyticsAdminServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AnalyticsAdminServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected AnalyticsAdminServiceClient(AnalyticsAdminServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AnalyticsAdminServiceSettings getSettings() { + return settings; + } + + public AnalyticsAdminServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lookup for a single Account. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AccountName name = AccountName.of("[ACCOUNT]");
+ * Account response = analyticsAdminServiceClient.getAccount(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the account to lookup. Format: accounts/{account} Example:
+ * "accounts/100"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Account getAccount(AccountName name) {
+ GetAccountRequest request =
+ GetAccountRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getAccount(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single Account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = AccountName.of("[ACCOUNT]").toString();
+ * Account response = analyticsAdminServiceClient.getAccount(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the account to lookup. Format: accounts/{account} Example:
+ * "accounts/100"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Account getAccount(String name) {
+ GetAccountRequest request = GetAccountRequest.newBuilder().setName(name).build();
+ return getAccount(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single Account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetAccountRequest request =
+ * GetAccountRequest.newBuilder().setName(AccountName.of("[ACCOUNT]").toString()).build();
+ * Account response = analyticsAdminServiceClient.getAccount(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Account getAccount(GetAccountRequest request) {
+ return getAccountCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single Account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetAccountRequest request =
+ * GetAccountRequest.newBuilder().setName(AccountName.of("[ACCOUNT]").toString()).build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getAccountCallable().futureCall(request);
+ * // Do something.
+ * Account response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableNote that these accounts might not currently have GA4 properties. Soft-deleted (ie: + * "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are + * found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountsRequest request =
+ * ListAccountsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (Account element : analyticsAdminServiceClient.listAccounts(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListAccountsPagedResponse listAccounts(ListAccountsRequest request) {
+ return listAccountsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns all accounts accessible by the caller.
+ *
+ * Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: + * "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are + * found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountsRequest request =
+ * ListAccountsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listAccountsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Account element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableNote that these accounts might not currently have GA4 properties. Soft-deleted (ie: + * "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are + * found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountsRequest request =
+ * ListAccountsRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListAccountsResponse response =
+ * analyticsAdminServiceClient.listAccountsCallable().call(request);
+ * for (Account element : response.getAccountsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThis API does not have a method to restore soft-deleted accounts. However, they can be + * restored using the Trash Can UI. + * + *
If the accounts are not restored before the expiration time, the account and all child + * resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AccountName name = AccountName.of("[ACCOUNT]");
+ * analyticsAdminServiceClient.deleteAccount(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Account to soft-delete. Format: accounts/{account}
+ * Example: "accounts/100"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAccount(AccountName name) {
+ DeleteAccountRequest request =
+ DeleteAccountRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteAccount(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Account as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted accounts. However, they can be + * restored using the Trash Can UI. + * + *
If the accounts are not restored before the expiration time, the account and all child + * resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = AccountName.of("[ACCOUNT]").toString();
+ * analyticsAdminServiceClient.deleteAccount(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Account to soft-delete. Format: accounts/{account}
+ * Example: "accounts/100"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAccount(String name) {
+ DeleteAccountRequest request = DeleteAccountRequest.newBuilder().setName(name).build();
+ deleteAccount(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Account as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted accounts. However, they can be + * restored using the Trash Can UI. + * + *
If the accounts are not restored before the expiration time, the account and all child + * resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteAccountRequest request =
+ * DeleteAccountRequest.newBuilder().setName(AccountName.of("[ACCOUNT]").toString()).build();
+ * analyticsAdminServiceClient.deleteAccount(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteAccount(DeleteAccountRequest request) {
+ deleteAccountCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Account as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted accounts. However, they can be + * restored using the Trash Can UI. + * + *
If the accounts are not restored before the expiration time, the account and all child + * resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteAccountRequest request =
+ * DeleteAccountRequest.newBuilder().setName(AccountName.of("[ACCOUNT]").toString()).build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteAccountCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * Account account = Account.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Account response = analyticsAdminServiceClient.updateAccount(account, updateMask);
+ * }
+ * }
+ *
+ * @param account Required. The account to update. The account's `name` field is used to identify
+ * the account.
+ * @param updateMask Required. The list of fields to be updated. Field names must be in snake case
+ * (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire
+ * entity, use one path with the string "*" to match all fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Account updateAccount(Account account, FieldMask updateMask) {
+ UpdateAccountRequest request =
+ UpdateAccountRequest.newBuilder().setAccount(account).setUpdateMask(updateMask).build();
+ return updateAccount(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateAccountRequest request =
+ * UpdateAccountRequest.newBuilder()
+ * .setAccount(Account.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Account response = analyticsAdminServiceClient.updateAccount(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Account updateAccount(UpdateAccountRequest request) {
+ return updateAccountCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates an account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateAccountRequest request =
+ * UpdateAccountRequest.newBuilder()
+ * .setAccount(Account.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateAccountCallable().futureCall(request);
+ * // Do something.
+ * Account response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ProvisionAccountTicketRequest request =
+ * ProvisionAccountTicketRequest.newBuilder()
+ * .setAccount(Account.newBuilder().build())
+ * .setRedirectUri("redirectUri1970337776")
+ * .build();
+ * ProvisionAccountTicketResponse response =
+ * analyticsAdminServiceClient.provisionAccountTicket(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ProvisionAccountTicketResponse provisionAccountTicket(
+ ProvisionAccountTicketRequest request) {
+ return provisionAccountTicketCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Requests a ticket for creating an account.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ProvisionAccountTicketRequest request =
+ * ProvisionAccountTicketRequest.newBuilder()
+ * .setAccount(Account.newBuilder().build())
+ * .setRedirectUri("redirectUri1970337776")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.provisionAccountTicketCallable().futureCall(request);
+ * // Do something.
+ * ProvisionAccountTicketResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountSummariesRequest request =
+ * ListAccountSummariesRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (AccountSummary element :
+ * analyticsAdminServiceClient.listAccountSummaries(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListAccountSummariesPagedResponse listAccountSummaries(
+ ListAccountSummariesRequest request) {
+ return listAccountSummariesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns summaries of all accounts accessible by the caller.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountSummariesRequest request =
+ * ListAccountSummariesRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listAccountSummariesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (AccountSummary element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListAccountSummariesRequest request =
+ * ListAccountSummariesRequest.newBuilder()
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListAccountSummariesResponse response =
+ * analyticsAdminServiceClient.listAccountSummariesCallable().call(request);
+ * for (AccountSummary element : response.getAccountSummariesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName name = PropertyName.of("[PROPERTY]");
+ * Property response = analyticsAdminServiceClient.getProperty(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the property to lookup. Format: properties/{property_id}
+ * Example: "properties/1000"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property getProperty(PropertyName name) {
+ GetPropertyRequest request =
+ GetPropertyRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = PropertyName.of("[PROPERTY]").toString();
+ * Property response = analyticsAdminServiceClient.getProperty(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the property to lookup. Format: properties/{property_id}
+ * Example: "properties/1000"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property getProperty(String name) {
+ GetPropertyRequest request = GetPropertyRequest.newBuilder().setName(name).build();
+ return getProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetPropertyRequest request =
+ * GetPropertyRequest.newBuilder().setName(PropertyName.of("[PROPERTY]").toString()).build();
+ * Property response = analyticsAdminServiceClient.getProperty(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Property getProperty(GetPropertyRequest request) {
+ return getPropertyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetPropertyRequest request =
+ * GetPropertyRequest.newBuilder().setName(PropertyName.of("[PROPERTY]").toString()).build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getPropertyCallable().futureCall(request);
+ * // Do something.
+ * Property response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableOnly "GA4" properties will be returned. Properties will be excluded if the caller does not + * have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty + * list if no relevant properties are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListPropertiesRequest request =
+ * ListPropertiesRequest.newBuilder()
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (Property element : analyticsAdminServiceClient.listProperties(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListPropertiesPagedResponse listProperties(ListPropertiesRequest request) {
+ return listPropertiesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns child Properties under the specified parent Account.
+ *
+ * Only "GA4" properties will be returned. Properties will be excluded if the caller does not + * have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty + * list if no relevant properties are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListPropertiesRequest request =
+ * ListPropertiesRequest.newBuilder()
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listPropertiesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Property element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableOnly "GA4" properties will be returned. Properties will be excluded if the caller does not + * have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty + * list if no relevant properties are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListPropertiesRequest request =
+ * ListPropertiesRequest.newBuilder()
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListPropertiesResponse response =
+ * analyticsAdminServiceClient.listPropertiesCallable().call(request);
+ * for (Property element : response.getPropertiesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * Property property = Property.newBuilder().build();
+ * Property response = analyticsAdminServiceClient.createProperty(property);
+ * }
+ * }
+ *
+ * @param property Required. The property to create. Note: the supplied property must specify its
+ * parent.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property createProperty(Property property) {
+ CreatePropertyRequest request =
+ CreatePropertyRequest.newBuilder().setProperty(property).build();
+ return createProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates an "GA4" property with the specified location and attributes.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreatePropertyRequest request =
+ * CreatePropertyRequest.newBuilder().setProperty(Property.newBuilder().build()).build();
+ * Property response = analyticsAdminServiceClient.createProperty(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Property createProperty(CreatePropertyRequest request) {
+ return createPropertyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates an "GA4" property with the specified location and attributes.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreatePropertyRequest request =
+ * CreatePropertyRequest.newBuilder().setProperty(Property.newBuilder().build()).build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createPropertyCallable().futureCall(request);
+ * // Do something.
+ * Property response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis API does not have a method to restore soft-deleted properties. However, they can be + * restored using the Trash Can UI. + * + *
If the properties are not restored before the expiration time, the Property and all child + * resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found, or is not an GA4 Property. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName name = PropertyName.of("[PROPERTY]");
+ * Property response = analyticsAdminServiceClient.deleteProperty(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Property to soft-delete. Format: properties/{property_id}
+ * Example: "properties/1000"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property deleteProperty(PropertyName name) {
+ DeletePropertyRequest request =
+ DeletePropertyRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return deleteProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Property as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted properties. However, they can be + * restored using the Trash Can UI. + * + *
If the properties are not restored before the expiration time, the Property and all child + * resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found, or is not an GA4 Property. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = PropertyName.of("[PROPERTY]").toString();
+ * Property response = analyticsAdminServiceClient.deleteProperty(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Property to soft-delete. Format: properties/{property_id}
+ * Example: "properties/1000"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property deleteProperty(String name) {
+ DeletePropertyRequest request = DeletePropertyRequest.newBuilder().setName(name).build();
+ return deleteProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Property as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted properties. However, they can be + * restored using the Trash Can UI. + * + *
If the properties are not restored before the expiration time, the Property and all child + * resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found, or is not an GA4 Property. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeletePropertyRequest request =
+ * DeletePropertyRequest.newBuilder()
+ * .setName(PropertyName.of("[PROPERTY]").toString())
+ * .build();
+ * Property response = analyticsAdminServiceClient.deleteProperty(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Property deleteProperty(DeletePropertyRequest request) {
+ return deletePropertyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Marks target Property as soft-deleted (ie: "trashed") and returns it.
+ *
+ * This API does not have a method to restore soft-deleted properties. However, they can be + * restored using the Trash Can UI. + * + *
If the properties are not restored before the expiration time, the Property and all child + * resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. + * https://support.google.com/analytics/answer/6154772 + * + *
Returns an error if the target is not found, or is not an GA4 Property. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeletePropertyRequest request =
+ * DeletePropertyRequest.newBuilder()
+ * .setName(PropertyName.of("[PROPERTY]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deletePropertyCallable().futureCall(request);
+ * // Do something.
+ * Property response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * Property property = Property.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Property response = analyticsAdminServiceClient.updateProperty(property, updateMask);
+ * }
+ * }
+ *
+ * @param property Required. The property to update. The property's `name` field is used to
+ * identify the property to be updated.
+ * @param updateMask Required. The list of fields to be updated. Field names must be in snake case
+ * (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire
+ * entity, use one path with the string "*" to match all fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Property updateProperty(Property property, FieldMask updateMask) {
+ UpdatePropertyRequest request =
+ UpdatePropertyRequest.newBuilder().setProperty(property).setUpdateMask(updateMask).build();
+ return updateProperty(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdatePropertyRequest request =
+ * UpdatePropertyRequest.newBuilder()
+ * .setProperty(Property.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Property response = analyticsAdminServiceClient.updateProperty(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final Property updateProperty(UpdatePropertyRequest request) {
+ return updatePropertyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdatePropertyRequest request =
+ * UpdatePropertyRequest.newBuilder()
+ * .setProperty(Property.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updatePropertyCallable().futureCall(request);
+ * // Do something.
+ * Property response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableProperties can have at most one FirebaseLink. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * FirebaseLink firebaseLink = FirebaseLink.newBuilder().build();
+ * FirebaseLink response = analyticsAdminServiceClient.createFirebaseLink(parent, firebaseLink);
+ * }
+ * }
+ *
+ * @param parent Required. Format: properties/{property_id} Example: properties/1234
+ * @param firebaseLink Required. The Firebase link to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FirebaseLink createFirebaseLink(PropertyName parent, FirebaseLink firebaseLink) {
+ CreateFirebaseLinkRequest request =
+ CreateFirebaseLinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setFirebaseLink(firebaseLink)
+ .build();
+ return createFirebaseLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a FirebaseLink.
+ *
+ * Properties can have at most one FirebaseLink. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * FirebaseLink firebaseLink = FirebaseLink.newBuilder().build();
+ * FirebaseLink response = analyticsAdminServiceClient.createFirebaseLink(parent, firebaseLink);
+ * }
+ * }
+ *
+ * @param parent Required. Format: properties/{property_id} Example: properties/1234
+ * @param firebaseLink Required. The Firebase link to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FirebaseLink createFirebaseLink(String parent, FirebaseLink firebaseLink) {
+ CreateFirebaseLinkRequest request =
+ CreateFirebaseLinkRequest.newBuilder()
+ .setParent(parent)
+ .setFirebaseLink(firebaseLink)
+ .build();
+ return createFirebaseLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a FirebaseLink.
+ *
+ * Properties can have at most one FirebaseLink. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateFirebaseLinkRequest request =
+ * CreateFirebaseLinkRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setFirebaseLink(FirebaseLink.newBuilder().build())
+ * .build();
+ * FirebaseLink response = analyticsAdminServiceClient.createFirebaseLink(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final FirebaseLink createFirebaseLink(CreateFirebaseLinkRequest request) {
+ return createFirebaseLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a FirebaseLink.
+ *
+ * Properties can have at most one FirebaseLink. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateFirebaseLinkRequest request =
+ * CreateFirebaseLinkRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setFirebaseLink(FirebaseLink.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createFirebaseLinkCallable().futureCall(request);
+ * // Do something.
+ * FirebaseLink response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * FirebaseLinkName name = FirebaseLinkName.of("[PROPERTY]", "[FIREBASE_LINK]");
+ * analyticsAdminServiceClient.deleteFirebaseLink(name);
+ * }
+ * }
+ *
+ * @param name Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id}
+ * Example: properties/1234/firebaseLinks/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteFirebaseLink(FirebaseLinkName name) {
+ DeleteFirebaseLinkRequest request =
+ DeleteFirebaseLinkRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteFirebaseLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a FirebaseLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = FirebaseLinkName.of("[PROPERTY]", "[FIREBASE_LINK]").toString();
+ * analyticsAdminServiceClient.deleteFirebaseLink(name);
+ * }
+ * }
+ *
+ * @param name Required. Format: properties/{property_id}/firebaseLinks/{firebase_link_id}
+ * Example: properties/1234/firebaseLinks/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteFirebaseLink(String name) {
+ DeleteFirebaseLinkRequest request =
+ DeleteFirebaseLinkRequest.newBuilder().setName(name).build();
+ deleteFirebaseLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a FirebaseLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteFirebaseLinkRequest request =
+ * DeleteFirebaseLinkRequest.newBuilder()
+ * .setName(FirebaseLinkName.of("[PROPERTY]", "[FIREBASE_LINK]").toString())
+ * .build();
+ * analyticsAdminServiceClient.deleteFirebaseLink(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteFirebaseLink(DeleteFirebaseLinkRequest request) {
+ deleteFirebaseLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a FirebaseLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteFirebaseLinkRequest request =
+ * DeleteFirebaseLinkRequest.newBuilder()
+ * .setName(FirebaseLinkName.of("[PROPERTY]", "[FIREBASE_LINK]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteFirebaseLinkCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (FirebaseLink element :
+ * analyticsAdminServiceClient.listFirebaseLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Format: properties/{property_id} Example: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListFirebaseLinksPagedResponse listFirebaseLinks(PropertyName parent) {
+ ListFirebaseLinksRequest request =
+ ListFirebaseLinksRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listFirebaseLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (FirebaseLink element :
+ * analyticsAdminServiceClient.listFirebaseLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Format: properties/{property_id} Example: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListFirebaseLinksPagedResponse listFirebaseLinks(String parent) {
+ ListFirebaseLinksRequest request =
+ ListFirebaseLinksRequest.newBuilder().setParent(parent).build();
+ return listFirebaseLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListFirebaseLinksRequest request =
+ * ListFirebaseLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (FirebaseLink element :
+ * analyticsAdminServiceClient.listFirebaseLinks(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListFirebaseLinksPagedResponse listFirebaseLinks(ListFirebaseLinksRequest request) {
+ return listFirebaseLinksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListFirebaseLinksRequest request =
+ * ListFirebaseLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listFirebaseLinksPagedCallable().futureCall(request);
+ * // Do something.
+ * for (FirebaseLink element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListFirebaseLinksRequest request =
+ * ListFirebaseLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListFirebaseLinksResponse response =
+ * analyticsAdminServiceClient.listFirebaseLinksCallable().call(request);
+ * for (FirebaseLink element : response.getFirebaseLinksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * GoogleAdsLink googleAdsLink = GoogleAdsLink.newBuilder().build();
+ * GoogleAdsLink response =
+ * analyticsAdminServiceClient.createGoogleAdsLink(parent, googleAdsLink);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param googleAdsLink Required. The GoogleAdsLink to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GoogleAdsLink createGoogleAdsLink(PropertyName parent, GoogleAdsLink googleAdsLink) {
+ CreateGoogleAdsLinkRequest request =
+ CreateGoogleAdsLinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setGoogleAdsLink(googleAdsLink)
+ .build();
+ return createGoogleAdsLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a GoogleAdsLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * GoogleAdsLink googleAdsLink = GoogleAdsLink.newBuilder().build();
+ * GoogleAdsLink response =
+ * analyticsAdminServiceClient.createGoogleAdsLink(parent, googleAdsLink);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param googleAdsLink Required. The GoogleAdsLink to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GoogleAdsLink createGoogleAdsLink(String parent, GoogleAdsLink googleAdsLink) {
+ CreateGoogleAdsLinkRequest request =
+ CreateGoogleAdsLinkRequest.newBuilder()
+ .setParent(parent)
+ .setGoogleAdsLink(googleAdsLink)
+ .build();
+ return createGoogleAdsLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a GoogleAdsLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateGoogleAdsLinkRequest request =
+ * CreateGoogleAdsLinkRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setGoogleAdsLink(GoogleAdsLink.newBuilder().build())
+ * .build();
+ * GoogleAdsLink response = analyticsAdminServiceClient.createGoogleAdsLink(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final GoogleAdsLink createGoogleAdsLink(CreateGoogleAdsLinkRequest request) {
+ return createGoogleAdsLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a GoogleAdsLink.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateGoogleAdsLinkRequest request =
+ * CreateGoogleAdsLinkRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setGoogleAdsLink(GoogleAdsLink.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createGoogleAdsLinkCallable().futureCall(request);
+ * // Do something.
+ * GoogleAdsLink response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GoogleAdsLink googleAdsLink = GoogleAdsLink.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * GoogleAdsLink response =
+ * analyticsAdminServiceClient.updateGoogleAdsLink(googleAdsLink, updateMask);
+ * }
+ * }
+ *
+ * @param googleAdsLink The GoogleAdsLink to update
+ * @param updateMask Required. The list of fields to be updated. Field names must be in snake case
+ * (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire
+ * entity, use one path with the string "*" to match all fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GoogleAdsLink updateGoogleAdsLink(
+ GoogleAdsLink googleAdsLink, FieldMask updateMask) {
+ UpdateGoogleAdsLinkRequest request =
+ UpdateGoogleAdsLinkRequest.newBuilder()
+ .setGoogleAdsLink(googleAdsLink)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateGoogleAdsLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a GoogleAdsLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateGoogleAdsLinkRequest request =
+ * UpdateGoogleAdsLinkRequest.newBuilder()
+ * .setGoogleAdsLink(GoogleAdsLink.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * GoogleAdsLink response = analyticsAdminServiceClient.updateGoogleAdsLink(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final GoogleAdsLink updateGoogleAdsLink(UpdateGoogleAdsLinkRequest request) {
+ return updateGoogleAdsLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a GoogleAdsLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateGoogleAdsLinkRequest request =
+ * UpdateGoogleAdsLinkRequest.newBuilder()
+ * .setGoogleAdsLink(GoogleAdsLink.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateGoogleAdsLinkCallable().futureCall(request);
+ * // Do something.
+ * GoogleAdsLink response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GoogleAdsLinkName name = GoogleAdsLinkName.of("[PROPERTY]", "[GOOGLE_ADS_LINK]");
+ * analyticsAdminServiceClient.deleteGoogleAdsLink(name);
+ * }
+ * }
+ *
+ * @param name Required. Example format: properties/1234/googleAdsLinks/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteGoogleAdsLink(GoogleAdsLinkName name) {
+ DeleteGoogleAdsLinkRequest request =
+ DeleteGoogleAdsLinkRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteGoogleAdsLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a GoogleAdsLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = GoogleAdsLinkName.of("[PROPERTY]", "[GOOGLE_ADS_LINK]").toString();
+ * analyticsAdminServiceClient.deleteGoogleAdsLink(name);
+ * }
+ * }
+ *
+ * @param name Required. Example format: properties/1234/googleAdsLinks/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteGoogleAdsLink(String name) {
+ DeleteGoogleAdsLinkRequest request =
+ DeleteGoogleAdsLinkRequest.newBuilder().setName(name).build();
+ deleteGoogleAdsLink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a GoogleAdsLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteGoogleAdsLinkRequest request =
+ * DeleteGoogleAdsLinkRequest.newBuilder()
+ * .setName(GoogleAdsLinkName.of("[PROPERTY]", "[GOOGLE_ADS_LINK]").toString())
+ * .build();
+ * analyticsAdminServiceClient.deleteGoogleAdsLink(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteGoogleAdsLink(DeleteGoogleAdsLinkRequest request) {
+ deleteGoogleAdsLinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a GoogleAdsLink on a property
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteGoogleAdsLinkRequest request =
+ * DeleteGoogleAdsLinkRequest.newBuilder()
+ * .setName(GoogleAdsLinkName.of("[PROPERTY]", "[GOOGLE_ADS_LINK]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteGoogleAdsLinkCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (GoogleAdsLink element :
+ * analyticsAdminServiceClient.listGoogleAdsLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListGoogleAdsLinksPagedResponse listGoogleAdsLinks(PropertyName parent) {
+ ListGoogleAdsLinksRequest request =
+ ListGoogleAdsLinksRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listGoogleAdsLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists GoogleAdsLinks on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (GoogleAdsLink element :
+ * analyticsAdminServiceClient.listGoogleAdsLinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListGoogleAdsLinksPagedResponse listGoogleAdsLinks(String parent) {
+ ListGoogleAdsLinksRequest request =
+ ListGoogleAdsLinksRequest.newBuilder().setParent(parent).build();
+ return listGoogleAdsLinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists GoogleAdsLinks on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListGoogleAdsLinksRequest request =
+ * ListGoogleAdsLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (GoogleAdsLink element :
+ * analyticsAdminServiceClient.listGoogleAdsLinks(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListGoogleAdsLinksPagedResponse listGoogleAdsLinks(
+ ListGoogleAdsLinksRequest request) {
+ return listGoogleAdsLinksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists GoogleAdsLinks on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListGoogleAdsLinksRequest request =
+ * ListGoogleAdsLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listGoogleAdsLinksPagedCallable().futureCall(request);
+ * // Do something.
+ * for (GoogleAdsLink element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListGoogleAdsLinksRequest request =
+ * ListGoogleAdsLinksRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListGoogleAdsLinksResponse response =
+ * analyticsAdminServiceClient.listGoogleAdsLinksCallable().call(request);
+ * for (GoogleAdsLink element : response.getGoogleAdsLinksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataSharingSettingsName name = DataSharingSettingsName.of("[ACCOUNT]");
+ * DataSharingSettings response = analyticsAdminServiceClient.getDataSharingSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the settings to lookup. Format:
+ * accounts/{account}/dataSharingSettings Example: "accounts/1000/dataSharingSettings"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSharingSettings getDataSharingSettings(DataSharingSettingsName name) {
+ GetDataSharingSettingsRequest request =
+ GetDataSharingSettingsRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getDataSharingSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get data sharing settings on an account. Data sharing settings are singletons.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = DataSharingSettingsName.of("[ACCOUNT]").toString();
+ * DataSharingSettings response = analyticsAdminServiceClient.getDataSharingSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the settings to lookup. Format:
+ * accounts/{account}/dataSharingSettings Example: "accounts/1000/dataSharingSettings"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSharingSettings getDataSharingSettings(String name) {
+ GetDataSharingSettingsRequest request =
+ GetDataSharingSettingsRequest.newBuilder().setName(name).build();
+ return getDataSharingSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get data sharing settings on an account. Data sharing settings are singletons.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataSharingSettingsRequest request =
+ * GetDataSharingSettingsRequest.newBuilder()
+ * .setName(DataSharingSettingsName.of("[ACCOUNT]").toString())
+ * .build();
+ * DataSharingSettings response = analyticsAdminServiceClient.getDataSharingSettings(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataSharingSettings getDataSharingSettings(GetDataSharingSettingsRequest request) {
+ return getDataSharingSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Get data sharing settings on an account. Data sharing settings are singletons.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataSharingSettingsRequest request =
+ * GetDataSharingSettingsRequest.newBuilder()
+ * .setName(DataSharingSettingsName.of("[ACCOUNT]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getDataSharingSettingsCallable().futureCall(request);
+ * // Do something.
+ * DataSharingSettings response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * MeasurementProtocolSecretName name =
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]");
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.getMeasurementProtocolSecret(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the measurement protocol secret to lookup. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MeasurementProtocolSecret getMeasurementProtocolSecret(
+ MeasurementProtocolSecretName name) {
+ GetMeasurementProtocolSecretRequest request =
+ GetMeasurementProtocolSecretRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name =
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.getMeasurementProtocolSecret(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the measurement protocol secret to lookup. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MeasurementProtocolSecret getMeasurementProtocolSecret(String name) {
+ GetMeasurementProtocolSecretRequest request =
+ GetMeasurementProtocolSecretRequest.newBuilder().setName(name).build();
+ return getMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetMeasurementProtocolSecretRequest request =
+ * GetMeasurementProtocolSecretRequest.newBuilder()
+ * .setName(
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString())
+ * .build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.getMeasurementProtocolSecret(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final MeasurementProtocolSecret getMeasurementProtocolSecret(
+ GetMeasurementProtocolSecretRequest request) {
+ return getMeasurementProtocolSecretCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single "GA4" MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetMeasurementProtocolSecretRequest request =
+ * GetMeasurementProtocolSecretRequest.newBuilder()
+ * .setName(
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getMeasurementProtocolSecretCallable().futureCall(request);
+ * // Do something.
+ * MeasurementProtocolSecret response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataStreamName parent = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]");
+ * for (MeasurementProtocolSecret element :
+ * analyticsAdminServiceClient.listMeasurementProtocolSecrets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent stream. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMeasurementProtocolSecretsPagedResponse listMeasurementProtocolSecrets(
+ DataStreamName parent) {
+ ListMeasurementProtocolSecretsRequest request =
+ ListMeasurementProtocolSecretsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listMeasurementProtocolSecrets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns child MeasurementProtocolSecrets under the specified parent Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString();
+ * for (MeasurementProtocolSecret element :
+ * analyticsAdminServiceClient.listMeasurementProtocolSecrets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent stream. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMeasurementProtocolSecretsPagedResponse listMeasurementProtocolSecrets(
+ String parent) {
+ ListMeasurementProtocolSecretsRequest request =
+ ListMeasurementProtocolSecretsRequest.newBuilder().setParent(parent).build();
+ return listMeasurementProtocolSecrets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns child MeasurementProtocolSecrets under the specified parent Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListMeasurementProtocolSecretsRequest request =
+ * ListMeasurementProtocolSecretsRequest.newBuilder()
+ * .setParent(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (MeasurementProtocolSecret element :
+ * analyticsAdminServiceClient.listMeasurementProtocolSecrets(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListMeasurementProtocolSecretsPagedResponse listMeasurementProtocolSecrets(
+ ListMeasurementProtocolSecretsRequest request) {
+ return listMeasurementProtocolSecretsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns child MeasurementProtocolSecrets under the specified parent Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListMeasurementProtocolSecretsRequest request =
+ * ListMeasurementProtocolSecretsRequest.newBuilder()
+ * .setParent(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient
+ * .listMeasurementProtocolSecretsPagedCallable()
+ * .futureCall(request);
+ * // Do something.
+ * for (MeasurementProtocolSecret element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListMeasurementProtocolSecretsRequest, ListMeasurementProtocolSecretsPagedResponse>
+ listMeasurementProtocolSecretsPagedCallable() {
+ return stub.listMeasurementProtocolSecretsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns child MeasurementProtocolSecrets under the specified parent Property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListMeasurementProtocolSecretsRequest request =
+ * ListMeasurementProtocolSecretsRequest.newBuilder()
+ * .setParent(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListMeasurementProtocolSecretsResponse response =
+ * analyticsAdminServiceClient.listMeasurementProtocolSecretsCallable().call(request);
+ * for (MeasurementProtocolSecret element : response.getMeasurementProtocolSecretsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListMeasurementProtocolSecretsRequest, ListMeasurementProtocolSecretsResponse>
+ listMeasurementProtocolSecretsCallable() {
+ return stub.listMeasurementProtocolSecretsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataStreamName parent = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]");
+ * MeasurementProtocolSecret measurementProtocolSecret =
+ * MeasurementProtocolSecret.newBuilder().build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.createMeasurementProtocolSecret(
+ * parent, measurementProtocolSecret);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this secret will be created. Format:
+ * properties/{property}/dataStreams/{dataStream}
+ * @param measurementProtocolSecret Required. The measurement protocol secret to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MeasurementProtocolSecret createMeasurementProtocolSecret(
+ DataStreamName parent, MeasurementProtocolSecret measurementProtocolSecret) {
+ CreateMeasurementProtocolSecretRequest request =
+ CreateMeasurementProtocolSecretRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setMeasurementProtocolSecret(measurementProtocolSecret)
+ .build();
+ return createMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString();
+ * MeasurementProtocolSecret measurementProtocolSecret =
+ * MeasurementProtocolSecret.newBuilder().build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.createMeasurementProtocolSecret(
+ * parent, measurementProtocolSecret);
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this secret will be created. Format:
+ * properties/{property}/dataStreams/{dataStream}
+ * @param measurementProtocolSecret Required. The measurement protocol secret to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MeasurementProtocolSecret createMeasurementProtocolSecret(
+ String parent, MeasurementProtocolSecret measurementProtocolSecret) {
+ CreateMeasurementProtocolSecretRequest request =
+ CreateMeasurementProtocolSecretRequest.newBuilder()
+ .setParent(parent)
+ .setMeasurementProtocolSecret(measurementProtocolSecret)
+ .build();
+ return createMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateMeasurementProtocolSecretRequest request =
+ * CreateMeasurementProtocolSecretRequest.newBuilder()
+ * .setParent(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .setMeasurementProtocolSecret(MeasurementProtocolSecret.newBuilder().build())
+ * .build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.createMeasurementProtocolSecret(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final MeasurementProtocolSecret createMeasurementProtocolSecret(
+ CreateMeasurementProtocolSecretRequest request) {
+ return createMeasurementProtocolSecretCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateMeasurementProtocolSecretRequest request =
+ * CreateMeasurementProtocolSecretRequest.newBuilder()
+ * .setParent(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .setMeasurementProtocolSecret(MeasurementProtocolSecret.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createMeasurementProtocolSecretCallable().futureCall(request);
+ * // Do something.
+ * MeasurementProtocolSecret response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * MeasurementProtocolSecretName name =
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]");
+ * analyticsAdminServiceClient.deleteMeasurementProtocolSecret(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the MeasurementProtocolSecret to delete. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteMeasurementProtocolSecret(MeasurementProtocolSecretName name) {
+ DeleteMeasurementProtocolSecretRequest request =
+ DeleteMeasurementProtocolSecretRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes target MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name =
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString();
+ * analyticsAdminServiceClient.deleteMeasurementProtocolSecret(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the MeasurementProtocolSecret to delete. Format:
+ * properties/{property}/dataStreams/{dataStream}/measurementProtocolSecrets/{measurementProtocolSecret}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteMeasurementProtocolSecret(String name) {
+ DeleteMeasurementProtocolSecretRequest request =
+ DeleteMeasurementProtocolSecretRequest.newBuilder().setName(name).build();
+ deleteMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes target MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteMeasurementProtocolSecretRequest request =
+ * DeleteMeasurementProtocolSecretRequest.newBuilder()
+ * .setName(
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString())
+ * .build();
+ * analyticsAdminServiceClient.deleteMeasurementProtocolSecret(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteMeasurementProtocolSecret(
+ DeleteMeasurementProtocolSecretRequest request) {
+ deleteMeasurementProtocolSecretCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes target MeasurementProtocolSecret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteMeasurementProtocolSecretRequest request =
+ * DeleteMeasurementProtocolSecretRequest.newBuilder()
+ * .setName(
+ * MeasurementProtocolSecretName.of(
+ * "[PROPERTY]", "[DATA_STREAM]", "[MEASUREMENT_PROTOCOL_SECRET]")
+ * .toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteMeasurementProtocolSecretCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * MeasurementProtocolSecret measurementProtocolSecret =
+ * MeasurementProtocolSecret.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.updateMeasurementProtocolSecret(
+ * measurementProtocolSecret, updateMask);
+ * }
+ * }
+ *
+ * @param measurementProtocolSecret Required. The measurement protocol secret to update.
+ * @param updateMask The list of fields to be updated. Omitted fields will not be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final MeasurementProtocolSecret updateMeasurementProtocolSecret(
+ MeasurementProtocolSecret measurementProtocolSecret, FieldMask updateMask) {
+ UpdateMeasurementProtocolSecretRequest request =
+ UpdateMeasurementProtocolSecretRequest.newBuilder()
+ .setMeasurementProtocolSecret(measurementProtocolSecret)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateMeasurementProtocolSecret(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateMeasurementProtocolSecretRequest request =
+ * UpdateMeasurementProtocolSecretRequest.newBuilder()
+ * .setMeasurementProtocolSecret(MeasurementProtocolSecret.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * MeasurementProtocolSecret response =
+ * analyticsAdminServiceClient.updateMeasurementProtocolSecret(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final MeasurementProtocolSecret updateMeasurementProtocolSecret(
+ UpdateMeasurementProtocolSecretRequest request) {
+ return updateMeasurementProtocolSecretCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a measurement protocol secret.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateMeasurementProtocolSecretRequest request =
+ * UpdateMeasurementProtocolSecretRequest.newBuilder()
+ * .setMeasurementProtocolSecret(MeasurementProtocolSecret.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateMeasurementProtocolSecretCallable().futureCall(request);
+ * // Do something.
+ * MeasurementProtocolSecret response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis acknowledgement must be completed (either in the Google Analytics UI or via this API) + * before MeasurementProtocolSecret resources may be created. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AcknowledgeUserDataCollectionRequest request =
+ * AcknowledgeUserDataCollectionRequest.newBuilder()
+ * .setProperty(PropertyName.of("[PROPERTY]").toString())
+ * .setAcknowledgement("acknowledgement1769490938")
+ * .build();
+ * AcknowledgeUserDataCollectionResponse response =
+ * analyticsAdminServiceClient.acknowledgeUserDataCollection(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final AcknowledgeUserDataCollectionResponse acknowledgeUserDataCollection(
+ AcknowledgeUserDataCollectionRequest request) {
+ return acknowledgeUserDataCollectionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Acknowledges the terms of user data collection for the specified property.
+ *
+ * This acknowledgement must be completed (either in the Google Analytics UI or via this API) + * before MeasurementProtocolSecret resources may be created. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AcknowledgeUserDataCollectionRequest request =
+ * AcknowledgeUserDataCollectionRequest.newBuilder()
+ * .setProperty(PropertyName.of("[PROPERTY]").toString())
+ * .setAcknowledgement("acknowledgement1769490938")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.acknowledgeUserDataCollectionCallable().futureCall(request);
+ * // Do something.
+ * AcknowledgeUserDataCollectionResponse response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ AcknowledgeUserDataCollectionRequest, AcknowledgeUserDataCollectionResponse>
+ acknowledgeUserDataCollectionCallable() {
+ return stub.acknowledgeUserDataCollectionCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches through all changes to an account or its children given the specified set of filters.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * SearchChangeHistoryEventsRequest request =
+ * SearchChangeHistoryEventsRequest.newBuilder()
+ * .setAccount(AccountName.of("[ACCOUNT]").toString())
+ * .setProperty(PropertyName.of("[PROPERTY]").toString())
+ * .addAllResourceType(new ArrayList())
+ * .addAllAction(new ArrayList())
+ * .addAllActorEmail(new ArrayList())
+ * .setEarliestChangeTime(Timestamp.newBuilder().build())
+ * .setLatestChangeTime(Timestamp.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (ChangeHistoryEvent element :
+ * analyticsAdminServiceClient.searchChangeHistoryEvents(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final SearchChangeHistoryEventsPagedResponse searchChangeHistoryEvents(
+ SearchChangeHistoryEventsRequest request) {
+ return searchChangeHistoryEventsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches through all changes to an account or its children given the specified set of filters.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * SearchChangeHistoryEventsRequest request =
+ * SearchChangeHistoryEventsRequest.newBuilder()
+ * .setAccount(AccountName.of("[ACCOUNT]").toString())
+ * .setProperty(PropertyName.of("[PROPERTY]").toString())
+ * .addAllResourceType(new ArrayList())
+ * .addAllAction(new ArrayList())
+ * .addAllActorEmail(new ArrayList())
+ * .setEarliestChangeTime(Timestamp.newBuilder().build())
+ * .setLatestChangeTime(Timestamp.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.searchChangeHistoryEventsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ChangeHistoryEvent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ SearchChangeHistoryEventsRequest, SearchChangeHistoryEventsPagedResponse>
+ searchChangeHistoryEventsPagedCallable() {
+ return stub.searchChangeHistoryEventsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Searches through all changes to an account or its children given the specified set of filters.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * SearchChangeHistoryEventsRequest request =
+ * SearchChangeHistoryEventsRequest.newBuilder()
+ * .setAccount(AccountName.of("[ACCOUNT]").toString())
+ * .setProperty(PropertyName.of("[PROPERTY]").toString())
+ * .addAllResourceType(new ArrayList())
+ * .addAllAction(new ArrayList())
+ * .addAllActorEmail(new ArrayList())
+ * .setEarliestChangeTime(Timestamp.newBuilder().build())
+ * .setLatestChangeTime(Timestamp.newBuilder().build())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * SearchChangeHistoryEventsResponse response =
+ * analyticsAdminServiceClient.searchChangeHistoryEventsCallable().call(request);
+ * for (ChangeHistoryEvent element : response.getChangeHistoryEventsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * ConversionEvent conversionEvent = ConversionEvent.newBuilder().build();
+ * ConversionEvent response =
+ * analyticsAdminServiceClient.createConversionEvent(parent, conversionEvent);
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent property where this conversion event
+ * will be created. Format: properties/123
+ * @param conversionEvent Required. The conversion event to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ConversionEvent createConversionEvent(
+ PropertyName parent, ConversionEvent conversionEvent) {
+ CreateConversionEventRequest request =
+ CreateConversionEventRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setConversionEvent(conversionEvent)
+ .build();
+ return createConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a conversion event with the specified attributes.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * ConversionEvent conversionEvent = ConversionEvent.newBuilder().build();
+ * ConversionEvent response =
+ * analyticsAdminServiceClient.createConversionEvent(parent, conversionEvent);
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent property where this conversion event
+ * will be created. Format: properties/123
+ * @param conversionEvent Required. The conversion event to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ConversionEvent createConversionEvent(
+ String parent, ConversionEvent conversionEvent) {
+ CreateConversionEventRequest request =
+ CreateConversionEventRequest.newBuilder()
+ .setParent(parent)
+ .setConversionEvent(conversionEvent)
+ .build();
+ return createConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a conversion event with the specified attributes.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateConversionEventRequest request =
+ * CreateConversionEventRequest.newBuilder()
+ * .setConversionEvent(ConversionEvent.newBuilder().build())
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .build();
+ * ConversionEvent response = analyticsAdminServiceClient.createConversionEvent(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ConversionEvent createConversionEvent(CreateConversionEventRequest request) {
+ return createConversionEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a conversion event with the specified attributes.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateConversionEventRequest request =
+ * CreateConversionEventRequest.newBuilder()
+ * .setConversionEvent(ConversionEvent.newBuilder().build())
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createConversionEventCallable().futureCall(request);
+ * // Do something.
+ * ConversionEvent response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ConversionEventName name = ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]");
+ * ConversionEvent response = analyticsAdminServiceClient.getConversionEvent(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the conversion event to retrieve. Format:
+ * properties/{property}/conversionEvents/{conversion_event} Example:
+ * "properties/123/conversionEvents/456"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ConversionEvent getConversionEvent(ConversionEventName name) {
+ GetConversionEventRequest request =
+ GetConversionEventRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieve a single conversion event.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString();
+ * ConversionEvent response = analyticsAdminServiceClient.getConversionEvent(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the conversion event to retrieve. Format:
+ * properties/{property}/conversionEvents/{conversion_event} Example:
+ * "properties/123/conversionEvents/456"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ConversionEvent getConversionEvent(String name) {
+ GetConversionEventRequest request =
+ GetConversionEventRequest.newBuilder().setName(name).build();
+ return getConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieve a single conversion event.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetConversionEventRequest request =
+ * GetConversionEventRequest.newBuilder()
+ * .setName(ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString())
+ * .build();
+ * ConversionEvent response = analyticsAdminServiceClient.getConversionEvent(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ConversionEvent getConversionEvent(GetConversionEventRequest request) {
+ return getConversionEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieve a single conversion event.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetConversionEventRequest request =
+ * GetConversionEventRequest.newBuilder()
+ * .setName(ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getConversionEventCallable().futureCall(request);
+ * // Do something.
+ * ConversionEvent response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ConversionEventName name = ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]");
+ * analyticsAdminServiceClient.deleteConversionEvent(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the conversion event to delete. Format:
+ * properties/{property}/conversionEvents/{conversion_event} Example:
+ * "properties/123/conversionEvents/456"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteConversionEvent(ConversionEventName name) {
+ DeleteConversionEventRequest request =
+ DeleteConversionEventRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversion event in a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString();
+ * analyticsAdminServiceClient.deleteConversionEvent(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the conversion event to delete. Format:
+ * properties/{property}/conversionEvents/{conversion_event} Example:
+ * "properties/123/conversionEvents/456"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteConversionEvent(String name) {
+ DeleteConversionEventRequest request =
+ DeleteConversionEventRequest.newBuilder().setName(name).build();
+ deleteConversionEvent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversion event in a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteConversionEventRequest request =
+ * DeleteConversionEventRequest.newBuilder()
+ * .setName(ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString())
+ * .build();
+ * analyticsAdminServiceClient.deleteConversionEvent(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteConversionEvent(DeleteConversionEventRequest request) {
+ deleteConversionEventCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversion event in a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteConversionEventRequest request =
+ * DeleteConversionEventRequest.newBuilder()
+ * .setName(ConversionEventName.of("[PROPERTY]", "[CONVERSION_EVENT]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteConversionEventCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableReturns an empty list if no conversion events are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (ConversionEvent element :
+ * analyticsAdminServiceClient.listConversionEvents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent property. Example: 'properties/123'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListConversionEventsPagedResponse listConversionEvents(PropertyName parent) {
+ ListConversionEventsRequest request =
+ ListConversionEventsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listConversionEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of conversion events in the specified parent property.
+ *
+ * Returns an empty list if no conversion events are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (ConversionEvent element :
+ * analyticsAdminServiceClient.listConversionEvents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The resource name of the parent property. Example: 'properties/123'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListConversionEventsPagedResponse listConversionEvents(String parent) {
+ ListConversionEventsRequest request =
+ ListConversionEventsRequest.newBuilder().setParent(parent).build();
+ return listConversionEvents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of conversion events in the specified parent property.
+ *
+ * Returns an empty list if no conversion events are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListConversionEventsRequest request =
+ * ListConversionEventsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (ConversionEvent element :
+ * analyticsAdminServiceClient.listConversionEvents(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListConversionEventsPagedResponse listConversionEvents(
+ ListConversionEventsRequest request) {
+ return listConversionEventsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of conversion events in the specified parent property.
+ *
+ * Returns an empty list if no conversion events are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListConversionEventsRequest request =
+ * ListConversionEventsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listConversionEventsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ConversionEvent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableReturns an empty list if no conversion events are found. + * + *
Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListConversionEventsRequest request =
+ * ListConversionEventsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListConversionEventsResponse response =
+ * analyticsAdminServiceClient.listConversionEventsCallable().call(request);
+ * for (ConversionEvent element : response.getConversionEventsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * CustomDimension customDimension = CustomDimension.newBuilder().build();
+ * CustomDimension response =
+ * analyticsAdminServiceClient.createCustomDimension(parent, customDimension);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param customDimension Required. The CustomDimension to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomDimension createCustomDimension(
+ PropertyName parent, CustomDimension customDimension) {
+ CreateCustomDimensionRequest request =
+ CreateCustomDimensionRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setCustomDimension(customDimension)
+ .build();
+ return createCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * CustomDimension customDimension = CustomDimension.newBuilder().build();
+ * CustomDimension response =
+ * analyticsAdminServiceClient.createCustomDimension(parent, customDimension);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param customDimension Required. The CustomDimension to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomDimension createCustomDimension(
+ String parent, CustomDimension customDimension) {
+ CreateCustomDimensionRequest request =
+ CreateCustomDimensionRequest.newBuilder()
+ .setParent(parent)
+ .setCustomDimension(customDimension)
+ .build();
+ return createCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateCustomDimensionRequest request =
+ * CreateCustomDimensionRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setCustomDimension(CustomDimension.newBuilder().build())
+ * .build();
+ * CustomDimension response = analyticsAdminServiceClient.createCustomDimension(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomDimension createCustomDimension(CreateCustomDimensionRequest request) {
+ return createCustomDimensionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateCustomDimensionRequest request =
+ * CreateCustomDimensionRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setCustomDimension(CustomDimension.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createCustomDimensionCallable().futureCall(request);
+ * // Do something.
+ * CustomDimension response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomDimension customDimension = CustomDimension.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CustomDimension response =
+ * analyticsAdminServiceClient.updateCustomDimension(customDimension, updateMask);
+ * }
+ * }
+ *
+ * @param customDimension The CustomDimension to update
+ * @param updateMask Required. The list of fields to be updated. Omitted fields will not be
+ * updated. To replace the entire entity, use one path with the string "*" to match all
+ * fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomDimension updateCustomDimension(
+ CustomDimension customDimension, FieldMask updateMask) {
+ UpdateCustomDimensionRequest request =
+ UpdateCustomDimensionRequest.newBuilder()
+ .setCustomDimension(customDimension)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a CustomDimension on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateCustomDimensionRequest request =
+ * UpdateCustomDimensionRequest.newBuilder()
+ * .setCustomDimension(CustomDimension.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * CustomDimension response = analyticsAdminServiceClient.updateCustomDimension(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomDimension updateCustomDimension(UpdateCustomDimensionRequest request) {
+ return updateCustomDimensionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a CustomDimension on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateCustomDimensionRequest request =
+ * UpdateCustomDimensionRequest.newBuilder()
+ * .setCustomDimension(CustomDimension.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateCustomDimensionCallable().futureCall(request);
+ * // Do something.
+ * CustomDimension response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (CustomDimension element :
+ * analyticsAdminServiceClient.listCustomDimensions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomDimensionsPagedResponse listCustomDimensions(PropertyName parent) {
+ ListCustomDimensionsRequest request =
+ ListCustomDimensionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listCustomDimensions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomDimensions on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (CustomDimension element :
+ * analyticsAdminServiceClient.listCustomDimensions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomDimensionsPagedResponse listCustomDimensions(String parent) {
+ ListCustomDimensionsRequest request =
+ ListCustomDimensionsRequest.newBuilder().setParent(parent).build();
+ return listCustomDimensions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomDimensions on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomDimensionsRequest request =
+ * ListCustomDimensionsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (CustomDimension element :
+ * analyticsAdminServiceClient.listCustomDimensions(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListCustomDimensionsPagedResponse listCustomDimensions(
+ ListCustomDimensionsRequest request) {
+ return listCustomDimensionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomDimensions on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomDimensionsRequest request =
+ * ListCustomDimensionsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listCustomDimensionsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (CustomDimension element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomDimensionsRequest request =
+ * ListCustomDimensionsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListCustomDimensionsResponse response =
+ * analyticsAdminServiceClient.listCustomDimensionsCallable().call(request);
+ * for (CustomDimension element : response.getCustomDimensionsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]");
+ * analyticsAdminServiceClient.archiveCustomDimension(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomDimension to archive. Example format:
+ * properties/1234/customDimensions/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void archiveCustomDimension(CustomDimensionName name) {
+ ArchiveCustomDimensionRequest request =
+ ArchiveCustomDimensionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ archiveCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomDimension on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString();
+ * analyticsAdminServiceClient.archiveCustomDimension(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomDimension to archive. Example format:
+ * properties/1234/customDimensions/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void archiveCustomDimension(String name) {
+ ArchiveCustomDimensionRequest request =
+ ArchiveCustomDimensionRequest.newBuilder().setName(name).build();
+ archiveCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomDimension on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ArchiveCustomDimensionRequest request =
+ * ArchiveCustomDimensionRequest.newBuilder()
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
+ * .build();
+ * analyticsAdminServiceClient.archiveCustomDimension(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void archiveCustomDimension(ArchiveCustomDimensionRequest request) {
+ archiveCustomDimensionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomDimension on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ArchiveCustomDimensionRequest request =
+ * ArchiveCustomDimensionRequest.newBuilder()
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.archiveCustomDimensionCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomDimensionName name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]");
+ * CustomDimension response = analyticsAdminServiceClient.getCustomDimension(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomDimension to get. Example format:
+ * properties/1234/customDimensions/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomDimension getCustomDimension(CustomDimensionName name) {
+ GetCustomDimensionRequest request =
+ GetCustomDimensionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString();
+ * CustomDimension response = analyticsAdminServiceClient.getCustomDimension(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomDimension to get. Example format:
+ * properties/1234/customDimensions/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomDimension getCustomDimension(String name) {
+ GetCustomDimensionRequest request =
+ GetCustomDimensionRequest.newBuilder().setName(name).build();
+ return getCustomDimension(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetCustomDimensionRequest request =
+ * GetCustomDimensionRequest.newBuilder()
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
+ * .build();
+ * CustomDimension response = analyticsAdminServiceClient.getCustomDimension(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomDimension getCustomDimension(GetCustomDimensionRequest request) {
+ return getCustomDimensionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomDimension.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetCustomDimensionRequest request =
+ * GetCustomDimensionRequest.newBuilder()
+ * .setName(CustomDimensionName.of("[PROPERTY]", "[CUSTOM_DIMENSION]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getCustomDimensionCallable().futureCall(request);
+ * // Do something.
+ * CustomDimension response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * CustomMetric customMetric = CustomMetric.newBuilder().build();
+ * CustomMetric response = analyticsAdminServiceClient.createCustomMetric(parent, customMetric);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param customMetric Required. The CustomMetric to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomMetric createCustomMetric(PropertyName parent, CustomMetric customMetric) {
+ CreateCustomMetricRequest request =
+ CreateCustomMetricRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setCustomMetric(customMetric)
+ .build();
+ return createCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * CustomMetric customMetric = CustomMetric.newBuilder().build();
+ * CustomMetric response = analyticsAdminServiceClient.createCustomMetric(parent, customMetric);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param customMetric Required. The CustomMetric to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomMetric createCustomMetric(String parent, CustomMetric customMetric) {
+ CreateCustomMetricRequest request =
+ CreateCustomMetricRequest.newBuilder()
+ .setParent(parent)
+ .setCustomMetric(customMetric)
+ .build();
+ return createCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateCustomMetricRequest request =
+ * CreateCustomMetricRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setCustomMetric(CustomMetric.newBuilder().build())
+ * .build();
+ * CustomMetric response = analyticsAdminServiceClient.createCustomMetric(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomMetric createCustomMetric(CreateCustomMetricRequest request) {
+ return createCustomMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateCustomMetricRequest request =
+ * CreateCustomMetricRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setCustomMetric(CustomMetric.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createCustomMetricCallable().futureCall(request);
+ * // Do something.
+ * CustomMetric response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomMetric customMetric = CustomMetric.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CustomMetric response =
+ * analyticsAdminServiceClient.updateCustomMetric(customMetric, updateMask);
+ * }
+ * }
+ *
+ * @param customMetric The CustomMetric to update
+ * @param updateMask Required. The list of fields to be updated. Omitted fields will not be
+ * updated. To replace the entire entity, use one path with the string "*" to match all
+ * fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomMetric updateCustomMetric(CustomMetric customMetric, FieldMask updateMask) {
+ UpdateCustomMetricRequest request =
+ UpdateCustomMetricRequest.newBuilder()
+ .setCustomMetric(customMetric)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a CustomMetric on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateCustomMetricRequest request =
+ * UpdateCustomMetricRequest.newBuilder()
+ * .setCustomMetric(CustomMetric.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * CustomMetric response = analyticsAdminServiceClient.updateCustomMetric(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomMetric updateCustomMetric(UpdateCustomMetricRequest request) {
+ return updateCustomMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a CustomMetric on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateCustomMetricRequest request =
+ * UpdateCustomMetricRequest.newBuilder()
+ * .setCustomMetric(CustomMetric.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateCustomMetricCallable().futureCall(request);
+ * // Do something.
+ * CustomMetric response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (CustomMetric element :
+ * analyticsAdminServiceClient.listCustomMetrics(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomMetricsPagedResponse listCustomMetrics(PropertyName parent) {
+ ListCustomMetricsRequest request =
+ ListCustomMetricsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listCustomMetrics(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomMetrics on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (CustomMetric element :
+ * analyticsAdminServiceClient.listCustomMetrics(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomMetricsPagedResponse listCustomMetrics(String parent) {
+ ListCustomMetricsRequest request =
+ ListCustomMetricsRequest.newBuilder().setParent(parent).build();
+ return listCustomMetrics(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomMetrics on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomMetricsRequest request =
+ * ListCustomMetricsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (CustomMetric element :
+ * analyticsAdminServiceClient.listCustomMetrics(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListCustomMetricsPagedResponse listCustomMetrics(ListCustomMetricsRequest request) {
+ return listCustomMetricsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomMetrics on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomMetricsRequest request =
+ * ListCustomMetricsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listCustomMetricsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (CustomMetric element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListCustomMetricsRequest request =
+ * ListCustomMetricsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListCustomMetricsResponse response =
+ * analyticsAdminServiceClient.listCustomMetricsCallable().call(request);
+ * for (CustomMetric element : response.getCustomMetricsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomMetricName name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]");
+ * analyticsAdminServiceClient.archiveCustomMetric(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomMetric to archive. Example format:
+ * properties/1234/customMetrics/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void archiveCustomMetric(CustomMetricName name) {
+ ArchiveCustomMetricRequest request =
+ ArchiveCustomMetricRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ archiveCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomMetric on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString();
+ * analyticsAdminServiceClient.archiveCustomMetric(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomMetric to archive. Example format:
+ * properties/1234/customMetrics/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void archiveCustomMetric(String name) {
+ ArchiveCustomMetricRequest request =
+ ArchiveCustomMetricRequest.newBuilder().setName(name).build();
+ archiveCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomMetric on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ArchiveCustomMetricRequest request =
+ * ArchiveCustomMetricRequest.newBuilder()
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
+ * .build();
+ * analyticsAdminServiceClient.archiveCustomMetric(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void archiveCustomMetric(ArchiveCustomMetricRequest request) {
+ archiveCustomMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Archives a CustomMetric on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ArchiveCustomMetricRequest request =
+ * ArchiveCustomMetricRequest.newBuilder()
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.archiveCustomMetricCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CustomMetricName name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]");
+ * CustomMetric response = analyticsAdminServiceClient.getCustomMetric(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomMetric to get. Example format:
+ * properties/1234/customMetrics/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomMetric getCustomMetric(CustomMetricName name) {
+ GetCustomMetricRequest request =
+ GetCustomMetricRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString();
+ * CustomMetric response = analyticsAdminServiceClient.getCustomMetric(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomMetric to get. Example format:
+ * properties/1234/customMetrics/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomMetric getCustomMetric(String name) {
+ GetCustomMetricRequest request = GetCustomMetricRequest.newBuilder().setName(name).build();
+ return getCustomMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetCustomMetricRequest request =
+ * GetCustomMetricRequest.newBuilder()
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
+ * .build();
+ * CustomMetric response = analyticsAdminServiceClient.getCustomMetric(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final CustomMetric getCustomMetric(GetCustomMetricRequest request) {
+ return getCustomMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single CustomMetric.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetCustomMetricRequest request =
+ * GetCustomMetricRequest.newBuilder()
+ * .setName(CustomMetricName.of("[PROPERTY]", "[CUSTOM_METRIC]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getCustomMetricCallable().futureCall(request);
+ * // Do something.
+ * CustomMetric response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataRetentionSettingsName name = DataRetentionSettingsName.of("[PROPERTY]");
+ * DataRetentionSettings response = analyticsAdminServiceClient.getDataRetentionSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the settings to lookup. Format:
+ * properties/{property}/dataRetentionSettings Example:
+ * "properties/1000/dataRetentionSettings"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataRetentionSettings getDataRetentionSettings(DataRetentionSettingsName name) {
+ GetDataRetentionSettingsRequest request =
+ GetDataRetentionSettingsRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getDataRetentionSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the singleton data retention settings for this property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = DataRetentionSettingsName.of("[PROPERTY]").toString();
+ * DataRetentionSettings response = analyticsAdminServiceClient.getDataRetentionSettings(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the settings to lookup. Format:
+ * properties/{property}/dataRetentionSettings Example:
+ * "properties/1000/dataRetentionSettings"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataRetentionSettings getDataRetentionSettings(String name) {
+ GetDataRetentionSettingsRequest request =
+ GetDataRetentionSettingsRequest.newBuilder().setName(name).build();
+ return getDataRetentionSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the singleton data retention settings for this property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataRetentionSettingsRequest request =
+ * GetDataRetentionSettingsRequest.newBuilder()
+ * .setName(DataRetentionSettingsName.of("[PROPERTY]").toString())
+ * .build();
+ * DataRetentionSettings response =
+ * analyticsAdminServiceClient.getDataRetentionSettings(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataRetentionSettings getDataRetentionSettings(
+ GetDataRetentionSettingsRequest request) {
+ return getDataRetentionSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the singleton data retention settings for this property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataRetentionSettingsRequest request =
+ * GetDataRetentionSettingsRequest.newBuilder()
+ * .setName(DataRetentionSettingsName.of("[PROPERTY]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getDataRetentionSettingsCallable().futureCall(request);
+ * // Do something.
+ * DataRetentionSettings response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataRetentionSettings dataRetentionSettings = DataRetentionSettings.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * DataRetentionSettings response =
+ * analyticsAdminServiceClient.updateDataRetentionSettings(
+ * dataRetentionSettings, updateMask);
+ * }
+ * }
+ *
+ * @param dataRetentionSettings Required. The settings to update. The `name` field is used to
+ * identify the settings to be updated.
+ * @param updateMask Required. The list of fields to be updated. Field names must be in snake case
+ * (e.g., "field_to_update"). Omitted fields will not be updated. To replace the entire
+ * entity, use one path with the string "*" to match all fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataRetentionSettings updateDataRetentionSettings(
+ DataRetentionSettings dataRetentionSettings, FieldMask updateMask) {
+ UpdateDataRetentionSettingsRequest request =
+ UpdateDataRetentionSettingsRequest.newBuilder()
+ .setDataRetentionSettings(dataRetentionSettings)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateDataRetentionSettings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the singleton data retention settings for this property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateDataRetentionSettingsRequest request =
+ * UpdateDataRetentionSettingsRequest.newBuilder()
+ * .setDataRetentionSettings(DataRetentionSettings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * DataRetentionSettings response =
+ * analyticsAdminServiceClient.updateDataRetentionSettings(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataRetentionSettings updateDataRetentionSettings(
+ UpdateDataRetentionSettingsRequest request) {
+ return updateDataRetentionSettingsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the singleton data retention settings for this property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateDataRetentionSettingsRequest request =
+ * UpdateDataRetentionSettingsRequest.newBuilder()
+ * .setDataRetentionSettings(DataRetentionSettings.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateDataRetentionSettingsCallable().futureCall(request);
+ * // Do something.
+ * DataRetentionSettings response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * DataStream dataStream = DataStream.newBuilder().build();
+ * DataStream response = analyticsAdminServiceClient.createDataStream(parent, dataStream);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param dataStream Required. The DataStream to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataStream createDataStream(PropertyName parent, DataStream dataStream) {
+ CreateDataStreamRequest request =
+ CreateDataStreamRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setDataStream(dataStream)
+ .build();
+ return createDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * DataStream dataStream = DataStream.newBuilder().build();
+ * DataStream response = analyticsAdminServiceClient.createDataStream(parent, dataStream);
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @param dataStream Required. The DataStream to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataStream createDataStream(String parent, DataStream dataStream) {
+ CreateDataStreamRequest request =
+ CreateDataStreamRequest.newBuilder().setParent(parent).setDataStream(dataStream).build();
+ return createDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateDataStreamRequest request =
+ * CreateDataStreamRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setDataStream(DataStream.newBuilder().build())
+ * .build();
+ * DataStream response = analyticsAdminServiceClient.createDataStream(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataStream createDataStream(CreateDataStreamRequest request) {
+ return createDataStreamCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * CreateDataStreamRequest request =
+ * CreateDataStreamRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setDataStream(DataStream.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.createDataStreamCallable().futureCall(request);
+ * // Do something.
+ * DataStream response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataStreamName name = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]");
+ * analyticsAdminServiceClient.deleteDataStream(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataStream to delete. Example format:
+ * properties/1234/dataStreams/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDataStream(DataStreamName name) {
+ DeleteDataStreamRequest request =
+ DeleteDataStreamRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a DataStream on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString();
+ * analyticsAdminServiceClient.deleteDataStream(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataStream to delete. Example format:
+ * properties/1234/dataStreams/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDataStream(String name) {
+ DeleteDataStreamRequest request = DeleteDataStreamRequest.newBuilder().setName(name).build();
+ deleteDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a DataStream on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteDataStreamRequest request =
+ * DeleteDataStreamRequest.newBuilder()
+ * .setName(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .build();
+ * analyticsAdminServiceClient.deleteDataStream(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final void deleteDataStream(DeleteDataStreamRequest request) {
+ deleteDataStreamCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a DataStream on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DeleteDataStreamRequest request =
+ * DeleteDataStreamRequest.newBuilder()
+ * .setName(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.deleteDataStreamCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataStream dataStream = DataStream.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * DataStream response = analyticsAdminServiceClient.updateDataStream(dataStream, updateMask);
+ * }
+ * }
+ *
+ * @param dataStream The DataStream to update
+ * @param updateMask Required. The list of fields to be updated. Omitted fields will not be
+ * updated. To replace the entire entity, use one path with the string "*" to match all
+ * fields.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataStream updateDataStream(DataStream dataStream, FieldMask updateMask) {
+ UpdateDataStreamRequest request =
+ UpdateDataStreamRequest.newBuilder()
+ .setDataStream(dataStream)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a DataStream on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateDataStreamRequest request =
+ * UpdateDataStreamRequest.newBuilder()
+ * .setDataStream(DataStream.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * DataStream response = analyticsAdminServiceClient.updateDataStream(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataStream updateDataStream(UpdateDataStreamRequest request) {
+ return updateDataStreamCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates a DataStream on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * UpdateDataStreamRequest request =
+ * UpdateDataStreamRequest.newBuilder()
+ * .setDataStream(DataStream.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.updateDataStreamCallable().futureCall(request);
+ * // Do something.
+ * DataStream response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * PropertyName parent = PropertyName.of("[PROPERTY]");
+ * for (DataStream element : analyticsAdminServiceClient.listDataStreams(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataStreamsPagedResponse listDataStreams(PropertyName parent) {
+ ListDataStreamsRequest request =
+ ListDataStreamsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDataStreams(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataStreams on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String parent = PropertyName.of("[PROPERTY]").toString();
+ * for (DataStream element : analyticsAdminServiceClient.listDataStreams(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Example format: properties/1234
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataStreamsPagedResponse listDataStreams(String parent) {
+ ListDataStreamsRequest request = ListDataStreamsRequest.newBuilder().setParent(parent).build();
+ return listDataStreams(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataStreams on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListDataStreamsRequest request =
+ * ListDataStreamsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (DataStream element : analyticsAdminServiceClient.listDataStreams(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final ListDataStreamsPagedResponse listDataStreams(ListDataStreamsRequest request) {
+ return listDataStreamsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataStreams on a property.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListDataStreamsRequest request =
+ * ListDataStreamsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.listDataStreamsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DataStream element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * ListDataStreamsRequest request =
+ * ListDataStreamsRequest.newBuilder()
+ * .setParent(PropertyName.of("[PROPERTY]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListDataStreamsResponse response =
+ * analyticsAdminServiceClient.listDataStreamsCallable().call(request);
+ * for (DataStream element : response.getDataStreamsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * DataStreamName name = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]");
+ * DataStream response = analyticsAdminServiceClient.getDataStream(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataStream to get. Example format:
+ * properties/1234/dataStreams/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataStream getDataStream(DataStreamName name) {
+ GetDataStreamRequest request =
+ GetDataStreamRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * String name = DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString();
+ * DataStream response = analyticsAdminServiceClient.getDataStream(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataStream to get. Example format:
+ * properties/1234/dataStreams/5678
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataStream getDataStream(String name) {
+ GetDataStreamRequest request = GetDataStreamRequest.newBuilder().setName(name).build();
+ return getDataStream(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataStreamRequest request =
+ * GetDataStreamRequest.newBuilder()
+ * .setName(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .build();
+ * DataStream response = analyticsAdminServiceClient.getDataStream(request);
+ * }
+ * }
+ *
+ * @param 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
+ */
+ public final DataStream getDataStream(GetDataStreamRequest request) {
+ return getDataStreamCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lookup for a single DataStream.
+ *
+ * Sample code: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * GetDataStreamRequest request =
+ * GetDataStreamRequest.newBuilder()
+ * .setName(DataStreamName.of("[PROPERTY]", "[DATA_STREAM]").toString())
+ * .build();
+ * ApiFuture future =
+ * analyticsAdminServiceClient.getDataStreamCallable().futureCall(request);
+ * // Do something.
+ * DataStream response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getAccount to 30 seconds: + * + *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AnalyticsAdminServiceSettings.Builder analyticsAdminServiceSettingsBuilder =
+ * AnalyticsAdminServiceSettings.newBuilder();
+ * analyticsAdminServiceSettingsBuilder
+ * .getAccountSettings()
+ * .setRetrySettings(
+ * analyticsAdminServiceSettingsBuilder
+ * .getAccountSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * AnalyticsAdminServiceSettings analyticsAdminServiceSettings =
+ * analyticsAdminServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class AnalyticsAdminServiceSettings extends ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= AnalyticsAdminServiceClient =======================
+ *
+ * Service Description: Service Interface for the Analytics Admin API (GA4).
+ *
+ * Sample for AnalyticsAdminServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class AnalyticsAdminServiceStub implements BackgroundResource {
+
+ public UnaryCallable{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (AnalyticsAdminServiceClient analyticsAdminServiceClient =
+ * AnalyticsAdminServiceClient.create()) {
+ * AccountName name = AccountName.of("[ACCOUNT]");
+ * Account response = analyticsAdminServiceClient.getAccount(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.analytics.admin.v1beta;
+
+import javax.annotation.Generated;
diff --git a/google-analytics-admin/src/main/java/com/google/analytics/admin/v1beta/stub/AnalyticsAdminServiceStub.java b/google-analytics-admin/src/main/java/com/google/analytics/admin/v1beta/stub/AnalyticsAdminServiceStub.java
new file mode 100644
index 00000000..382435fd
--- /dev/null
+++ b/google-analytics-admin/src/main/java/com/google/analytics/admin/v1beta/stub/AnalyticsAdminServiceStub.java
@@ -0,0 +1,393 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.analytics.admin.v1beta.stub;
+
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListAccountSummariesPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListAccountsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListConversionEventsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListCustomDimensionsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListCustomMetricsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListDataStreamsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListFirebaseLinksPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListGoogleAdsLinksPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListMeasurementProtocolSecretsPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.ListPropertiesPagedResponse;
+import static com.google.analytics.admin.v1beta.AnalyticsAdminServiceClient.SearchChangeHistoryEventsPagedResponse;
+
+import com.google.analytics.admin.v1beta.Account;
+import com.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionRequest;
+import com.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse;
+import com.google.analytics.admin.v1beta.ArchiveCustomDimensionRequest;
+import com.google.analytics.admin.v1beta.ArchiveCustomMetricRequest;
+import com.google.analytics.admin.v1beta.ConversionEvent;
+import com.google.analytics.admin.v1beta.CreateConversionEventRequest;
+import com.google.analytics.admin.v1beta.CreateCustomDimensionRequest;
+import com.google.analytics.admin.v1beta.CreateCustomMetricRequest;
+import com.google.analytics.admin.v1beta.CreateDataStreamRequest;
+import com.google.analytics.admin.v1beta.CreateFirebaseLinkRequest;
+import com.google.analytics.admin.v1beta.CreateGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1beta.CreateMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1beta.CreatePropertyRequest;
+import com.google.analytics.admin.v1beta.CustomDimension;
+import com.google.analytics.admin.v1beta.CustomMetric;
+import com.google.analytics.admin.v1beta.DataRetentionSettings;
+import com.google.analytics.admin.v1beta.DataSharingSettings;
+import com.google.analytics.admin.v1beta.DataStream;
+import com.google.analytics.admin.v1beta.DeleteAccountRequest;
+import com.google.analytics.admin.v1beta.DeleteConversionEventRequest;
+import com.google.analytics.admin.v1beta.DeleteDataStreamRequest;
+import com.google.analytics.admin.v1beta.DeleteFirebaseLinkRequest;
+import com.google.analytics.admin.v1beta.DeleteGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1beta.DeleteMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1beta.DeletePropertyRequest;
+import com.google.analytics.admin.v1beta.FirebaseLink;
+import com.google.analytics.admin.v1beta.GetAccountRequest;
+import com.google.analytics.admin.v1beta.GetConversionEventRequest;
+import com.google.analytics.admin.v1beta.GetCustomDimensionRequest;
+import com.google.analytics.admin.v1beta.GetCustomMetricRequest;
+import com.google.analytics.admin.v1beta.GetDataRetentionSettingsRequest;
+import com.google.analytics.admin.v1beta.GetDataSharingSettingsRequest;
+import com.google.analytics.admin.v1beta.GetDataStreamRequest;
+import com.google.analytics.admin.v1beta.GetMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1beta.GetPropertyRequest;
+import com.google.analytics.admin.v1beta.GoogleAdsLink;
+import com.google.analytics.admin.v1beta.ListAccountSummariesRequest;
+import com.google.analytics.admin.v1beta.ListAccountSummariesResponse;
+import com.google.analytics.admin.v1beta.ListAccountsRequest;
+import com.google.analytics.admin.v1beta.ListAccountsResponse;
+import com.google.analytics.admin.v1beta.ListConversionEventsRequest;
+import com.google.analytics.admin.v1beta.ListConversionEventsResponse;
+import com.google.analytics.admin.v1beta.ListCustomDimensionsRequest;
+import com.google.analytics.admin.v1beta.ListCustomDimensionsResponse;
+import com.google.analytics.admin.v1beta.ListCustomMetricsRequest;
+import com.google.analytics.admin.v1beta.ListCustomMetricsResponse;
+import com.google.analytics.admin.v1beta.ListDataStreamsRequest;
+import com.google.analytics.admin.v1beta.ListDataStreamsResponse;
+import com.google.analytics.admin.v1beta.ListFirebaseLinksRequest;
+import com.google.analytics.admin.v1beta.ListFirebaseLinksResponse;
+import com.google.analytics.admin.v1beta.ListGoogleAdsLinksRequest;
+import com.google.analytics.admin.v1beta.ListGoogleAdsLinksResponse;
+import com.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsRequest;
+import com.google.analytics.admin.v1beta.ListMeasurementProtocolSecretsResponse;
+import com.google.analytics.admin.v1beta.ListPropertiesRequest;
+import com.google.analytics.admin.v1beta.ListPropertiesResponse;
+import com.google.analytics.admin.v1beta.MeasurementProtocolSecret;
+import com.google.analytics.admin.v1beta.Property;
+import com.google.analytics.admin.v1beta.ProvisionAccountTicketRequest;
+import com.google.analytics.admin.v1beta.ProvisionAccountTicketResponse;
+import com.google.analytics.admin.v1beta.SearchChangeHistoryEventsRequest;
+import com.google.analytics.admin.v1beta.SearchChangeHistoryEventsResponse;
+import com.google.analytics.admin.v1beta.UpdateAccountRequest;
+import com.google.analytics.admin.v1beta.UpdateCustomDimensionRequest;
+import com.google.analytics.admin.v1beta.UpdateCustomMetricRequest;
+import com.google.analytics.admin.v1beta.UpdateDataRetentionSettingsRequest;
+import com.google.analytics.admin.v1beta.UpdateDataStreamRequest;
+import com.google.analytics.admin.v1beta.UpdateGoogleAdsLinkRequest;
+import com.google.analytics.admin.v1beta.UpdateMeasurementProtocolSecretRequest;
+import com.google.analytics.admin.v1beta.UpdatePropertyRequest;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the AnalyticsAdminService service API.
+ *
+ *