diff --git a/generation_config.yaml b/generation_config.yaml index 38eee766d72a..7d52fc168bcc 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1352,6 +1352,24 @@ libraries: - proto_path: google/maps/solar/v1 requires_billing: true rpc_documentation: https://developers.google.com/maps/documentation/solar/reference/rest +- api_shortname: marketingplatformadminapi + name_pretty: Google Marketing Platform Admin API + product_documentation: https://developers.google.com/analytics/devguides/config/gmp/v1 + api_description: The Google Marketing Platform Admin API allows for programmatic + access to the Google Marketing Platform configuration data. You can use the Google + Marketing Platform Admin API to manage links between your Google Marketing Platform + organization and Google Analytics accounts, and to set the service level of your + GA4 properties. + client_documentation: https://cloud.google.com/java/docs/reference/admin/latest/overview + release_level: preview + distribution_name: com.google.ads-marketingplatform:admin + api_id: marketingplatformadminapi.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.ads-marketingplatform + cloud_api: false + GAPICs: + - proto_path: google/marketingplatform/admin/v1alpha + requires_billing: true - api_shortname: mediatranslation name_pretty: Media Translation API product_documentation: https://cloud.google.com/ diff --git a/java-marketingplatformadminapi/.OwlBot-hermetic.yaml b/java-marketingplatformadminapi/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..d07fb81d9208 --- /dev/null +++ b/java-marketingplatformadminapi/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 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 +# +# http://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. + + +deep-remove-regex: +- "/java-marketingplatformadminapi/grpc-google-.*/src" +- "/java-marketingplatformadminapi/proto-google-.*/src" +- "/java-marketingplatformadminapi/google-.*/src" +- "/java-marketingplatformadminapi/samples/snippets/generated" + +deep-preserve-regex: +- "/java-marketingplatformadminapi/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/marketingplatform/admin/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-marketingplatformadminapi/$1/proto-admin-$1/src" +- source: "/google/marketingplatform/admin/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-marketingplatformadminapi/$1/grpc-admin-$1/src" +- source: "/google/marketingplatform/admin/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-marketingplatformadminapi/$1/admin/src" +- source: "/google/marketingplatform/admin/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-marketingplatformadminapi/$1/samples/snippets/generated" + +api-name: marketingplatformadminapi \ No newline at end of file diff --git a/java-marketingplatformadminapi/.repo-metadata.json b/java-marketingplatformadminapi/.repo-metadata.json new file mode 100644 index 000000000000..209429fca0ad --- /dev/null +++ b/java-marketingplatformadminapi/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "marketingplatformadminapi", + "name_pretty": "Google Marketing Platform Admin API", + "product_documentation": "https://developers.google.com/analytics/devguides/config/gmp/v1", + "api_description": "The Google Marketing Platform Admin API allows for programmatic access to the Google Marketing Platform configuration data. You can use the Google Marketing Platform Admin API to manage links between your Google Marketing Platform organization and Google Analytics accounts, and to set the service level of your GA4 properties.", + "client_documentation": "https://cloud.google.com/java/docs/reference/admin/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-marketingplatformadminapi", + "distribution_name": "com.google.ads-marketingplatform:admin", + "api_id": "marketingplatformadminapi.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-marketingplatformadminapi/README.md b/java-marketingplatformadminapi/README.md new file mode 100644 index 000000000000..f0c13d5b8217 --- /dev/null +++ b/java-marketingplatformadminapi/README.md @@ -0,0 +1,226 @@ +# Google Google Marketing Platform Admin API Client for Java + +Java idiomatic client for [Google Marketing Platform Admin API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.47.0 + pom + import + + + + + + + com.google.ads-marketingplatform + admin + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.ads-marketingplatform + admin + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.ads-marketingplatform:admin:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.ads-marketingplatform" % "admin" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Google Marketing Platform Admin API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Google Marketing Platform Admin API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Google Marketing Platform Admin API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Google Marketing Platform Admin API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `admin` library. See the [Quickstart](#quickstart) section +to add `admin` as a dependency in your code. + +## About Google Marketing Platform Admin API + + +[Google Marketing Platform Admin API][product-docs] The Google Marketing Platform Admin API allows for programmatic access to the Google Marketing Platform configuration data. You can use the Google Marketing Platform Admin API to manage links between your Google Marketing Platform organization and Google Analytics accounts, and to set the service level of your GA4 properties. + +See the [Google Marketing Platform Admin API client library docs][javadocs] to learn how to +use this Google Marketing Platform Admin API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Google Marketing Platform Admin API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://developers.google.com/analytics/devguides/config/gmp/v1 +[javadocs]: https://cloud.google.com/java/docs/reference/admin/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.ads-marketingplatform/admin.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.ads-marketingplatform/admin/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=marketingplatformadminapi.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-marketingplatformadminapi/admin-bom/pom.xml b/java-marketingplatformadminapi/admin-bom/pom.xml new file mode 100644 index 000000000000..fca04d352a84 --- /dev/null +++ b/java-marketingplatformadminapi/admin-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.ads-marketingplatform + admin-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.46.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Google Marketing Platform Admin API BOM + + BOM for Google Marketing Platform Admin API + + + + true + + + + + + com.google.ads-marketingplatform + admin + 0.0.1-SNAPSHOT + + + com.google.ads-marketingplatform.api.grpc + grpc-admin-v1alpha + 0.0.1-SNAPSHOT + + + com.google.ads-marketingplatform.api.grpc + proto-admin-v1alpha + 0.0.1-SNAPSHOT + + + + diff --git a/java-marketingplatformadminapi/admin/pom.xml b/java-marketingplatformadminapi/admin/pom.xml new file mode 100644 index 000000000000..9f007aabf563 --- /dev/null +++ b/java-marketingplatformadminapi/admin/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + com.google.ads-marketingplatform + admin + 0.0.1-SNAPSHOT + jar + Google Google Marketing Platform Admin API + Google Marketing Platform Admin API The Google Marketing Platform Admin API allows for programmatic access to the Google Marketing Platform configuration data. You can use the Google Marketing Platform Admin API to manage links between your Google Marketing Platform organization and Google Analytics accounts, and to set the service level of your GA4 properties. + + com.google.ads-marketingplatform + admin-parent + 0.0.1-SNAPSHOT + + + admin + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.ads-marketingplatform.api.grpc + proto-admin-v1alpha + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + proto-google-iam-v1 + + + org.threeten + threetenbp + + + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + junit + junit + test + + + + com.google.ads-marketingplatform.api.grpc + grpc-admin-v1alpha + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClient.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClient.java new file mode 100644 index 000000000000..8c946598756c --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClient.java @@ -0,0 +1,1097 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.ads.marketingplatform.admin.v1alpha.stub.MarketingplatformAdminServiceStub; +import com.google.ads.marketingplatform.admin.v1alpha.stub.MarketingplatformAdminServiceStubSettings; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service Interface for the Google Marketing Platform Admin API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+ *     MarketingplatformAdminServiceClient.create()) {
+ *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+ *   Organization response = marketingplatformAdminServiceClient.getOrganization(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the MarketingplatformAdminServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

GetOrganization

Lookup for a single organization.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getOrganization(GetOrganizationRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getOrganization(OrganizationName name) + *

  • getOrganization(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getOrganizationCallable() + *

+ *

ListAnalyticsAccountLinks

Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listAnalyticsAccountLinks(OrganizationName parent) + *

  • listAnalyticsAccountLinks(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listAnalyticsAccountLinksPagedCallable() + *

  • listAnalyticsAccountLinksCallable() + *

+ *

CreateAnalyticsAccountLink

Creates the link between the Analytics account and the Google Marketing Platform organization. + *

User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createAnalyticsAccountLink(OrganizationName parent, AnalyticsAccountLink analyticsAccountLink) + *

  • createAnalyticsAccountLink(String parent, AnalyticsAccountLink analyticsAccountLink) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createAnalyticsAccountLinkCallable() + *

+ *

DeleteAnalyticsAccountLink

Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization. + *

User needs to be an org user, and admin on the Analytics account in order to delete the link.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteAnalyticsAccountLink(AnalyticsAccountLinkName name) + *

  • deleteAnalyticsAccountLink(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteAnalyticsAccountLinkCallable() + *

+ *

SetPropertyServiceLevel

Updates the service level for an Analytics property.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setPropertyServiceLevel(SetPropertyServiceLevelRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • setPropertyServiceLevel(String analyticsAccountLink) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setPropertyServiceLevelCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * MarketingplatformAdminServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
+ *     MarketingplatformAdminServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+ *     MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
+ *     MarketingplatformAdminServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+ *     MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
+ *     MarketingplatformAdminServiceSettings.newHttpJsonBuilder().build();
+ * MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+ *     MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MarketingplatformAdminServiceClient implements BackgroundResource { + private final MarketingplatformAdminServiceSettings settings; + private final MarketingplatformAdminServiceStub stub; + + /** Constructs an instance of MarketingplatformAdminServiceClient with default settings. */ + public static final MarketingplatformAdminServiceClient create() throws IOException { + return create(MarketingplatformAdminServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MarketingplatformAdminServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final MarketingplatformAdminServiceClient create( + MarketingplatformAdminServiceSettings settings) throws IOException { + return new MarketingplatformAdminServiceClient(settings); + } + + /** + * Constructs an instance of MarketingplatformAdminServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(MarketingplatformAdminServiceSettings). + */ + public static final MarketingplatformAdminServiceClient create( + MarketingplatformAdminServiceStub stub) { + return new MarketingplatformAdminServiceClient(stub); + } + + /** + * Constructs an instance of MarketingplatformAdminServiceClient, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected MarketingplatformAdminServiceClient(MarketingplatformAdminServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((MarketingplatformAdminServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected MarketingplatformAdminServiceClient(MarketingplatformAdminServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final MarketingplatformAdminServiceSettings getSettings() { + return settings; + } + + public MarketingplatformAdminServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lookup for a single organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   Organization response = marketingplatformAdminServiceClient.getOrganization(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Organization to retrieve. Format: organizations/{org_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Organization getOrganization(OrganizationName name) { + GetOrganizationRequest request = + GetOrganizationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getOrganization(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lookup for a single organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   String name = OrganizationName.of("[ORGANIZATION]").toString();
+   *   Organization response = marketingplatformAdminServiceClient.getOrganization(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Organization to retrieve. Format: organizations/{org_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Organization getOrganization(String name) { + GetOrganizationRequest request = GetOrganizationRequest.newBuilder().setName(name).build(); + return getOrganization(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lookup for a single organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   GetOrganizationRequest request =
+   *       GetOrganizationRequest.newBuilder()
+   *           .setName(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .build();
+   *   Organization response = marketingplatformAdminServiceClient.getOrganization(request);
+   * }
+   * }
+ * + * @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 Organization getOrganization(GetOrganizationRequest request) { + return getOrganizationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lookup for a single organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   GetOrganizationRequest request =
+   *       GetOrganizationRequest.newBuilder()
+   *           .setName(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       marketingplatformAdminServiceClient.getOrganizationCallable().futureCall(request);
+   *   // Do something.
+   *   Organization response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getOrganizationCallable() { + return stub.getOrganizationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Google Analytics accounts link to the specified Google Marketing Platform + * organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (AnalyticsAccountLink element :
+   *       marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent organization, which owns this collection of Analytics + * account links. Format: organizations/{org_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks( + OrganizationName parent) { + ListAnalyticsAccountLinksRequest request = + ListAnalyticsAccountLinksRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAnalyticsAccountLinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Google Analytics accounts link to the specified Google Marketing Platform + * organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]").toString();
+   *   for (AnalyticsAccountLink element :
+   *       marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent organization, which owns this collection of Analytics + * account links. Format: organizations/{org_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks(String parent) { + ListAnalyticsAccountLinksRequest request = + ListAnalyticsAccountLinksRequest.newBuilder().setParent(parent).build(); + return listAnalyticsAccountLinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Google Analytics accounts link to the specified Google Marketing Platform + * organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   ListAnalyticsAccountLinksRequest request =
+   *       ListAnalyticsAccountLinksRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AnalyticsAccountLink element :
+   *       marketingplatformAdminServiceClient.listAnalyticsAccountLinks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListAnalyticsAccountLinksPagedResponse listAnalyticsAccountLinks( + ListAnalyticsAccountLinksRequest request) { + return listAnalyticsAccountLinksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Google Analytics accounts link to the specified Google Marketing Platform + * organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   ListAnalyticsAccountLinksRequest request =
+   *       ListAnalyticsAccountLinksRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       marketingplatformAdminServiceClient
+   *           .listAnalyticsAccountLinksPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (AnalyticsAccountLink element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksPagedCallable() { + return stub.listAnalyticsAccountLinksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the Google Analytics accounts link to the specified Google Marketing Platform + * organization. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   ListAnalyticsAccountLinksRequest request =
+   *       ListAnalyticsAccountLinksRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAnalyticsAccountLinksResponse response =
+   *         marketingplatformAdminServiceClient.listAnalyticsAccountLinksCallable().call(request);
+   *     for (AnalyticsAccountLink element : response.getAnalyticsAccountLinksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAnalyticsAccountLinksCallable() { + return stub.listAnalyticsAccountLinksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the link between the Analytics account and the Google Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account to create the link. If the + * account is already linked to an organization, user needs to unlink the account from the current + * organization, then try link again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build();
+   *   AnalyticsAccountLink response =
+   *       marketingplatformAdminServiceClient.createAnalyticsAccountLink(
+   *           parent, analyticsAccountLink);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this Analytics account link will be created. + * Format: organizations/{org_id} + * @param analyticsAccountLink Required. The Analytics account link to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnalyticsAccountLink createAnalyticsAccountLink( + OrganizationName parent, AnalyticsAccountLink analyticsAccountLink) { + CreateAnalyticsAccountLinkRequest request = + CreateAnalyticsAccountLinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAnalyticsAccountLink(analyticsAccountLink) + .build(); + return createAnalyticsAccountLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the link between the Analytics account and the Google Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account to create the link. If the + * account is already linked to an organization, user needs to unlink the account from the current + * organization, then try link again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]").toString();
+   *   AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build();
+   *   AnalyticsAccountLink response =
+   *       marketingplatformAdminServiceClient.createAnalyticsAccountLink(
+   *           parent, analyticsAccountLink);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this Analytics account link will be created. + * Format: organizations/{org_id} + * @param analyticsAccountLink Required. The Analytics account link to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnalyticsAccountLink createAnalyticsAccountLink( + String parent, AnalyticsAccountLink analyticsAccountLink) { + CreateAnalyticsAccountLinkRequest request = + CreateAnalyticsAccountLinkRequest.newBuilder() + .setParent(parent) + .setAnalyticsAccountLink(analyticsAccountLink) + .build(); + return createAnalyticsAccountLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the link between the Analytics account and the Google Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account to create the link. If the + * account is already linked to an organization, user needs to unlink the account from the current + * organization, then try link again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   CreateAnalyticsAccountLinkRequest request =
+   *       CreateAnalyticsAccountLinkRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build())
+   *           .build();
+   *   AnalyticsAccountLink response =
+   *       marketingplatformAdminServiceClient.createAnalyticsAccountLink(request);
+   * }
+   * }
+ * + * @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 AnalyticsAccountLink createAnalyticsAccountLink( + CreateAnalyticsAccountLinkRequest request) { + return createAnalyticsAccountLinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the link between the Analytics account and the Google Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account to create the link. If the + * account is already linked to an organization, user needs to unlink the account from the current + * organization, then try link again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   CreateAnalyticsAccountLinkRequest request =
+   *       CreateAnalyticsAccountLinkRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]").toString())
+   *           .setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       marketingplatformAdminServiceClient
+   *           .createAnalyticsAccountLinkCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   AnalyticsAccountLink response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createAnalyticsAccountLinkCallable() { + return stub.createAnalyticsAccountLinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google + * Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account in order to delete the + * link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   AnalyticsAccountLinkName name =
+   *       AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]");
+   *   marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Analytics account link to delete. Format: + * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAnalyticsAccountLink(AnalyticsAccountLinkName name) { + DeleteAnalyticsAccountLinkRequest request = + DeleteAnalyticsAccountLinkRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAnalyticsAccountLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google + * Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account in order to delete the + * link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   String name =
+   *       AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]").toString();
+   *   marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name);
+   * }
+   * }
+ * + * @param name Required. The name of the Analytics account link to delete. Format: + * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAnalyticsAccountLink(String name) { + DeleteAnalyticsAccountLinkRequest request = + DeleteAnalyticsAccountLinkRequest.newBuilder().setName(name).build(); + deleteAnalyticsAccountLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google + * Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account in order to delete the + * link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   DeleteAnalyticsAccountLinkRequest request =
+   *       DeleteAnalyticsAccountLinkRequest.newBuilder()
+   *           .setName(
+   *               AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]")
+   *                   .toString())
+   *           .build();
+   *   marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(request);
+   * }
+   * }
+ * + * @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 deleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest request) { + deleteAnalyticsAccountLinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google + * Marketing Platform organization. + * + *

User needs to be an org user, and admin on the Analytics account in order to delete the + * link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   DeleteAnalyticsAccountLinkRequest request =
+   *       DeleteAnalyticsAccountLinkRequest.newBuilder()
+   *           .setName(
+   *               AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       marketingplatformAdminServiceClient
+   *           .deleteAnalyticsAccountLinkCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteAnalyticsAccountLinkCallable() { + return stub.deleteAnalyticsAccountLinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the service level for an Analytics property. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   String analyticsAccountLink = "analyticsAccountLink-397570975";
+   *   SetPropertyServiceLevelResponse response =
+   *       marketingplatformAdminServiceClient.setPropertyServiceLevel(analyticsAccountLink);
+   * }
+   * }
+ * + * @param analyticsAccountLink Required. The parent AnalyticsAccountLink scope where this property + * is in. Format: organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SetPropertyServiceLevelResponse setPropertyServiceLevel( + String analyticsAccountLink) { + SetPropertyServiceLevelRequest request = + SetPropertyServiceLevelRequest.newBuilder() + .setAnalyticsAccountLink(analyticsAccountLink) + .build(); + return setPropertyServiceLevel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the service level for an Analytics property. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   SetPropertyServiceLevelRequest request =
+   *       SetPropertyServiceLevelRequest.newBuilder()
+   *           .setAnalyticsAccountLink("analyticsAccountLink-397570975")
+   *           .setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString())
+   *           .setServiceLevel(AnalyticsServiceLevel.forNumber(0))
+   *           .build();
+   *   SetPropertyServiceLevelResponse response =
+   *       marketingplatformAdminServiceClient.setPropertyServiceLevel(request);
+   * }
+   * }
+ * + * @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 SetPropertyServiceLevelResponse setPropertyServiceLevel( + SetPropertyServiceLevelRequest request) { + return setPropertyServiceLevelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the service level for an Analytics property. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+   *     MarketingplatformAdminServiceClient.create()) {
+   *   SetPropertyServiceLevelRequest request =
+   *       SetPropertyServiceLevelRequest.newBuilder()
+   *           .setAnalyticsAccountLink("analyticsAccountLink-397570975")
+   *           .setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString())
+   *           .setServiceLevel(AnalyticsServiceLevel.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       marketingplatformAdminServiceClient.setPropertyServiceLevelCallable().futureCall(request);
+   *   // Do something.
+   *   SetPropertyServiceLevelResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + setPropertyServiceLevelCallable() { + return stub.setPropertyServiceLevelCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListAnalyticsAccountLinksPagedResponse + extends AbstractPagedListResponse< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink, + ListAnalyticsAccountLinksPage, + ListAnalyticsAccountLinksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAnalyticsAccountLinksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAnalyticsAccountLinksPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAnalyticsAccountLinksPagedResponse(ListAnalyticsAccountLinksPage page) { + super(page, ListAnalyticsAccountLinksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAnalyticsAccountLinksPage + extends AbstractPage< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink, + ListAnalyticsAccountLinksPage> { + + private ListAnalyticsAccountLinksPage( + PageContext< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink> + context, + ListAnalyticsAccountLinksResponse response) { + super(context, response); + } + + private static ListAnalyticsAccountLinksPage createEmptyPage() { + return new ListAnalyticsAccountLinksPage(null, null); + } + + @Override + protected ListAnalyticsAccountLinksPage createPage( + PageContext< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink> + context, + ListAnalyticsAccountLinksResponse response) { + return new ListAnalyticsAccountLinksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAnalyticsAccountLinksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink, + ListAnalyticsAccountLinksPage, + ListAnalyticsAccountLinksFixedSizeCollection> { + + private ListAnalyticsAccountLinksFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAnalyticsAccountLinksFixedSizeCollection createEmptyCollection() { + return new ListAnalyticsAccountLinksFixedSizeCollection(null, 0); + } + + @Override + protected ListAnalyticsAccountLinksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAnalyticsAccountLinksFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceSettings.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceSettings.java new file mode 100644 index 000000000000..6032cec35e74 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceSettings.java @@ -0,0 +1,285 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.stub.MarketingplatformAdminServiceStubSettings; +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MarketingplatformAdminServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (marketingplatformadmin.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getOrganization: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MarketingplatformAdminServiceSettings.Builder marketingplatformAdminServiceSettingsBuilder =
+ *     MarketingplatformAdminServiceSettings.newBuilder();
+ * marketingplatformAdminServiceSettingsBuilder
+ *     .getOrganizationSettings()
+ *     .setRetrySettings(
+ *         marketingplatformAdminServiceSettingsBuilder
+ *             .getOrganizationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings =
+ *     marketingplatformAdminServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MarketingplatformAdminServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to getOrganization. */ + public UnaryCallSettings getOrganizationSettings() { + return ((MarketingplatformAdminServiceStubSettings) getStubSettings()) + .getOrganizationSettings(); + } + + /** Returns the object with the settings used for calls to listAnalyticsAccountLinks. */ + public PagedCallSettings< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings() { + return ((MarketingplatformAdminServiceStubSettings) getStubSettings()) + .listAnalyticsAccountLinksSettings(); + } + + /** Returns the object with the settings used for calls to createAnalyticsAccountLink. */ + public UnaryCallSettings + createAnalyticsAccountLinkSettings() { + return ((MarketingplatformAdminServiceStubSettings) getStubSettings()) + .createAnalyticsAccountLinkSettings(); + } + + /** Returns the object with the settings used for calls to deleteAnalyticsAccountLink. */ + public UnaryCallSettings + deleteAnalyticsAccountLinkSettings() { + return ((MarketingplatformAdminServiceStubSettings) getStubSettings()) + .deleteAnalyticsAccountLinkSettings(); + } + + /** Returns the object with the settings used for calls to setPropertyServiceLevel. */ + public UnaryCallSettings + setPropertyServiceLevelSettings() { + return ((MarketingplatformAdminServiceStubSettings) getStubSettings()) + .setPropertyServiceLevelSettings(); + } + + public static final MarketingplatformAdminServiceSettings create( + MarketingplatformAdminServiceStubSettings stub) throws IOException { + return new MarketingplatformAdminServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MarketingplatformAdminServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MarketingplatformAdminServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MarketingplatformAdminServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MarketingplatformAdminServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MarketingplatformAdminServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MarketingplatformAdminServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(MarketingplatformAdminServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MarketingplatformAdminServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MarketingplatformAdminServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(MarketingplatformAdminServiceStubSettings.newHttpJsonBuilder()); + } + + public MarketingplatformAdminServiceStubSettings.Builder getStubSettingsBuilder() { + return ((MarketingplatformAdminServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getOrganization. */ + public UnaryCallSettings.Builder + getOrganizationSettings() { + return getStubSettingsBuilder().getOrganizationSettings(); + } + + /** Returns the builder for the settings used for calls to listAnalyticsAccountLinks. */ + public PagedCallSettings.Builder< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings() { + return getStubSettingsBuilder().listAnalyticsAccountLinksSettings(); + } + + /** Returns the builder for the settings used for calls to createAnalyticsAccountLink. */ + public UnaryCallSettings.Builder + createAnalyticsAccountLinkSettings() { + return getStubSettingsBuilder().createAnalyticsAccountLinkSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAnalyticsAccountLink. */ + public UnaryCallSettings.Builder + deleteAnalyticsAccountLinkSettings() { + return getStubSettingsBuilder().deleteAnalyticsAccountLinkSettings(); + } + + /** Returns the builder for the settings used for calls to setPropertyServiceLevel. */ + public UnaryCallSettings.Builder< + SetPropertyServiceLevelRequest, SetPropertyServiceLevelResponse> + setPropertyServiceLevelSettings() { + return getStubSettingsBuilder().setPropertyServiceLevelSettings(); + } + + @Override + public MarketingplatformAdminServiceSettings build() throws IOException { + return new MarketingplatformAdminServiceSettings(this); + } + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/gapic_metadata.json b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/gapic_metadata.json new file mode 100644 index 000000000000..aaf8f7227621 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.marketingplatform.admin.v1alpha", + "libraryPackage": "com.google.ads.marketingplatform.admin.v1alpha", + "services": { + "MarketingplatformAdminService": { + "clients": { + "grpc": { + "libraryClient": "MarketingplatformAdminServiceClient", + "rpcs": { + "CreateAnalyticsAccountLink": { + "methods": ["createAnalyticsAccountLink", "createAnalyticsAccountLink", "createAnalyticsAccountLink", "createAnalyticsAccountLinkCallable"] + }, + "DeleteAnalyticsAccountLink": { + "methods": ["deleteAnalyticsAccountLink", "deleteAnalyticsAccountLink", "deleteAnalyticsAccountLink", "deleteAnalyticsAccountLinkCallable"] + }, + "GetOrganization": { + "methods": ["getOrganization", "getOrganization", "getOrganization", "getOrganizationCallable"] + }, + "ListAnalyticsAccountLinks": { + "methods": ["listAnalyticsAccountLinks", "listAnalyticsAccountLinks", "listAnalyticsAccountLinks", "listAnalyticsAccountLinksPagedCallable", "listAnalyticsAccountLinksCallable"] + }, + "SetPropertyServiceLevel": { + "methods": ["setPropertyServiceLevel", "setPropertyServiceLevel", "setPropertyServiceLevelCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/package-info.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/package-info.java new file mode 100644 index 000000000000..20ec2c105793 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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. + */ + +/** + * A client to Google Marketing Platform Admin API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= MarketingplatformAdminServiceClient ======================= + * + *

Service Description: Service Interface for the Google Marketing Platform Admin API. + * + *

Sample for MarketingplatformAdminServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient =
+ *     MarketingplatformAdminServiceClient.create()) {
+ *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+ *   Organization response = marketingplatformAdminServiceClient.getOrganization(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.ads.marketingplatform.admin.v1alpha; + +import javax.annotation.Generated; diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceCallableFactory.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceCallableFactory.java new file mode 100644 index 000000000000..56e819426b7b --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the MarketingplatformAdminService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMarketingplatformAdminServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceStub.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceStub.java new file mode 100644 index 000000000000..1f08cb0a8784 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/GrpcMarketingplatformAdminServiceStub.java @@ -0,0 +1,343 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the MarketingplatformAdminService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcMarketingplatformAdminServiceStub extends MarketingplatformAdminServiceStub { + private static final MethodDescriptor + getOrganizationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/GetOrganization") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOrganizationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Organization.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksResponse> + listAnalyticsAccountLinksMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/ListAnalyticsAccountLinks") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAnalyticsAccountLinksRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAnalyticsAccountLinksResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAnalyticsAccountLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/CreateAnalyticsAccountLink") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAnalyticsAccountLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AnalyticsAccountLink.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAnalyticsAccountLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/DeleteAnalyticsAccountLink") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAnalyticsAccountLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + SetPropertyServiceLevelRequest, SetPropertyServiceLevelResponse> + setPropertyServiceLevelMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/SetPropertyServiceLevel") + .setRequestMarshaller( + ProtoUtils.marshaller(SetPropertyServiceLevelRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SetPropertyServiceLevelResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getOrganizationCallable; + private final UnaryCallable + listAnalyticsAccountLinksCallable; + private final UnaryCallable< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksPagedCallable; + private final UnaryCallable + createAnalyticsAccountLinkCallable; + private final UnaryCallable + deleteAnalyticsAccountLinkCallable; + private final UnaryCallable + setPropertyServiceLevelCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMarketingplatformAdminServiceStub create( + MarketingplatformAdminServiceStubSettings settings) throws IOException { + return new GrpcMarketingplatformAdminServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcMarketingplatformAdminServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMarketingplatformAdminServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcMarketingplatformAdminServiceStub, 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 GrpcMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcMarketingplatformAdminServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcMarketingplatformAdminServiceStub, 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 GrpcMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getOrganizationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listAnalyticsAccountLinksTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listAnalyticsAccountLinksMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createAnalyticsAccountLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAnalyticsAccountLinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteAnalyticsAccountLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAnalyticsAccountLinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + setPropertyServiceLevelTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(setPropertyServiceLevelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "analytics_account_link", + String.valueOf(request.getAnalyticsAccountLink())); + return builder.build(); + }) + .build(); + + this.getOrganizationCallable = + callableFactory.createUnaryCallable( + getOrganizationTransportSettings, settings.getOrganizationSettings(), clientContext); + this.listAnalyticsAccountLinksCallable = + callableFactory.createUnaryCallable( + listAnalyticsAccountLinksTransportSettings, + settings.listAnalyticsAccountLinksSettings(), + clientContext); + this.listAnalyticsAccountLinksPagedCallable = + callableFactory.createPagedCallable( + listAnalyticsAccountLinksTransportSettings, + settings.listAnalyticsAccountLinksSettings(), + clientContext); + this.createAnalyticsAccountLinkCallable = + callableFactory.createUnaryCallable( + createAnalyticsAccountLinkTransportSettings, + settings.createAnalyticsAccountLinkSettings(), + clientContext); + this.deleteAnalyticsAccountLinkCallable = + callableFactory.createUnaryCallable( + deleteAnalyticsAccountLinkTransportSettings, + settings.deleteAnalyticsAccountLinkSettings(), + clientContext); + this.setPropertyServiceLevelCallable = + callableFactory.createUnaryCallable( + setPropertyServiceLevelTransportSettings, + settings.setPropertyServiceLevelSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getOrganizationCallable() { + return getOrganizationCallable; + } + + @Override + public UnaryCallable + listAnalyticsAccountLinksCallable() { + return listAnalyticsAccountLinksCallable; + } + + @Override + public UnaryCallable + listAnalyticsAccountLinksPagedCallable() { + return listAnalyticsAccountLinksPagedCallable; + } + + @Override + public UnaryCallable + createAnalyticsAccountLinkCallable() { + return createAnalyticsAccountLinkCallable; + } + + @Override + public UnaryCallable + deleteAnalyticsAccountLinkCallable() { + return deleteAnalyticsAccountLinkCallable; + } + + @Override + public UnaryCallable + setPropertyServiceLevelCallable() { + return setPropertyServiceLevelCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceCallableFactory.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceCallableFactory.java new file mode 100644 index 000000000000..2bd67de97e34 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the MarketingplatformAdminService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMarketingplatformAdminServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceStub.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceStub.java new file mode 100644 index 000000000000..71f820e04049 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/HttpJsonMarketingplatformAdminServiceStub.java @@ -0,0 +1,495 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the MarketingplatformAdminService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMarketingplatformAdminServiceStub extends MarketingplatformAdminServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getOrganizationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/GetOrganization") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=organizations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Organization.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksResponse> + listAnalyticsAccountLinksMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/ListAnalyticsAccountLinks") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=organizations/*}/analyticsAccountLinks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAnalyticsAccountLinksResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createAnalyticsAccountLinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/CreateAnalyticsAccountLink") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{parent=organizations/*}/analyticsAccountLinks", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "analyticsAccountLink", + request.getAnalyticsAccountLink(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AnalyticsAccountLink.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteAnalyticsAccountLinkMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/DeleteAnalyticsAccountLink") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{name=organizations/*/analyticsAccountLinks/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + SetPropertyServiceLevelRequest, SetPropertyServiceLevelResponse> + setPropertyServiceLevelMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService/SetPropertyServiceLevel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1alpha/{analyticsAccountLink=organizations/*/analyticsAccountLinks/*}:setPropertyServiceLevel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "analyticsAccountLink", request.getAnalyticsAccountLink()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearAnalyticsAccountLink().build(), + true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SetPropertyServiceLevelResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getOrganizationCallable; + private final UnaryCallable + listAnalyticsAccountLinksCallable; + private final UnaryCallable< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksPagedCallable; + private final UnaryCallable + createAnalyticsAccountLinkCallable; + private final UnaryCallable + deleteAnalyticsAccountLinkCallable; + private final UnaryCallable + setPropertyServiceLevelCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonMarketingplatformAdminServiceStub create( + MarketingplatformAdminServiceStubSettings settings) throws IOException { + return new HttpJsonMarketingplatformAdminServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMarketingplatformAdminServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonMarketingplatformAdminServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonMarketingplatformAdminServiceStub, 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 HttpJsonMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMarketingplatformAdminServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMarketingplatformAdminServiceStub, 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 HttpJsonMarketingplatformAdminServiceStub( + MarketingplatformAdminServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getOrganizationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getOrganizationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listAnalyticsAccountLinksTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAnalyticsAccountLinksMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createAnalyticsAccountLinkTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(createAnalyticsAccountLinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteAnalyticsAccountLinkTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAnalyticsAccountLinkMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + setPropertyServiceLevelTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(setPropertyServiceLevelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "analytics_account_link", + String.valueOf(request.getAnalyticsAccountLink())); + return builder.build(); + }) + .build(); + + this.getOrganizationCallable = + callableFactory.createUnaryCallable( + getOrganizationTransportSettings, settings.getOrganizationSettings(), clientContext); + this.listAnalyticsAccountLinksCallable = + callableFactory.createUnaryCallable( + listAnalyticsAccountLinksTransportSettings, + settings.listAnalyticsAccountLinksSettings(), + clientContext); + this.listAnalyticsAccountLinksPagedCallable = + callableFactory.createPagedCallable( + listAnalyticsAccountLinksTransportSettings, + settings.listAnalyticsAccountLinksSettings(), + clientContext); + this.createAnalyticsAccountLinkCallable = + callableFactory.createUnaryCallable( + createAnalyticsAccountLinkTransportSettings, + settings.createAnalyticsAccountLinkSettings(), + clientContext); + this.deleteAnalyticsAccountLinkCallable = + callableFactory.createUnaryCallable( + deleteAnalyticsAccountLinkTransportSettings, + settings.deleteAnalyticsAccountLinkSettings(), + clientContext); + this.setPropertyServiceLevelCallable = + callableFactory.createUnaryCallable( + setPropertyServiceLevelTransportSettings, + settings.setPropertyServiceLevelSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getOrganizationMethodDescriptor); + methodDescriptors.add(listAnalyticsAccountLinksMethodDescriptor); + methodDescriptors.add(createAnalyticsAccountLinkMethodDescriptor); + methodDescriptors.add(deleteAnalyticsAccountLinkMethodDescriptor); + methodDescriptors.add(setPropertyServiceLevelMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getOrganizationCallable() { + return getOrganizationCallable; + } + + @Override + public UnaryCallable + listAnalyticsAccountLinksCallable() { + return listAnalyticsAccountLinksCallable; + } + + @Override + public UnaryCallable + listAnalyticsAccountLinksPagedCallable() { + return listAnalyticsAccountLinksPagedCallable; + } + + @Override + public UnaryCallable + createAnalyticsAccountLinkCallable() { + return createAnalyticsAccountLinkCallable; + } + + @Override + public UnaryCallable + deleteAnalyticsAccountLinkCallable() { + return deleteAnalyticsAccountLinkCallable; + } + + @Override + public UnaryCallable + setPropertyServiceLevelCallable() { + return setPropertyServiceLevelCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStub.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStub.java new file mode 100644 index 000000000000..cb9b67446b00 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStub.java @@ -0,0 +1,80 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; +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 MarketingplatformAdminService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MarketingplatformAdminServiceStub implements BackgroundResource { + + public UnaryCallable getOrganizationCallable() { + throw new UnsupportedOperationException("Not implemented: getOrganizationCallable()"); + } + + public UnaryCallable + listAnalyticsAccountLinksPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAnalyticsAccountLinksPagedCallable()"); + } + + public UnaryCallable + listAnalyticsAccountLinksCallable() { + throw new UnsupportedOperationException("Not implemented: listAnalyticsAccountLinksCallable()"); + } + + public UnaryCallable + createAnalyticsAccountLinkCallable() { + throw new UnsupportedOperationException( + "Not implemented: createAnalyticsAccountLinkCallable()"); + } + + public UnaryCallable + deleteAnalyticsAccountLinkCallable() { + throw new UnsupportedOperationException( + "Not implemented: deleteAnalyticsAccountLinkCallable()"); + } + + public UnaryCallable + setPropertyServiceLevelCallable() { + throw new UnsupportedOperationException("Not implemented: setPropertyServiceLevelCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStubSettings.java b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStubSettings.java new file mode 100644 index 000000000000..01fd2280f7d2 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/stub/MarketingplatformAdminServiceStubSettings.java @@ -0,0 +1,569 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MarketingplatformAdminServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (marketingplatformadmin.googleapis.com) and default port (443) + * are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getOrganization: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MarketingplatformAdminServiceStubSettings.Builder marketingplatformAdminServiceSettingsBuilder =
+ *     MarketingplatformAdminServiceStubSettings.newBuilder();
+ * marketingplatformAdminServiceSettingsBuilder
+ *     .getOrganizationSettings()
+ *     .setRetrySettings(
+ *         marketingplatformAdminServiceSettingsBuilder
+ *             .getOrganizationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MarketingplatformAdminServiceStubSettings marketingplatformAdminServiceSettings =
+ *     marketingplatformAdminServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MarketingplatformAdminServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/marketingplatformadmin.analytics.read") + .add("https://www.googleapis.com/auth/marketingplatformadmin.analytics.update") + .build(); + + private final UnaryCallSettings getOrganizationSettings; + private final PagedCallSettings< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings; + private final UnaryCallSettings + createAnalyticsAccountLinkSettings; + private final UnaryCallSettings + deleteAnalyticsAccountLinkSettings; + private final UnaryCallSettings + setPropertyServiceLevelSettings; + + private static final PagedListDescriptor< + ListAnalyticsAccountLinksRequest, ListAnalyticsAccountLinksResponse, AnalyticsAccountLink> + LIST_ANALYTICS_ACCOUNT_LINKS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAnalyticsAccountLinksRequest injectToken( + ListAnalyticsAccountLinksRequest payload, String token) { + return ListAnalyticsAccountLinksRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListAnalyticsAccountLinksRequest injectPageSize( + ListAnalyticsAccountLinksRequest payload, int pageSize) { + return ListAnalyticsAccountLinksRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListAnalyticsAccountLinksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAnalyticsAccountLinksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAnalyticsAccountLinksResponse payload) { + return payload.getAnalyticsAccountLinksList(); + } + }; + + private static final PagedListResponseFactory< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + LIST_ANALYTICS_ACCOUNT_LINKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListAnalyticsAccountLinksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + AnalyticsAccountLink> + pageContext = + PageContext.create( + callable, LIST_ANALYTICS_ACCOUNT_LINKS_PAGE_STR_DESC, request, context); + return ListAnalyticsAccountLinksPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getOrganization. */ + public UnaryCallSettings getOrganizationSettings() { + return getOrganizationSettings; + } + + /** Returns the object with the settings used for calls to listAnalyticsAccountLinks. */ + public PagedCallSettings< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings() { + return listAnalyticsAccountLinksSettings; + } + + /** Returns the object with the settings used for calls to createAnalyticsAccountLink. */ + public UnaryCallSettings + createAnalyticsAccountLinkSettings() { + return createAnalyticsAccountLinkSettings; + } + + /** Returns the object with the settings used for calls to deleteAnalyticsAccountLink. */ + public UnaryCallSettings + deleteAnalyticsAccountLinkSettings() { + return deleteAnalyticsAccountLinkSettings; + } + + /** Returns the object with the settings used for calls to setPropertyServiceLevel. */ + public UnaryCallSettings + setPropertyServiceLevelSettings() { + return setPropertyServiceLevelSettings; + } + + public MarketingplatformAdminServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMarketingplatformAdminServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMarketingplatformAdminServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "marketingplatformadmin"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "marketingplatformadmin.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "marketingplatformadmin.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(MarketingplatformAdminServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(MarketingplatformAdminServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MarketingplatformAdminServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected MarketingplatformAdminServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getOrganizationSettings = settingsBuilder.getOrganizationSettings().build(); + listAnalyticsAccountLinksSettings = settingsBuilder.listAnalyticsAccountLinksSettings().build(); + createAnalyticsAccountLinkSettings = + settingsBuilder.createAnalyticsAccountLinkSettings().build(); + deleteAnalyticsAccountLinkSettings = + settingsBuilder.deleteAnalyticsAccountLinkSettings().build(); + setPropertyServiceLevelSettings = settingsBuilder.setPropertyServiceLevelSettings().build(); + } + + /** Builder for MarketingplatformAdminServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + getOrganizationSettings; + private final PagedCallSettings.Builder< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings; + private final UnaryCallSettings.Builder + createAnalyticsAccountLinkSettings; + private final UnaryCallSettings.Builder + deleteAnalyticsAccountLinkSettings; + private final UnaryCallSettings.Builder< + SetPropertyServiceLevelRequest, SetPropertyServiceLevelResponse> + setPropertyServiceLevelSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getOrganizationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAnalyticsAccountLinksSettings = + PagedCallSettings.newBuilder(LIST_ANALYTICS_ACCOUNT_LINKS_PAGE_STR_FACT); + createAnalyticsAccountLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAnalyticsAccountLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setPropertyServiceLevelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOrganizationSettings, + listAnalyticsAccountLinksSettings, + createAnalyticsAccountLinkSettings, + deleteAnalyticsAccountLinkSettings, + setPropertyServiceLevelSettings); + initDefaults(this); + } + + protected Builder(MarketingplatformAdminServiceStubSettings settings) { + super(settings); + + getOrganizationSettings = settings.getOrganizationSettings.toBuilder(); + listAnalyticsAccountLinksSettings = settings.listAnalyticsAccountLinksSettings.toBuilder(); + createAnalyticsAccountLinkSettings = settings.createAnalyticsAccountLinkSettings.toBuilder(); + deleteAnalyticsAccountLinkSettings = settings.deleteAnalyticsAccountLinkSettings.toBuilder(); + setPropertyServiceLevelSettings = settings.setPropertyServiceLevelSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOrganizationSettings, + listAnalyticsAccountLinksSettings, + createAnalyticsAccountLinkSettings, + deleteAnalyticsAccountLinkSettings, + setPropertyServiceLevelSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getOrganizationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listAnalyticsAccountLinksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createAnalyticsAccountLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteAnalyticsAccountLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .setPropertyServiceLevelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getOrganization. */ + public UnaryCallSettings.Builder + getOrganizationSettings() { + return getOrganizationSettings; + } + + /** Returns the builder for the settings used for calls to listAnalyticsAccountLinks. */ + public PagedCallSettings.Builder< + ListAnalyticsAccountLinksRequest, + ListAnalyticsAccountLinksResponse, + ListAnalyticsAccountLinksPagedResponse> + listAnalyticsAccountLinksSettings() { + return listAnalyticsAccountLinksSettings; + } + + /** Returns the builder for the settings used for calls to createAnalyticsAccountLink. */ + public UnaryCallSettings.Builder + createAnalyticsAccountLinkSettings() { + return createAnalyticsAccountLinkSettings; + } + + /** Returns the builder for the settings used for calls to deleteAnalyticsAccountLink. */ + public UnaryCallSettings.Builder + deleteAnalyticsAccountLinkSettings() { + return deleteAnalyticsAccountLinkSettings; + } + + /** Returns the builder for the settings used for calls to setPropertyServiceLevel. */ + public UnaryCallSettings.Builder< + SetPropertyServiceLevelRequest, SetPropertyServiceLevelResponse> + setPropertyServiceLevelSettings() { + return setPropertyServiceLevelSettings; + } + + @Override + public MarketingplatformAdminServiceStubSettings build() throws IOException { + return new MarketingplatformAdminServiceStubSettings(this); + } + } +} diff --git a/java-marketingplatformadminapi/admin/src/main/resources/META-INF/native-image/com.google.ads.marketingplatform.admin.v1alpha/reflect-config.json b/java-marketingplatformadminapi/admin/src/main/resources/META-INF/native-image/com.google.ads.marketingplatform.admin.v1alpha/reflect-config.json new file mode 100644 index 000000000000..fbbb2d36b77d --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/main/resources/META-INF/native-image/com.google.ads.marketingplatform.admin.v1alpha/reflect-config.json @@ -0,0 +1,1343 @@ +[ + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.Organization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.Organization$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientHttpJsonTest.java b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..84bf3f1de015 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientHttpJsonTest.java @@ -0,0 +1,502 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.ads.marketingplatform.admin.v1alpha.stub.HttpJsonMarketingplatformAdminServiceStub; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MarketingplatformAdminServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static MarketingplatformAdminServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMarketingplatformAdminServiceStub.getMethodDescriptors(), + MarketingplatformAdminServiceSettings.getDefaultEndpoint()); + MarketingplatformAdminServiceSettings settings = + MarketingplatformAdminServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + MarketingplatformAdminServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MarketingplatformAdminServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getOrganizationTest() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getOrganizationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationTest2() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-1936"; + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getOrganizationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "organizations/organization-1936"; + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAnalyticsAccountLinksTest() throws Exception { + AnalyticsAccountLink responsesElement = AnalyticsAccountLink.newBuilder().build(); + ListAnalyticsAccountLinksResponse expectedResponse = + ListAnalyticsAccountLinksResponse.newBuilder() + .setNextPageToken("") + .addAllAnalyticsAccountLinks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListAnalyticsAccountLinksPagedResponse pagedListResponse = + client.listAnalyticsAccountLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAnalyticsAccountLinksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAnalyticsAccountLinksExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listAnalyticsAccountLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAnalyticsAccountLinksTest2() throws Exception { + AnalyticsAccountLink responsesElement = AnalyticsAccountLink.newBuilder().build(); + ListAnalyticsAccountLinksResponse expectedResponse = + ListAnalyticsAccountLinksResponse.newBuilder() + .setNextPageToken("") + .addAllAnalyticsAccountLinks(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-8287"; + + ListAnalyticsAccountLinksPagedResponse pagedListResponse = + client.listAnalyticsAccountLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAnalyticsAccountLinksList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listAnalyticsAccountLinksExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-8287"; + client.listAnalyticsAccountLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAnalyticsAccountLinkTest() throws Exception { + AnalyticsAccountLink expectedResponse = + AnalyticsAccountLink.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .setAnalyticsAccount("analyticsAccount-1287740473") + .setDisplayName("displayName1714148973") + .setLinkVerificationState(LinkVerificationState.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + + AnalyticsAccountLink actualResponse = + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAnalyticsAccountLinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAnalyticsAccountLinkTest2() throws Exception { + AnalyticsAccountLink expectedResponse = + AnalyticsAccountLink.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .setAnalyticsAccount("analyticsAccount-1287740473") + .setDisplayName("displayName1714148973") + .setLinkVerificationState(LinkVerificationState.forNumber(0)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-8287"; + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + + AnalyticsAccountLink actualResponse = + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createAnalyticsAccountLinkExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-8287"; + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAnalyticsAccountLinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + AnalyticsAccountLinkName name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]"); + + client.deleteAnalyticsAccountLink(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAnalyticsAccountLinkExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AnalyticsAccountLinkName name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]"); + client.deleteAnalyticsAccountLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAnalyticsAccountLinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-3502/analyticsAccountLinks/analyticsAccountLink-3502"; + + client.deleteAnalyticsAccountLink(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteAnalyticsAccountLinkExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-3502/analyticsAccountLinks/analyticsAccountLink-3502"; + client.deleteAnalyticsAccountLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setPropertyServiceLevelTest() throws Exception { + SetPropertyServiceLevelResponse expectedResponse = + SetPropertyServiceLevelResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String analyticsAccountLink = + "organizations/organization-2696/analyticsAccountLinks/analyticsAccountLink-2696"; + + SetPropertyServiceLevelResponse actualResponse = + client.setPropertyServiceLevel(analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setPropertyServiceLevelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String analyticsAccountLink = + "organizations/organization-2696/analyticsAccountLinks/analyticsAccountLink-2696"; + client.setPropertyServiceLevel(analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientTest.java b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientTest.java new file mode 100644 index 000000000000..e48cdd80e201 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceClientTest.java @@ -0,0 +1,458 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import static com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient.ListAnalyticsAccountLinksPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MarketingplatformAdminServiceClientTest { + private static MockMarketingplatformAdminService mockMarketingplatformAdminService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MarketingplatformAdminServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockMarketingplatformAdminService = new MockMarketingplatformAdminService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMarketingplatformAdminService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MarketingplatformAdminServiceSettings settings = + MarketingplatformAdminServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MarketingplatformAdminServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getOrganizationTest() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationRequest actualRequest = ((GetOrganizationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getOrganizationTest2() throws Exception { + Organization expectedResponse = + Organization.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .setDisplayName("displayName1714148973") + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + String name = "name3373707"; + + Organization actualResponse = client.getOrganization(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOrganizationRequest actualRequest = ((GetOrganizationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getOrganizationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + String name = "name3373707"; + client.getOrganization(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAnalyticsAccountLinksTest() throws Exception { + AnalyticsAccountLink responsesElement = AnalyticsAccountLink.newBuilder().build(); + ListAnalyticsAccountLinksResponse expectedResponse = + ListAnalyticsAccountLinksResponse.newBuilder() + .setNextPageToken("") + .addAllAnalyticsAccountLinks(Arrays.asList(responsesElement)) + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListAnalyticsAccountLinksPagedResponse pagedListResponse = + client.listAnalyticsAccountLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAnalyticsAccountLinksList().get(0), resources.get(0)); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAnalyticsAccountLinksRequest actualRequest = + ((ListAnalyticsAccountLinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAnalyticsAccountLinksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listAnalyticsAccountLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAnalyticsAccountLinksTest2() throws Exception { + AnalyticsAccountLink responsesElement = AnalyticsAccountLink.newBuilder().build(); + ListAnalyticsAccountLinksResponse expectedResponse = + ListAnalyticsAccountLinksResponse.newBuilder() + .setNextPageToken("") + .addAllAnalyticsAccountLinks(Arrays.asList(responsesElement)) + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAnalyticsAccountLinksPagedResponse pagedListResponse = + client.listAnalyticsAccountLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAnalyticsAccountLinksList().get(0), resources.get(0)); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAnalyticsAccountLinksRequest actualRequest = + ((ListAnalyticsAccountLinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAnalyticsAccountLinksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAnalyticsAccountLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAnalyticsAccountLinkTest() throws Exception { + AnalyticsAccountLink expectedResponse = + AnalyticsAccountLink.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .setAnalyticsAccount("analyticsAccount-1287740473") + .setDisplayName("displayName1714148973") + .setLinkVerificationState(LinkVerificationState.forNumber(0)) + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + + AnalyticsAccountLink actualResponse = + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAnalyticsAccountLinkRequest actualRequest = + ((CreateAnalyticsAccountLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(analyticsAccountLink, actualRequest.getAnalyticsAccountLink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAnalyticsAccountLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAnalyticsAccountLinkTest2() throws Exception { + AnalyticsAccountLink expectedResponse = + AnalyticsAccountLink.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .setAnalyticsAccount("analyticsAccount-1287740473") + .setDisplayName("displayName1714148973") + .setLinkVerificationState(LinkVerificationState.forNumber(0)) + .build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + + AnalyticsAccountLink actualResponse = + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAnalyticsAccountLinkRequest actualRequest = + ((CreateAnalyticsAccountLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(analyticsAccountLink, actualRequest.getAnalyticsAccountLink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAnalyticsAccountLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + String parent = "parent-995424086"; + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + client.createAnalyticsAccountLink(parent, analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAnalyticsAccountLinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + AnalyticsAccountLinkName name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]"); + + client.deleteAnalyticsAccountLink(name); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAnalyticsAccountLinkRequest actualRequest = + ((DeleteAnalyticsAccountLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAnalyticsAccountLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + AnalyticsAccountLinkName name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]"); + client.deleteAnalyticsAccountLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAnalyticsAccountLinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteAnalyticsAccountLink(name); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAnalyticsAccountLinkRequest actualRequest = + ((DeleteAnalyticsAccountLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAnalyticsAccountLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + String name = "name3373707"; + client.deleteAnalyticsAccountLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setPropertyServiceLevelTest() throws Exception { + SetPropertyServiceLevelResponse expectedResponse = + SetPropertyServiceLevelResponse.newBuilder().build(); + mockMarketingplatformAdminService.addResponse(expectedResponse); + + String analyticsAccountLink = "analyticsAccountLink-397570975"; + + SetPropertyServiceLevelResponse actualResponse = + client.setPropertyServiceLevel(analyticsAccountLink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMarketingplatformAdminService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetPropertyServiceLevelRequest actualRequest = + ((SetPropertyServiceLevelRequest) actualRequests.get(0)); + + Assert.assertEquals(analyticsAccountLink, actualRequest.getAnalyticsAccountLink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setPropertyServiceLevelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMarketingplatformAdminService.addException(exception); + + try { + String analyticsAccountLink = "analyticsAccountLink-397570975"; + client.setPropertyServiceLevel(analyticsAccountLink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminService.java b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminService.java new file mode 100644 index 000000000000..c0d7a8c42726 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMarketingplatformAdminService implements MockGrpcService { + private final MockMarketingplatformAdminServiceImpl serviceImpl; + + public MockMarketingplatformAdminService() { + serviceImpl = new MockMarketingplatformAdminServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminServiceImpl.java b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminServiceImpl.java new file mode 100644 index 000000000000..609c837fb0a1 --- /dev/null +++ b/java-marketingplatformadminapi/admin/src/test/java/com/google/ads/marketingplatform/admin/v1alpha/MockMarketingplatformAdminServiceImpl.java @@ -0,0 +1,169 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceGrpc.MarketingplatformAdminServiceImplBase; +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMarketingplatformAdminServiceImpl extends MarketingplatformAdminServiceImplBase { + private List requests; + private Queue responses; + + public MockMarketingplatformAdminServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getOrganization( + GetOrganizationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Organization) { + requests.add(request); + responseObserver.onNext(((Organization) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetOrganization, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Organization.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAnalyticsAccountLinks( + ListAnalyticsAccountLinksRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAnalyticsAccountLinksResponse) { + requests.add(request); + responseObserver.onNext(((ListAnalyticsAccountLinksResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAnalyticsAccountLinks, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAnalyticsAccountLinksResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAnalyticsAccountLink( + CreateAnalyticsAccountLinkRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AnalyticsAccountLink) { + requests.add(request); + responseObserver.onNext(((AnalyticsAccountLink) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAnalyticsAccountLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AnalyticsAccountLink.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAnalyticsAccountLink( + DeleteAnalyticsAccountLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAnalyticsAccountLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setPropertyServiceLevel( + SetPropertyServiceLevelRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SetPropertyServiceLevelResponse) { + requests.add(request); + responseObserver.onNext(((SetPropertyServiceLevelResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetPropertyServiceLevel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SetPropertyServiceLevelResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-marketingplatformadminapi/grpc-admin-v1alpha/pom.xml b/java-marketingplatformadminapi/grpc-admin-v1alpha/pom.xml new file mode 100644 index 000000000000..d3b43bffb4e0 --- /dev/null +++ b/java-marketingplatformadminapi/grpc-admin-v1alpha/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.ads-marketingplatform.api.grpc + grpc-admin-v1alpha + 0.0.1-SNAPSHOT + grpc-admin-v1alpha + GRPC library for admin + + com.google.ads-marketingplatform + admin-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.ads-marketingplatform.api.grpc + proto-admin-v1alpha + + + com.google.guava + guava + + + diff --git a/java-marketingplatformadminapi/grpc-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceGrpc.java b/java-marketingplatformadminapi/grpc-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceGrpc.java new file mode 100644 index 000000000000..7fd03c797dc8 --- /dev/null +++ b/java-marketingplatformadminapi/grpc-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminServiceGrpc.java @@ -0,0 +1,967 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service Interface for the Google Marketing Platform Admin API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class MarketingplatformAdminServiceGrpc { + + private MarketingplatformAdminServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.marketingplatform.admin.v1alpha.MarketingplatformAdminService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest, + com.google.ads.marketingplatform.admin.v1alpha.Organization> + getGetOrganizationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetOrganization", + requestType = com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.class, + responseType = com.google.ads.marketingplatform.admin.v1alpha.Organization.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest, + com.google.ads.marketingplatform.admin.v1alpha.Organization> + getGetOrganizationMethod() { + io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest, + com.google.ads.marketingplatform.admin.v1alpha.Organization> + getGetOrganizationMethod; + if ((getGetOrganizationMethod = MarketingplatformAdminServiceGrpc.getGetOrganizationMethod) + == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + if ((getGetOrganizationMethod = MarketingplatformAdminServiceGrpc.getGetOrganizationMethod) + == null) { + MarketingplatformAdminServiceGrpc.getGetOrganizationMethod = + getGetOrganizationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetOrganization")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha.Organization + .getDefaultInstance())) + .setSchemaDescriptor( + new MarketingplatformAdminServiceMethodDescriptorSupplier( + "GetOrganization")) + .build(); + } + } + } + return getGetOrganizationMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + getListAnalyticsAccountLinksMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAnalyticsAccountLinks", + requestType = + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest.class, + responseType = + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + getListAnalyticsAccountLinksMethod() { + io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + getListAnalyticsAccountLinksMethod; + if ((getListAnalyticsAccountLinksMethod = + MarketingplatformAdminServiceGrpc.getListAnalyticsAccountLinksMethod) + == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + if ((getListAnalyticsAccountLinksMethod = + MarketingplatformAdminServiceGrpc.getListAnalyticsAccountLinksMethod) + == null) { + MarketingplatformAdminServiceGrpc.getListAnalyticsAccountLinksMethod = + getListAnalyticsAccountLinksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAnalyticsAccountLinks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksResponse.getDefaultInstance())) + .setSchemaDescriptor( + new MarketingplatformAdminServiceMethodDescriptorSupplier( + "ListAnalyticsAccountLinks")) + .build(); + } + } + } + return getListAnalyticsAccountLinksMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + getCreateAnalyticsAccountLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAnalyticsAccountLink", + requestType = + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest.class, + responseType = com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + getCreateAnalyticsAccountLinkMethod() { + io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + getCreateAnalyticsAccountLinkMethod; + if ((getCreateAnalyticsAccountLinkMethod = + MarketingplatformAdminServiceGrpc.getCreateAnalyticsAccountLinkMethod) + == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + if ((getCreateAnalyticsAccountLinkMethod = + MarketingplatformAdminServiceGrpc.getCreateAnalyticsAccountLinkMethod) + == null) { + MarketingplatformAdminServiceGrpc.getCreateAnalyticsAccountLinkMethod = + getCreateAnalyticsAccountLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateAnalyticsAccountLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .CreateAnalyticsAccountLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance())) + .setSchemaDescriptor( + new MarketingplatformAdminServiceMethodDescriptorSupplier( + "CreateAnalyticsAccountLink")) + .build(); + } + } + } + return getCreateAnalyticsAccountLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest, + com.google.protobuf.Empty> + getDeleteAnalyticsAccountLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAnalyticsAccountLink", + requestType = + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest, + com.google.protobuf.Empty> + getDeleteAnalyticsAccountLinkMethod() { + io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest, + com.google.protobuf.Empty> + getDeleteAnalyticsAccountLinkMethod; + if ((getDeleteAnalyticsAccountLinkMethod = + MarketingplatformAdminServiceGrpc.getDeleteAnalyticsAccountLinkMethod) + == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + if ((getDeleteAnalyticsAccountLinkMethod = + MarketingplatformAdminServiceGrpc.getDeleteAnalyticsAccountLinkMethod) + == null) { + MarketingplatformAdminServiceGrpc.getDeleteAnalyticsAccountLinkMethod = + getDeleteAnalyticsAccountLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteAnalyticsAccountLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .DeleteAnalyticsAccountLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new MarketingplatformAdminServiceMethodDescriptorSupplier( + "DeleteAnalyticsAccountLink")) + .build(); + } + } + } + return getDeleteAnalyticsAccountLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + getSetPropertyServiceLevelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetPropertyServiceLevel", + requestType = + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.class, + responseType = + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + getSetPropertyServiceLevelMethod() { + io.grpc.MethodDescriptor< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + getSetPropertyServiceLevelMethod; + if ((getSetPropertyServiceLevelMethod = + MarketingplatformAdminServiceGrpc.getSetPropertyServiceLevelMethod) + == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + if ((getSetPropertyServiceLevelMethod = + MarketingplatformAdminServiceGrpc.getSetPropertyServiceLevelMethod) + == null) { + MarketingplatformAdminServiceGrpc.getSetPropertyServiceLevelMethod = + getSetPropertyServiceLevelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "SetPropertyServiceLevel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .SetPropertyServiceLevelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.ads.marketingplatform.admin.v1alpha + .SetPropertyServiceLevelResponse.getDefaultInstance())) + .setSchemaDescriptor( + new MarketingplatformAdminServiceMethodDescriptorSupplier( + "SetPropertyServiceLevel")) + .build(); + } + } + } + return getSetPropertyServiceLevelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MarketingplatformAdminServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MarketingplatformAdminServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceStub(channel, callOptions); + } + }; + return MarketingplatformAdminServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MarketingplatformAdminServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MarketingplatformAdminServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceBlockingStub(channel, callOptions); + } + }; + return MarketingplatformAdminServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MarketingplatformAdminServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MarketingplatformAdminServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceFutureStub(channel, callOptions); + } + }; + return MarketingplatformAdminServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service Interface for the Google Marketing Platform Admin API.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lookup for a single organization.
+     * 
+ */ + default void getOrganization( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetOrganizationMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the Google Analytics accounts link to the specified Google Marketing
+     * Platform organization.
+     * 
+ */ + default void listAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAnalyticsAccountLinksMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates the link between the Analytics account and the Google Marketing
+     * Platform organization.
+     * User needs to be an org user, and admin on the Analytics account to create
+     * the link. If the account is already linked to an organization, user needs
+     * to unlink the account from the current organization, then try link again.
+     * 
+ */ + default void createAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAnalyticsAccountLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the AnalyticsAccountLink, which detaches the Analytics account from
+     * the Google Marketing Platform organization.
+     * User needs to be an org user, and admin on the Analytics account in order
+     * to delete the link.
+     * 
+ */ + default void deleteAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAnalyticsAccountLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the service level for an Analytics property.
+     * 
+ */ + default void setPropertyServiceLevel( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetPropertyServiceLevelMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MarketingplatformAdminService. + * + *
+   * Service Interface for the Google Marketing Platform Admin API.
+   * 
+ */ + public abstract static class MarketingplatformAdminServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MarketingplatformAdminServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MarketingplatformAdminService. + * + *
+   * Service Interface for the Google Marketing Platform Admin API.
+   * 
+ */ + public static final class MarketingplatformAdminServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private MarketingplatformAdminServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MarketingplatformAdminServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lookup for a single organization.
+     * 
+ */ + public void getOrganization( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetOrganizationMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the Google Analytics accounts link to the specified Google Marketing
+     * Platform organization.
+     * 
+ */ + public void listAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAnalyticsAccountLinksMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates the link between the Analytics account and the Google Marketing
+     * Platform organization.
+     * User needs to be an org user, and admin on the Analytics account to create
+     * the link. If the account is already linked to an organization, user needs
+     * to unlink the account from the current organization, then try link again.
+     * 
+ */ + public void createAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAnalyticsAccountLinkMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the AnalyticsAccountLink, which detaches the Analytics account from
+     * the Google Marketing Platform organization.
+     * User needs to be an org user, and admin on the Analytics account in order
+     * to delete the link.
+     * 
+ */ + public void deleteAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAnalyticsAccountLinkMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the service level for an Analytics property.
+     * 
+ */ + public void setPropertyServiceLevel( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest request, + io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSetPropertyServiceLevelMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MarketingplatformAdminService. + * + *
+   * Service Interface for the Google Marketing Platform Admin API.
+   * 
+ */ + public static final class MarketingplatformAdminServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MarketingplatformAdminServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MarketingplatformAdminServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lookup for a single organization.
+     * 
+ */ + public com.google.ads.marketingplatform.admin.v1alpha.Organization getOrganization( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetOrganizationMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the Google Analytics accounts link to the specified Google Marketing
+     * Platform organization.
+     * 
+ */ + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + listAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAnalyticsAccountLinksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates the link between the Analytics account and the Google Marketing
+     * Platform organization.
+     * User needs to be an org user, and admin on the Analytics account to create
+     * the link. If the account is already linked to an organization, user needs
+     * to unlink the account from the current organization, then try link again.
+     * 
+ */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + createAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAnalyticsAccountLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the AnalyticsAccountLink, which detaches the Analytics account from
+     * the Google Marketing Platform organization.
+     * User needs to be an org user, and admin on the Analytics account in order
+     * to delete the link.
+     * 
+ */ + public com.google.protobuf.Empty deleteAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAnalyticsAccountLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the service level for an Analytics property.
+     * 
+ */ + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + setPropertyServiceLevel( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetPropertyServiceLevelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * MarketingplatformAdminService. + * + *
+   * Service Interface for the Google Marketing Platform Admin API.
+   * 
+ */ + public static final class MarketingplatformAdminServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private MarketingplatformAdminServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MarketingplatformAdminServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MarketingplatformAdminServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lookup for a single organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.ads.marketingplatform.admin.v1alpha.Organization> + getOrganization( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetOrganizationMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the Google Analytics accounts link to the specified Google Marketing
+     * Platform organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse> + listAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAnalyticsAccountLinksMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates the link between the Analytics account and the Google Marketing
+     * Platform organization.
+     * User needs to be an org user, and admin on the Analytics account to create
+     * the link. If the account is already linked to an organization, user needs
+     * to unlink the account from the current organization, then try link again.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + createAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAnalyticsAccountLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the AnalyticsAccountLink, which detaches the Analytics account from
+     * the Google Marketing Platform organization.
+     * User needs to be an org user, and admin on the Analytics account in order
+     * to delete the link.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAnalyticsAccountLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the service level for an Analytics property.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse> + setPropertyServiceLevel( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSetPropertyServiceLevelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_ORGANIZATION = 0; + private static final int METHODID_LIST_ANALYTICS_ACCOUNT_LINKS = 1; + private static final int METHODID_CREATE_ANALYTICS_ACCOUNT_LINK = 2; + private static final int METHODID_DELETE_ANALYTICS_ACCOUNT_LINK = 3; + private static final int METHODID_SET_PROPERTY_SERVICE_LEVEL = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_ORGANIZATION: + serviceImpl.getOrganization( + (com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest) request, + (io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.Organization>) + responseObserver); + break; + case METHODID_LIST_ANALYTICS_ACCOUNT_LINKS: + serviceImpl.listAnalyticsAccountLinks( + (com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksResponse>) + responseObserver); + break; + case METHODID_CREATE_ANALYTICS_ACCOUNT_LINK: + serviceImpl.createAnalyticsAccountLink( + (com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink>) + responseObserver); + break; + case METHODID_DELETE_ANALYTICS_ACCOUNT_LINK: + serviceImpl.deleteAnalyticsAccountLink( + (com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SET_PROPERTY_SERVICE_LEVEL: + serviceImpl.setPropertyServiceLevel( + (com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.ads.marketingplatform.admin.v1alpha + .SetPropertyServiceLevelResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetOrganizationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest, + com.google.ads.marketingplatform.admin.v1alpha.Organization>( + service, METHODID_GET_ORGANIZATION))) + .addMethod( + getListAnalyticsAccountLinksMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest, + com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksResponse>( + service, METHODID_LIST_ANALYTICS_ACCOUNT_LINKS))) + .addMethod( + getCreateAnalyticsAccountLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.ads.marketingplatform.admin.v1alpha + .CreateAnalyticsAccountLinkRequest, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink>( + service, METHODID_CREATE_ANALYTICS_ACCOUNT_LINK))) + .addMethod( + getDeleteAnalyticsAccountLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.ads.marketingplatform.admin.v1alpha + .DeleteAnalyticsAccountLinkRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_ANALYTICS_ACCOUNT_LINK))) + .addMethod( + getSetPropertyServiceLevelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse>( + service, METHODID_SET_PROPERTY_SERVICE_LEVEL))) + .build(); + } + + private abstract static class MarketingplatformAdminServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MarketingplatformAdminServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MarketingplatformAdminService"); + } + } + + private static final class MarketingplatformAdminServiceFileDescriptorSupplier + extends MarketingplatformAdminServiceBaseDescriptorSupplier { + MarketingplatformAdminServiceFileDescriptorSupplier() {} + } + + private static final class MarketingplatformAdminServiceMethodDescriptorSupplier + extends MarketingplatformAdminServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MarketingplatformAdminServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (MarketingplatformAdminServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new MarketingplatformAdminServiceFileDescriptorSupplier()) + .addMethod(getGetOrganizationMethod()) + .addMethod(getListAnalyticsAccountLinksMethod()) + .addMethod(getCreateAnalyticsAccountLinkMethod()) + .addMethod(getDeleteAnalyticsAccountLinkMethod()) + .addMethod(getSetPropertyServiceLevelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-marketingplatformadminapi/owlbot.py b/java-marketingplatformadminapi/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-marketingplatformadminapi/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-marketingplatformadminapi/pom.xml b/java-marketingplatformadminapi/pom.xml new file mode 100644 index 000000000000..c130b3fe9ab4 --- /dev/null +++ b/java-marketingplatformadminapi/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.ads-marketingplatform + admin-parent + pom + 0.0.1-SNAPSHOT + Google Google Marketing Platform Admin API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.46.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + admin-parent + + + + + + com.google.ads-marketingplatform + admin + 0.0.1-SNAPSHOT + + + com.google.ads-marketingplatform.api.grpc + grpc-admin-v1alpha + 0.0.1-SNAPSHOT + + + com.google.ads-marketingplatform.api.grpc + proto-admin-v1alpha + 0.0.1-SNAPSHOT + + + + + + + admin + grpc-admin-v1alpha + proto-admin-v1alpha + admin-bom + + + diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/pom.xml b/java-marketingplatformadminapi/proto-admin-v1alpha/pom.xml new file mode 100644 index 000000000000..426e6bb3e0d6 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.ads-marketingplatform.api.grpc + proto-admin-v1alpha + 0.0.1-SNAPSHOT + proto-admin-v1alpha + Proto library for admin + + com.google.ads-marketingplatform + admin-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLink.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLink.java new file mode 100644 index 000000000000..e2d0881423e2 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLink.java @@ -0,0 +1,1264 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * A resource message representing the link between a Google Analytics account
+ * and a Google Marketing Platform organization.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.AnalyticsAccountLink} + */ +public final class AnalyticsAccountLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.AnalyticsAccountLink) + AnalyticsAccountLinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnalyticsAccountLink.newBuilder() to construct. + private AnalyticsAccountLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnalyticsAccountLink() { + name_ = ""; + analyticsAccount_ = ""; + displayName_ = ""; + linkVerificationState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AnalyticsAccountLink(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.class, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+   * ID is the same as the ID of the Analtyics account.
+   *
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * Example: "organizations/xyz/analyticsAccountLinks/1234"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+   * ID is the same as the ID of the Analtyics account.
+   *
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * Example: "organizations/xyz/analyticsAccountLinks/1234"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANALYTICS_ACCOUNT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object analyticsAccount_ = ""; + /** + * + * + *
+   * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+   * The account ID will be used as the ID of this AnalyticsAccountLink
+   * resource, which will become the final component of the resource name.
+   *
+   * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+   * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsAccount. + */ + @java.lang.Override + public java.lang.String getAnalyticsAccount() { + java.lang.Object ref = analyticsAccount_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+   * The account ID will be used as the ID of this AnalyticsAccountLink
+   * resource, which will become the final component of the resource name.
+   *
+   * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+   * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnalyticsAccountBytes() { + java.lang.Object ref = analyticsAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Output only. The human-readable name for the Analytics account.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The human-readable name for the Analytics account.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINK_VERIFICATION_STATE_FIELD_NUMBER = 4; + private int linkVerificationState_ = 0; + /** + * + * + *
+   * Output only. The verification state of the link between the Analytics
+   * account and the parent organization.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for linkVerificationState. + */ + @java.lang.Override + public int getLinkVerificationStateValue() { + return linkVerificationState_; + } + /** + * + * + *
+   * Output only. The verification state of the link between the Analytics
+   * account and the parent organization.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The linkVerificationState. + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState + getLinkVerificationState() { + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState result = + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState.forNumber( + linkVerificationState_); + return result == null + ? com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsAccount_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, analyticsAccount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (linkVerificationState_ + != com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState + .LINK_VERIFICATION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, linkVerificationState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsAccount_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, analyticsAccount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (linkVerificationState_ + != com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState + .LINK_VERIFICATION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, linkVerificationState_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink other = + (com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAnalyticsAccount().equals(other.getAnalyticsAccount())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (linkVerificationState_ != other.linkVerificationState_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ANALYTICS_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getAnalyticsAccount().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + LINK_VERIFICATION_STATE_FIELD_NUMBER; + hash = (53 * hash) + linkVerificationState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A resource message representing the link between a Google Analytics account
+   * and a Google Marketing Platform organization.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.AnalyticsAccountLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.AnalyticsAccountLink) + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.class, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + analyticsAccount_ = ""; + displayName_ = ""; + linkVerificationState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink build() { + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink result = + new com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.analyticsAccount_ = analyticsAccount_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.linkVerificationState_ = linkVerificationState_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAnalyticsAccount().isEmpty()) { + analyticsAccount_ = other.analyticsAccount_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.linkVerificationState_ != 0) { + setLinkVerificationStateValue(other.getLinkVerificationStateValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + analyticsAccount_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + linkVerificationState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+     * ID is the same as the ID of the Analtyics account.
+     *
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * Example: "organizations/xyz/analyticsAccountLinks/1234"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+     * ID is the same as the ID of the Analtyics account.
+     *
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * Example: "organizations/xyz/analyticsAccountLinks/1234"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+     * ID is the same as the ID of the Analtyics account.
+     *
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * Example: "organizations/xyz/analyticsAccountLinks/1234"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+     * ID is the same as the ID of the Analtyics account.
+     *
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * Example: "organizations/xyz/analyticsAccountLinks/1234"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+     * ID is the same as the ID of the Analtyics account.
+     *
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * Example: "organizations/xyz/analyticsAccountLinks/1234"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object analyticsAccount_ = ""; + /** + * + * + *
+     * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+     * The account ID will be used as the ID of this AnalyticsAccountLink
+     * resource, which will become the final component of the resource name.
+     *
+     * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+     * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsAccount. + */ + public java.lang.String getAnalyticsAccount() { + java.lang.Object ref = analyticsAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+     * The account ID will be used as the ID of this AnalyticsAccountLink
+     * resource, which will become the final component of the resource name.
+     *
+     * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+     * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsAccount. + */ + public com.google.protobuf.ByteString getAnalyticsAccountBytes() { + java.lang.Object ref = analyticsAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+     * The account ID will be used as the ID of this AnalyticsAccountLink
+     * resource, which will become the final component of the resource name.
+     *
+     * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+     * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The analyticsAccount to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + analyticsAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+     * The account ID will be used as the ID of this AnalyticsAccountLink
+     * resource, which will become the final component of the resource name.
+     *
+     * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+     * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAnalyticsAccount() { + analyticsAccount_ = getDefaultInstance().getAnalyticsAccount(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+     * The account ID will be used as the ID of this AnalyticsAccountLink
+     * resource, which will become the final component of the resource name.
+     *
+     * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+     * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for analyticsAccount to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + analyticsAccount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. The human-readable name for the Analytics account.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The human-readable name for the Analytics account.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The human-readable name for the Analytics account.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The human-readable name for the Analytics account.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The human-readable name for the Analytics account.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int linkVerificationState_ = 0; + /** + * + * + *
+     * Output only. The verification state of the link between the Analytics
+     * account and the parent organization.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for linkVerificationState. + */ + @java.lang.Override + public int getLinkVerificationStateValue() { + return linkVerificationState_; + } + /** + * + * + *
+     * Output only. The verification state of the link between the Analytics
+     * account and the parent organization.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for linkVerificationState to set. + * @return This builder for chaining. + */ + public Builder setLinkVerificationStateValue(int value) { + linkVerificationState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The verification state of the link between the Analytics
+     * account and the parent organization.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The linkVerificationState. + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState + getLinkVerificationState() { + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState result = + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState.forNumber( + linkVerificationState_); + return result == null + ? com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The verification state of the link between the Analytics
+     * account and the parent organization.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The linkVerificationState to set. + * @return This builder for chaining. + */ + public Builder setLinkVerificationState( + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + linkVerificationState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The verification state of the link between the Analytics
+     * account and the parent organization.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLinkVerificationState() { + bitField0_ = (bitField0_ & ~0x00000008); + linkVerificationState_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.AnalyticsAccountLink) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.AnalyticsAccountLink) + private static final com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnalyticsAccountLink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkName.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkName.java new file mode 100644 index 000000000000..52888b18118d --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkName.java @@ -0,0 +1,201 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class AnalyticsAccountLinkName implements ResourceName { + private static final PathTemplate ORGANIZATION_ANALYTICS_ACCOUNT_LINK = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/analyticsAccountLinks/{analytics_account_link}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String analyticsAccountLink; + + @Deprecated + protected AnalyticsAccountLinkName() { + organization = null; + analyticsAccountLink = null; + } + + private AnalyticsAccountLinkName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + analyticsAccountLink = Preconditions.checkNotNull(builder.getAnalyticsAccountLink()); + } + + public String getOrganization() { + return organization; + } + + public String getAnalyticsAccountLink() { + return analyticsAccountLink; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AnalyticsAccountLinkName of(String organization, String analyticsAccountLink) { + return newBuilder() + .setOrganization(organization) + .setAnalyticsAccountLink(analyticsAccountLink) + .build(); + } + + public static String format(String organization, String analyticsAccountLink) { + return newBuilder() + .setOrganization(organization) + .setAnalyticsAccountLink(analyticsAccountLink) + .build() + .toString(); + } + + public static AnalyticsAccountLinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_ANALYTICS_ACCOUNT_LINK.validatedMatch( + formattedString, "AnalyticsAccountLinkName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("analytics_account_link")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (AnalyticsAccountLinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_ANALYTICS_ACCOUNT_LINK.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (analyticsAccountLink != null) { + fieldMapBuilder.put("analytics_account_link", analyticsAccountLink); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_ANALYTICS_ACCOUNT_LINK.instantiate( + "organization", organization, "analytics_account_link", analyticsAccountLink); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AnalyticsAccountLinkName that = ((AnalyticsAccountLinkName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.analyticsAccountLink, that.analyticsAccountLink); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(analyticsAccountLink); + return h; + } + + /** Builder for organizations/{organization}/analyticsAccountLinks/{analytics_account_link}. */ + public static class Builder { + private String organization; + private String analyticsAccountLink; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getAnalyticsAccountLink() { + return analyticsAccountLink; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setAnalyticsAccountLink(String analyticsAccountLink) { + this.analyticsAccountLink = analyticsAccountLink; + return this; + } + + private Builder(AnalyticsAccountLinkName analyticsAccountLinkName) { + this.organization = analyticsAccountLinkName.organization; + this.analyticsAccountLink = analyticsAccountLinkName.analyticsAccountLink; + } + + public AnalyticsAccountLinkName build() { + return new AnalyticsAccountLinkName(this); + } + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkOrBuilder.java new file mode 100644 index 000000000000..0e75e17b01a2 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsAccountLinkOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface AnalyticsAccountLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.AnalyticsAccountLink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+   * ID is the same as the ID of the Analtyics account.
+   *
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * Example: "organizations/xyz/analyticsAccountLinks/1234"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Resource name of this AnalyticsAccountLink. Note the resource
+   * ID is the same as the ID of the Analtyics account.
+   *
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * Example: "organizations/xyz/analyticsAccountLinks/1234"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+   * The account ID will be used as the ID of this AnalyticsAccountLink
+   * resource, which will become the final component of the resource name.
+   *
+   * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+   * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsAccount. + */ + java.lang.String getAnalyticsAccount(); + /** + * + * + *
+   * Required. Immutable. The resource name of the AnalyticsAdmin API account.
+   * The account ID will be used as the ID of this AnalyticsAccountLink
+   * resource, which will become the final component of the resource name.
+   *
+   * Format: analyticsadmin.googleapis.com/accounts/{account_id}
+   * 
+ * + * + * string analytics_account = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsAccount. + */ + com.google.protobuf.ByteString getAnalyticsAccountBytes(); + + /** + * + * + *
+   * Output only. The human-readable name for the Analytics account.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. The human-readable name for the Analytics account.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. The verification state of the link between the Analytics
+   * account and the parent organization.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for linkVerificationState. + */ + int getLinkVerificationStateValue(); + /** + * + * + *
+   * Output only. The verification state of the link between the Analytics
+   * account and the parent organization.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.LinkVerificationState link_verification_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The linkVerificationState. + */ + com.google.ads.marketingplatform.admin.v1alpha.LinkVerificationState getLinkVerificationState(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsServiceLevel.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsServiceLevel.java new file mode 100644 index 000000000000..3e434d561059 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/AnalyticsServiceLevel.java @@ -0,0 +1,183 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Various levels of service for Google Analytics.
+ * 
+ * + * Protobuf enum {@code google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel} + */ +public enum AnalyticsServiceLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Service level unspecified.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_UNSPECIFIED = 0; + */ + ANALYTICS_SERVICE_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+   * The standard version of Google Analytics.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_STANDARD = 1; + */ + ANALYTICS_SERVICE_LEVEL_STANDARD(1), + /** + * + * + *
+   * The premium version of Google Analytics.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_360 = 2; + */ + ANALYTICS_SERVICE_LEVEL_360(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Service level unspecified.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_UNSPECIFIED = 0; + */ + public static final int ANALYTICS_SERVICE_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The standard version of Google Analytics.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_STANDARD = 1; + */ + public static final int ANALYTICS_SERVICE_LEVEL_STANDARD_VALUE = 1; + /** + * + * + *
+   * The premium version of Google Analytics.
+   * 
+ * + * ANALYTICS_SERVICE_LEVEL_360 = 2; + */ + public static final int ANALYTICS_SERVICE_LEVEL_360_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AnalyticsServiceLevel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AnalyticsServiceLevel forNumber(int value) { + switch (value) { + case 0: + return ANALYTICS_SERVICE_LEVEL_UNSPECIFIED; + case 1: + return ANALYTICS_SERVICE_LEVEL_STANDARD; + case 2: + return ANALYTICS_SERVICE_LEVEL_360; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AnalyticsServiceLevel findValueByNumber(int number) { + return AnalyticsServiceLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AnalyticsServiceLevel[] VALUES = values(); + + public static AnalyticsServiceLevel valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AnalyticsServiceLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel) +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequest.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequest.java new file mode 100644 index 000000000000..c53cd1489322 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequest.java @@ -0,0 +1,1000 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Request message for CreateAnalyticsAccountLink RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest} + */ +public final class CreateAnalyticsAccountLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + CreateAnalyticsAccountLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAnalyticsAccountLinkRequest.newBuilder() to construct. + private CreateAnalyticsAccountLinkRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAnalyticsAccountLinkRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAnalyticsAccountLinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest.Builder + .class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource where this Analytics account link will be
+   * created. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource where this Analytics account link will be
+   * created. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANALYTICS_ACCOUNT_LINK_FIELD_NUMBER = 2; + private com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink analyticsAccountLink_; + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the analyticsAccountLink field is set. + */ + @java.lang.Override + public boolean hasAnalyticsAccountLink() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The analyticsAccountLink. + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getAnalyticsAccountLink() { + return analyticsAccountLink_ == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.getDefaultInstance() + : analyticsAccountLink_; + } + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinkOrBuilder() { + return analyticsAccountLink_ == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.getDefaultInstance() + : analyticsAccountLink_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAnalyticsAccountLink()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAnalyticsAccountLink()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest other = + (com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAnalyticsAccountLink() != other.hasAnalyticsAccountLink()) return false; + if (hasAnalyticsAccountLink()) { + if (!getAnalyticsAccountLink().equals(other.getAnalyticsAccountLink())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasAnalyticsAccountLink()) { + hash = (37 * hash) + ANALYTICS_ACCOUNT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getAnalyticsAccountLink().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for CreateAnalyticsAccountLink RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + .class, + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + .Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAnalyticsAccountLinkFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + analyticsAccountLink_ = null; + if (analyticsAccountLinkBuilder_ != null) { + analyticsAccountLinkBuilder_.dispose(); + analyticsAccountLinkBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + build() { + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest result = + new com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.analyticsAccountLink_ = + analyticsAccountLinkBuilder_ == null + ? analyticsAccountLink_ + : analyticsAccountLinkBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAnalyticsAccountLink()) { + mergeAnalyticsAccountLink(other.getAnalyticsAccountLink()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getAnalyticsAccountLinkFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource where this Analytics account link will be
+     * created. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this Analytics account link will be
+     * created. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this Analytics account link will be
+     * created. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this Analytics account link will be
+     * created. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this Analytics account link will be
+     * created. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + analyticsAccountLink_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + analyticsAccountLinkBuilder_; + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the analyticsAccountLink field is set. + */ + public boolean hasAnalyticsAccountLink() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The analyticsAccountLink. + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getAnalyticsAccountLink() { + if (analyticsAccountLinkBuilder_ == null) { + return analyticsAccountLink_ == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance() + : analyticsAccountLink_; + } else { + return analyticsAccountLinkBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink value) { + if (analyticsAccountLinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + analyticsAccountLink_ = value; + } else { + analyticsAccountLinkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + builderForValue) { + if (analyticsAccountLinkBuilder_ == null) { + analyticsAccountLink_ = builderForValue.build(); + } else { + analyticsAccountLinkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAnalyticsAccountLink( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink value) { + if (analyticsAccountLinkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && analyticsAccountLink_ != null + && analyticsAccountLink_ + != com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance()) { + getAnalyticsAccountLinkBuilder().mergeFrom(value); + } else { + analyticsAccountLink_ = value; + } + } else { + analyticsAccountLinkBuilder_.mergeFrom(value); + } + if (analyticsAccountLink_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAnalyticsAccountLink() { + bitField0_ = (bitField0_ & ~0x00000002); + analyticsAccountLink_ = null; + if (analyticsAccountLinkBuilder_ != null) { + analyticsAccountLinkBuilder_.dispose(); + analyticsAccountLinkBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + getAnalyticsAccountLinkBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAnalyticsAccountLinkFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinkOrBuilder() { + if (analyticsAccountLinkBuilder_ != null) { + return analyticsAccountLinkBuilder_.getMessageOrBuilder(); + } else { + return analyticsAccountLink_ == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance() + : analyticsAccountLink_; + } + } + /** + * + * + *
+     * Required. The Analytics account link to create.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + getAnalyticsAccountLinkFieldBuilder() { + if (analyticsAccountLinkBuilder_ == null) { + analyticsAccountLinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder>( + getAnalyticsAccountLink(), getParentForChildren(), isClean()); + analyticsAccountLink_ = null; + } + return analyticsAccountLinkBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + private static final com.google.ads.marketingplatform.admin.v1alpha + .CreateAnalyticsAccountLinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAnalyticsAccountLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequestOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequestOrBuilder.java new file mode 100644 index 000000000000..d037b258175e --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/CreateAnalyticsAccountLinkRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface CreateAnalyticsAccountLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this Analytics account link will be
+   * created. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource where this Analytics account link will be
+   * created. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the analyticsAccountLink field is set. + */ + boolean hasAnalyticsAccountLink(); + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The analyticsAccountLink. + */ + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink getAnalyticsAccountLink(); + /** + * + * + *
+   * Required. The Analytics account link to create.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinkOrBuilder(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequest.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequest.java new file mode 100644 index 000000000000..7fbf986ec19e --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequest.java @@ -0,0 +1,685 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Request message for DeleteAnalyticsAccountLink RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest} + */ +public final class DeleteAnalyticsAccountLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + DeleteAnalyticsAccountLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAnalyticsAccountLinkRequest.newBuilder() to construct. + private DeleteAnalyticsAccountLinkRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAnalyticsAccountLinkRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAnalyticsAccountLinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Analytics account link to delete.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Analytics account link to delete.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest other = + (com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for DeleteAnalyticsAccountLink RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + .class, + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + .Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + build() { + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest result = + new com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Analytics account link to delete.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Analytics account link to delete.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Analytics account link to delete.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Analytics account link to delete.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Analytics account link to delete.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + private static final com.google.ads.marketingplatform.admin.v1alpha + .DeleteAnalyticsAccountLinkRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAnalyticsAccountLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequestOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequestOrBuilder.java new file mode 100644 index 000000000000..22e6570e11de --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/DeleteAnalyticsAccountLinkRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface DeleteAnalyticsAccountLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Analytics account link to delete.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Analytics account link to delete.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequest.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequest.java new file mode 100644 index 000000000000..c2277f3f8d29 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Request message for GetOrganization RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.GetOrganizationRequest} + */ +public final class GetOrganizationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.GetOrganizationRequest) + GetOrganizationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetOrganizationRequest.newBuilder() to construct. + private GetOrganizationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetOrganizationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOrganizationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the Organization to retrieve.
+   * Format: organizations/{org_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Organization to retrieve.
+   * Format: organizations/{org_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest other = + (com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for GetOrganization RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.GetOrganizationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.GetOrganizationRequest) + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest build() { + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest result = + new com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the Organization to retrieve.
+     * Format: organizations/{org_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Organization to retrieve.
+     * Format: organizations/{org_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Organization to retrieve.
+     * Format: organizations/{org_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Organization to retrieve.
+     * Format: organizations/{org_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Organization to retrieve.
+     * Format: organizations/{org_id}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.GetOrganizationRequest) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.GetOrganizationRequest) + private static final com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOrganizationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequestOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequestOrBuilder.java new file mode 100644 index 000000000000..3813a349b029 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/GetOrganizationRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface GetOrganizationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.GetOrganizationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Organization to retrieve.
+   * Format: organizations/{org_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the Organization to retrieve.
+   * Format: organizations/{org_id}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/LinkVerificationState.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/LinkVerificationState.java new file mode 100644 index 000000000000..637534a254d3 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/LinkVerificationState.java @@ -0,0 +1,185 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * The verification state of the link between a product account and a GMP
+ * organization.
+ * 
+ * + * Protobuf enum {@code google.marketingplatform.admin.v1alpha.LinkVerificationState} + */ +public enum LinkVerificationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The link state is unknown.
+   * 
+ * + * LINK_VERIFICATION_STATE_UNSPECIFIED = 0; + */ + LINK_VERIFICATION_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The link is established.
+   * 
+ * + * LINK_VERIFICATION_STATE_VERIFIED = 1; + */ + LINK_VERIFICATION_STATE_VERIFIED(1), + /** + * + * + *
+   * The link is requested, but hasn't been approved by the product account
+   * admin.
+   * 
+ * + * LINK_VERIFICATION_STATE_NOT_VERIFIED = 2; + */ + LINK_VERIFICATION_STATE_NOT_VERIFIED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The link state is unknown.
+   * 
+ * + * LINK_VERIFICATION_STATE_UNSPECIFIED = 0; + */ + public static final int LINK_VERIFICATION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The link is established.
+   * 
+ * + * LINK_VERIFICATION_STATE_VERIFIED = 1; + */ + public static final int LINK_VERIFICATION_STATE_VERIFIED_VALUE = 1; + /** + * + * + *
+   * The link is requested, but hasn't been approved by the product account
+   * admin.
+   * 
+ * + * LINK_VERIFICATION_STATE_NOT_VERIFIED = 2; + */ + public static final int LINK_VERIFICATION_STATE_NOT_VERIFIED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LinkVerificationState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static LinkVerificationState forNumber(int value) { + switch (value) { + case 0: + return LINK_VERIFICATION_STATE_UNSPECIFIED; + case 1: + return LINK_VERIFICATION_STATE_VERIFIED; + case 2: + return LINK_VERIFICATION_STATE_NOT_VERIFIED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LinkVerificationState findValueByNumber(int number) { + return LinkVerificationState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final LinkVerificationState[] VALUES = values(); + + public static LinkVerificationState valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private LinkVerificationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.marketingplatform.admin.v1alpha.LinkVerificationState) +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequest.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequest.java new file mode 100644 index 000000000000..254790641916 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequest.java @@ -0,0 +1,1001 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Request message for ListAnalyticsAccountLinks RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest} + */ +public final class ListAnalyticsAccountLinksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + ListAnalyticsAccountLinksRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAnalyticsAccountLinksRequest.newBuilder() to construct. + private ListAnalyticsAccountLinksRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAnalyticsAccountLinksRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAnalyticsAccountLinksRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent organization, which owns this collection of Analytics
+   * account links. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent organization, which owns this collection of Analytics
+   * account links. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of Analytics account links to return in one
+   * call. The service may return fewer than this value.
+   *
+   * If unspecified, at most 50 Analytics account links will be returned. The
+   * maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * `ListAnalyticsAccountLinks` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * `ListAnalyticsAccountLinks` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest other = + (com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ListAnalyticsAccountLinks RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + .Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest build() { + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest result = + new com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent organization, which owns this collection of Analytics
+     * account links. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent organization, which owns this collection of Analytics
+     * account links. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent organization, which owns this collection of Analytics
+     * account links. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent organization, which owns this collection of Analytics
+     * account links. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent organization, which owns this collection of Analytics
+     * account links. Format: organizations/{org_id}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of Analytics account links to return in one
+     * call. The service may return fewer than this value.
+     *
+     * If unspecified, at most 50 Analytics account links will be returned. The
+     * maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of Analytics account links to return in one
+     * call. The service may return fewer than this value.
+     *
+     * If unspecified, at most 50 Analytics account links will be returned. The
+     * maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of Analytics account links to return in one
+     * call. The service may return fewer than this value.
+     *
+     * If unspecified, at most 50 Analytics account links will be returned. The
+     * maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * `ListAnalyticsAccountLinks` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * `ListAnalyticsAccountLinks` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * `ListAnalyticsAccountLinks` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * `ListAnalyticsAccountLinks` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+     * call. Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to
+     * `ListAnalyticsAccountLinks` must match the call that provided the page
+     * token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + private static final com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAnalyticsAccountLinksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequestOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequestOrBuilder.java new file mode 100644 index 000000000000..bc093183bc5d --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface ListAnalyticsAccountLinksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent organization, which owns this collection of Analytics
+   * account links. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent organization, which owns this collection of Analytics
+   * account links. Format: organizations/{org_id}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of Analytics account links to return in one
+   * call. The service may return fewer than this value.
+   *
+   * If unspecified, at most 50 Analytics account links will be returned. The
+   * maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * `ListAnalyticsAccountLinks` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous ListAnalyticsAccountLinks
+   * call. Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to
+   * `ListAnalyticsAccountLinks` must match the call that provided the page
+   * token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponse.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponse.java new file mode 100644 index 000000000000..48e9baca10c7 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponse.java @@ -0,0 +1,1242 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Response message for ListAnalyticsAccountLinks RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse} + */ +public final class ListAnalyticsAccountLinksResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + ListAnalyticsAccountLinksResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAnalyticsAccountLinksResponse.newBuilder() to construct. + private ListAnalyticsAccountLinksResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAnalyticsAccountLinksResponse() { + analyticsAccountLinks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAnalyticsAccountLinksResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse.class, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse.Builder + .class); + } + + public static final int ANALYTICS_ACCOUNT_LINKS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + analyticsAccountLinks_; + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + @java.lang.Override + public java.util.List + getAnalyticsAccountLinksList() { + return analyticsAccountLinks_; + } + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + getAnalyticsAccountLinksOrBuilderList() { + return analyticsAccountLinks_; + } + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + @java.lang.Override + public int getAnalyticsAccountLinksCount() { + return analyticsAccountLinks_.size(); + } + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getAnalyticsAccountLinks(int index) { + return analyticsAccountLinks_.get(index); + } + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinksOrBuilder(int index) { + return analyticsAccountLinks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < analyticsAccountLinks_.size(); i++) { + output.writeMessage(1, analyticsAccountLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < analyticsAccountLinks_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, analyticsAccountLinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse other = + (com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) obj; + + if (!getAnalyticsAccountLinksList().equals(other.getAnalyticsAccountLinksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAnalyticsAccountLinksCount() > 0) { + hash = (37 * hash) + ANALYTICS_ACCOUNT_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAnalyticsAccountLinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for ListAnalyticsAccountLinks RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + .class, + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + .Builder.class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (analyticsAccountLinksBuilder_ == null) { + analyticsAccountLinks_ = java.util.Collections.emptyList(); + } else { + analyticsAccountLinks_ = null; + analyticsAccountLinksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + build() { + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse result = + new com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse result) { + if (analyticsAccountLinksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + analyticsAccountLinks_ = java.util.Collections.unmodifiableList(analyticsAccountLinks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.analyticsAccountLinks_ = analyticsAccountLinks_; + } else { + result.analyticsAccountLinks_ = analyticsAccountLinksBuilder_.build(); + } + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + .getDefaultInstance()) return this; + if (analyticsAccountLinksBuilder_ == null) { + if (!other.analyticsAccountLinks_.isEmpty()) { + if (analyticsAccountLinks_.isEmpty()) { + analyticsAccountLinks_ = other.analyticsAccountLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.addAll(other.analyticsAccountLinks_); + } + onChanged(); + } + } else { + if (!other.analyticsAccountLinks_.isEmpty()) { + if (analyticsAccountLinksBuilder_.isEmpty()) { + analyticsAccountLinksBuilder_.dispose(); + analyticsAccountLinksBuilder_ = null; + analyticsAccountLinks_ = other.analyticsAccountLinks_; + bitField0_ = (bitField0_ & ~0x00000001); + analyticsAccountLinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAnalyticsAccountLinksFieldBuilder() + : null; + } else { + analyticsAccountLinksBuilder_.addAllMessages(other.analyticsAccountLinks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink m = + input.readMessage( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .parser(), + extensionRegistry); + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.add(m); + } else { + analyticsAccountLinksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + analyticsAccountLinks_ = java.util.Collections.emptyList(); + + private void ensureAnalyticsAccountLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + analyticsAccountLinks_ = + new java.util.ArrayList< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink>( + analyticsAccountLinks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + analyticsAccountLinksBuilder_; + + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public java.util.List + getAnalyticsAccountLinksList() { + if (analyticsAccountLinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(analyticsAccountLinks_); + } else { + return analyticsAccountLinksBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public int getAnalyticsAccountLinksCount() { + if (analyticsAccountLinksBuilder_ == null) { + return analyticsAccountLinks_.size(); + } else { + return analyticsAccountLinksBuilder_.getCount(); + } + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + getAnalyticsAccountLinks(int index) { + if (analyticsAccountLinksBuilder_ == null) { + return analyticsAccountLinks_.get(index); + } else { + return analyticsAccountLinksBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder setAnalyticsAccountLinks( + int index, com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink value) { + if (analyticsAccountLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.set(index, value); + onChanged(); + } else { + analyticsAccountLinksBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder setAnalyticsAccountLinks( + int index, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + builderForValue) { + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.set(index, builderForValue.build()); + onChanged(); + } else { + analyticsAccountLinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder addAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink value) { + if (analyticsAccountLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.add(value); + onChanged(); + } else { + analyticsAccountLinksBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder addAnalyticsAccountLinks( + int index, com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink value) { + if (analyticsAccountLinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.add(index, value); + onChanged(); + } else { + analyticsAccountLinksBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder addAnalyticsAccountLinks( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + builderForValue) { + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.add(builderForValue.build()); + onChanged(); + } else { + analyticsAccountLinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder addAnalyticsAccountLinks( + int index, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + builderForValue) { + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.add(index, builderForValue.build()); + onChanged(); + } else { + analyticsAccountLinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder addAllAnalyticsAccountLinks( + java.lang.Iterable< + ? extends com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink> + values) { + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, analyticsAccountLinks_); + onChanged(); + } else { + analyticsAccountLinksBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder clearAnalyticsAccountLinks() { + if (analyticsAccountLinksBuilder_ == null) { + analyticsAccountLinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + analyticsAccountLinksBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public Builder removeAnalyticsAccountLinks(int index) { + if (analyticsAccountLinksBuilder_ == null) { + ensureAnalyticsAccountLinksIsMutable(); + analyticsAccountLinks_.remove(index); + onChanged(); + } else { + analyticsAccountLinksBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + getAnalyticsAccountLinksBuilder(int index) { + return getAnalyticsAccountLinksFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinksOrBuilder(int index) { + if (analyticsAccountLinksBuilder_ == null) { + return analyticsAccountLinks_.get(index); + } else { + return analyticsAccountLinksBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public java.util.List< + ? extends com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + getAnalyticsAccountLinksOrBuilderList() { + if (analyticsAccountLinksBuilder_ != null) { + return analyticsAccountLinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(analyticsAccountLinks_); + } + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + addAnalyticsAccountLinksBuilder() { + return getAnalyticsAccountLinksFieldBuilder() + .addBuilder( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance()); + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder + addAnalyticsAccountLinksBuilder(int index) { + return getAnalyticsAccountLinksFieldBuilder() + .addBuilder( + index, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink + .getDefaultInstance()); + } + /** + * + * + *
+     * Analytics account links in this organization.
+     * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + public java.util.List< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder> + getAnalyticsAccountLinksBuilderList() { + return getAnalyticsAccountLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + getAnalyticsAccountLinksFieldBuilder() { + if (analyticsAccountLinksBuilder_ == null) { + analyticsAccountLinksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink.Builder, + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder>( + analyticsAccountLinks_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + analyticsAccountLinks_ = null; + } + return analyticsAccountLinksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + private static final com.google.ads.marketingplatform.admin.v1alpha + .ListAnalyticsAccountLinksResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAnalyticsAccountLinksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponseOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponseOrBuilder.java new file mode 100644 index 000000000000..5d1f5fbd032e --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ListAnalyticsAccountLinksResponseOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface ListAnalyticsAccountLinksResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + java.util.List + getAnalyticsAccountLinksList(); + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink getAnalyticsAccountLinks( + int index); + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + int getAnalyticsAccountLinksCount(); + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + java.util.List< + ? extends com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder> + getAnalyticsAccountLinksOrBuilderList(); + /** + * + * + *
+   * Analytics account links in this organization.
+   * 
+ * + * + * repeated .google.marketingplatform.admin.v1alpha.AnalyticsAccountLink analytics_account_links = 1; + * + */ + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkOrBuilder + getAnalyticsAccountLinksOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminProto.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminProto.java new file mode 100644 index 000000000000..e725e336585f --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/MarketingplatformAdminProto.java @@ -0,0 +1,238 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public final class MarketingplatformAdminProto { + private MarketingplatformAdminProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nDgoogle/marketingplatform/admin/v1alpha" + + "/marketingplatform_admin.proto\022&google.m" + + "arketingplatform.admin.v1alpha\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\0326google/market" + + "ingplatform/admin/v1alpha/resources.prot" + + "o\032\033google/protobuf/empty.proto\"b\n\026GetOrg" + + "anizationRequest\022H\n\004name\030\001 \001(\tB:\340A\002\372A4\n2" + + "marketingplatformadmin.googleapis.com/Or" + + "ganization\"\247\001\n ListAnalyticsAccountLinks" + + "Request\022R\n\006parent\030\001 \001(\tBB\340A\002\372A<\022:marketi" + + "ngplatformadmin.googleapis.com/Analytics" + + "AccountLink\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\np" + + "age_token\030\003 \001(\tB\003\340A\001\"\233\001\n!ListAnalyticsAc" + + "countLinksResponse\022]\n\027analytics_account_" + + "links\030\001 \003(\0132<.google.marketingplatform.a" + + "dmin.v1alpha.AnalyticsAccountLink\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"\332\001\n!CreateAnalyticsAc" + + "countLinkRequest\022R\n\006parent\030\001 \001(\tBB\340A\002\372A<" + + "\022:marketingplatformadmin.googleapis.com/" + + "AnalyticsAccountLink\022a\n\026analytics_accoun" + + "t_link\030\002 \001(\0132<.google.marketingplatform." + + "admin.v1alpha.AnalyticsAccountLinkB\003\340A\002\"" + + "u\n!DeleteAnalyticsAccountLinkRequest\022P\n\004" + + "name\030\001 \001(\tBB\340A\002\372A<\n:marketingplatformadm" + + "in.googleapis.com/AnalyticsAccountLink\"\354" + + "\001\n\036SetPropertyServiceLevelRequest\022#\n\026ana" + + "lytics_account_link\030\001 \001(\tB\003\340A\002\022J\n\022analyt" + + "ics_property\030\002 \001(\tB.\340A\002\372A(\n&analyticsadm" + + "in.googleapis.com/Property\022Y\n\rservice_le" + + "vel\030\003 \001(\0162=.google.marketingplatform.adm" + + "in.v1alpha.AnalyticsServiceLevelB\003\340A\002\"!\n" + + "\037SetPropertyServiceLevelResponse*\207\001\n\025Ana" + + "lyticsServiceLevel\022\'\n#ANALYTICS_SERVICE_" + + "LEVEL_UNSPECIFIED\020\000\022$\n ANALYTICS_SERVICE" + + "_LEVEL_STANDARD\020\001\022\037\n\033ANALYTICS_SERVICE_L" + + "EVEL_360\020\0022\262\013\n\035MarketingplatformAdminSer" + + "vice\022\267\001\n\017GetOrganization\022>.google.market" + + "ingplatform.admin.v1alpha.GetOrganizatio" + + "nRequest\0324.google.marketingplatform.admi" + + "n.v1alpha.Organization\".\332A\004name\202\323\344\223\002!\022\037/" + + "v1alpha/{name=organizations/*}\022\372\001\n\031ListA" + + "nalyticsAccountLinks\022H.google.marketingp" + + "latform.admin.v1alpha.ListAnalyticsAccou" + + "ntLinksRequest\032I.google.marketingplatfor" + + "m.admin.v1alpha.ListAnalyticsAccountLink" + + "sResponse\"H\332A\006parent\202\323\344\223\0029\0227/v1alpha/{pa" + + "rent=organizations/*}/analyticsAccountLi" + + "nks\022\236\002\n\032CreateAnalyticsAccountLink\022I.goo" + + "gle.marketingplatform.admin.v1alpha.Crea" + + "teAnalyticsAccountLinkRequest\032<.google.m" + + "arketingplatform.admin.v1alpha.Analytics" + + "AccountLink\"w\332A\035parent,analytics_account" + + "_link\202\323\344\223\002Q\"7/v1alpha/{parent=organizati" + + "ons/*}/analyticsAccountLinks:\026analytics_" + + "account_link\022\307\001\n\032DeleteAnalyticsAccountL" + + "ink\022I.google.marketingplatform.admin.v1a" + + "lpha.DeleteAnalyticsAccountLinkRequest\032\026" + + ".google.protobuf.Empty\"F\332A\004name\202\323\344\223\0029*7/" + + "v1alpha/{name=organizations/*/analyticsA" + + "ccountLinks/*}\022\262\002\n\027SetPropertyServiceLev" + + "el\022F.google.marketingplatform.admin.v1al" + + "pha.SetPropertyServiceLevelRequest\032G.goo" + + "gle.marketingplatform.admin.v1alpha.SetP" + + "ropertyServiceLevelResponse\"\205\001\332A\026analyti" + + "cs_account_link\202\323\344\223\002f\"a/v1alpha/{analyti" + + "cs_account_link=organizations/*/analytic" + + "sAccountLinks/*}:setPropertyServiceLevel" + + ":\001*\032\271\001\312A%marketingplatformadmin.googleap" + + "is.com\322A\215\001https://www.googleapis.com/aut" + + "h/marketingplatformadmin.analytics.read," + + "https://www.googleapis.com/auth/marketin" + + "gplatformadmin.analytics.updateB\351\002\n.com." + + "google.ads.marketingplatform.admin.v1alp" + + "haB\033MarketingplatformAdminProtoP\001ZKgoogl" + + "e.golang.org/genproto/googleapis/marketi" + + "ngplatform/admin/v1alpha;admin\252\002*Google." + + "Ads.MarketingPlatform.Admin.V1Alpha\312\002*Go" + + "ogle\\Ads\\MarketingPlatform\\Admin\\V1alpha" + + "\352\002.Google::Ads::MarketingPlatform::Admin" + + "::V1alpha\352A?\n&analyticsadmin.googleapis." + + "com/Property\022\025properties/{property}b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_GetOrganizationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_ListAnalyticsAccountLinksResponse_descriptor, + new java.lang.String[] { + "AnalyticsAccountLinks", "NextPageToken", + }); + internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_CreateAnalyticsAccountLinkRequest_descriptor, + new java.lang.String[] { + "Parent", "AnalyticsAccountLink", + }); + internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_DeleteAnalyticsAccountLinkRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor, + new java.lang.String[] { + "AnalyticsAccountLink", "AnalyticsProperty", "ServiceLevel", + }); + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/Organization.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/Organization.java new file mode 100644 index 000000000000..f9cf179d8fd0 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/Organization.java @@ -0,0 +1,815 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * A resource message representing a Google Marketing Platform organization.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.Organization} + */ +public final class Organization extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.Organization) + OrganizationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Organization.newBuilder() to construct. + private Organization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Organization() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Organization(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_Organization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.Organization.class, + com.google.ads.marketingplatform.admin.v1alpha.Organization.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The resource name of the GMP organization.
+   * Format: organizations/{org_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. The resource name of the GMP organization.
+   * Format: organizations/{org_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The human-readable name for the organization.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The human-readable name for the organization.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.ads.marketingplatform.admin.v1alpha.Organization)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.Organization other = + (com.google.ads.marketingplatform.admin.v1alpha.Organization) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.Organization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A resource message representing a Google Marketing Platform organization.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.Organization} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.Organization) + com.google.ads.marketingplatform.admin.v1alpha.OrganizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_Organization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.Organization.class, + com.google.ads.marketingplatform.admin.v1alpha.Organization.Builder.class); + } + + // Construct using com.google.ads.marketingplatform.admin.v1alpha.Organization.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.ResourcesProto + .internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.Organization getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.Organization.getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.Organization build() { + com.google.ads.marketingplatform.admin.v1alpha.Organization result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.Organization buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.Organization result = + new com.google.ads.marketingplatform.admin.v1alpha.Organization(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.ads.marketingplatform.admin.v1alpha.Organization result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.ads.marketingplatform.admin.v1alpha.Organization) { + return mergeFrom((com.google.ads.marketingplatform.admin.v1alpha.Organization) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.ads.marketingplatform.admin.v1alpha.Organization other) { + if (other == com.google.ads.marketingplatform.admin.v1alpha.Organization.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The resource name of the GMP organization.
+     * Format: organizations/{org_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the GMP organization.
+     * Format: organizations/{org_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the GMP organization.
+     * Format: organizations/{org_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the GMP organization.
+     * Format: organizations/{org_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the GMP organization.
+     * Format: organizations/{org_id}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The human-readable name for the organization.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The human-readable name for the organization.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The human-readable name for the organization.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The human-readable name for the organization.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The human-readable name for the organization.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.Organization) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.Organization) + private static final com.google.ads.marketingplatform.admin.v1alpha.Organization DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.ads.marketingplatform.admin.v1alpha.Organization(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.Organization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Organization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.Organization getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationName.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationName.java new file mode 100644 index 000000000000..85276e4672e6 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationName implements ResourceName { + private static final PathTemplate ORGANIZATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + private volatile Map fieldValuesMap; + private final String organization; + + @Deprecated + protected OrganizationName() { + organization = null; + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION.validatedMatch( + formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION.instantiate("organization", organization); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationName that = ((OrganizationName) o); + return Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for organizations/{organization}. */ + public static class Builder { + private String organization; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder(OrganizationName organizationName) { + this.organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationOrBuilder.java new file mode 100644 index 000000000000..46ab9c56f13c --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/OrganizationOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface OrganizationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.Organization) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the GMP organization.
+   * Format: organizations/{org_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The resource name of the GMP organization.
+   * Format: organizations/{org_id}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The human-readable name for the organization.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The human-readable name for the organization.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/PropertyName.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/PropertyName.java new file mode 100644 index 000000000000..d23b972bbbc5 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/PropertyName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PropertyName implements ResourceName { + private static final PathTemplate PROPERTY = + PathTemplate.createWithoutUrlEncoding("properties/{property}"); + private volatile Map fieldValuesMap; + private final String property; + + @Deprecated + protected PropertyName() { + property = null; + } + + private PropertyName(Builder builder) { + property = Preconditions.checkNotNull(builder.getProperty()); + } + + public String getProperty() { + return property; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PropertyName of(String property) { + return newBuilder().setProperty(property).build(); + } + + public static String format(String property) { + return newBuilder().setProperty(property).build().toString(); + } + + public static PropertyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROPERTY.validatedMatch( + formattedString, "PropertyName.parse: formattedString not in valid format"); + return of(matchMap.get("property")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (PropertyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROPERTY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (property != null) { + fieldMapBuilder.put("property", property); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROPERTY.instantiate("property", property); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PropertyName that = ((PropertyName) o); + return Objects.equals(this.property, that.property); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(property); + return h; + } + + /** Builder for properties/{property}. */ + public static class Builder { + private String property; + + protected Builder() {} + + public String getProperty() { + return property; + } + + public Builder setProperty(String property) { + this.property = property; + return this; + } + + private Builder(PropertyName propertyName) { + this.property = propertyName.property; + } + + public PropertyName build() { + return new PropertyName(this); + } + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ResourcesProto.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ResourcesProto.java new file mode 100644 index 000000000000..54187409bfbd --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/ResourcesProto.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/resources.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public final class ResourcesProto { + private ResourcesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_Organization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/marketingplatform/admin/v1alpha" + + "/resources.proto\022&google.marketingplatfo" + + "rm.admin.v1alpha\032\037google/api/field_behav" + + "ior.proto\032\031google/api/resource.proto\"\253\001\n" + + "\014Organization\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\024\n\014disp" + + "lay_name\030\002 \001(\t:r\352Ao\n2marketingplatformad" + + "min.googleapis.com/Organization\022\034organiz" + + "ations/{organization}*\rorganizations2\014or" + + "ganization\"\263\003\n\024AnalyticsAccountLink\022\021\n\004n" + + "ame\030\001 \001(\tB\003\340A\010\022K\n\021analytics_account\030\002 \001(" + + "\tB0\340A\002\340A\005\372A\'\n%analyticsadmin.googleapis." + + "com/Account\022\031\n\014display_name\030\003 \001(\tB\003\340A\003\022c" + + "\n\027link_verification_state\030\004 \001(\0162=.google" + + ".marketingplatform.admin.v1alpha.LinkVer" + + "ificationStateB\003\340A\003:\272\001\352A\266\001\n:marketingpla" + + "tformadmin.googleapis.com/AnalyticsAccou" + + "ntLink\022Korganizations/{organization}/ana" + + "lyticsAccountLinks/{analytics_account_li" + + "nk}*\025analyticsAccountLinks2\024analyticsAcc" + + "ountLink*\220\001\n\025LinkVerificationState\022\'\n#LI" + + "NK_VERIFICATION_STATE_UNSPECIFIED\020\000\022$\n L" + + "INK_VERIFICATION_STATE_VERIFIED\020\001\022(\n$LIN" + + "K_VERIFICATION_STATE_NOT_VERIFIED\020\002B\330\002\n." + + "com.google.ads.marketingplatform.admin.v" + + "1alphaB\016ResourcesProtoP\001ZKgoogle.golang." + + "org/genproto/googleapis/marketingplatfor" + + "m/admin/v1alpha;admin\252\002*Google.Ads.Marke" + + "tingPlatform.Admin.V1Alpha\312\002*Google\\Ads\\" + + "MarketingPlatform\\Admin\\V1alpha\352\002.Google" + + "::Ads::MarketingPlatform::Admin::V1alpha" + + "\352A;\n%analyticsadmin.googleapis.com/Accou" + + "nt\022\022accounts/{account}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_marketingplatform_admin_v1alpha_Organization_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_Organization_descriptor, + new java.lang.String[] { + "Name", "DisplayName", + }); + internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_marketingplatform_admin_v1alpha_AnalyticsAccountLink_descriptor, + new java.lang.String[] { + "Name", "AnalyticsAccount", "DisplayName", "LinkVerificationState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequest.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequest.java new file mode 100644 index 000000000000..e1781b6307cc --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequest.java @@ -0,0 +1,1057 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Request message for SetPropertyServiceLevel RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest} + */ +public final class SetPropertyServiceLevelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + SetPropertyServiceLevelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetPropertyServiceLevelRequest.newBuilder() to construct. + private SetPropertyServiceLevelRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetPropertyServiceLevelRequest() { + analyticsAccountLink_ = ""; + analyticsProperty_ = ""; + serviceLevel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetPropertyServiceLevelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.Builder + .class); + } + + public static final int ANALYTICS_ACCOUNT_LINK_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object analyticsAccountLink_ = ""; + /** + * + * + *
+   * Required. The parent AnalyticsAccountLink scope where this property is in.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The analyticsAccountLink. + */ + @java.lang.Override + public java.lang.String getAnalyticsAccountLink() { + java.lang.Object ref = analyticsAccountLink_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsAccountLink_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent AnalyticsAccountLink scope where this property is in.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for analyticsAccountLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnalyticsAccountLinkBytes() { + java.lang.Object ref = analyticsAccountLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsAccountLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANALYTICS_PROPERTY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object analyticsProperty_ = ""; + /** + * + * + *
+   * Required. The Analytics property to change the ServiceLevel setting. This
+   * field is the name of the Google Analytics Admin API property resource.
+   *
+   * Format: analyticsadmin.googleapis.com/properties/{property_id}
+   * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsProperty. + */ + @java.lang.Override + public java.lang.String getAnalyticsProperty() { + java.lang.Object ref = analyticsProperty_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsProperty_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The Analytics property to change the ServiceLevel setting. This
+   * field is the name of the Google Analytics Admin API property resource.
+   *
+   * Format: analyticsadmin.googleapis.com/properties/{property_id}
+   * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsProperty. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAnalyticsPropertyBytes() { + java.lang.Object ref = analyticsProperty_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsProperty_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_LEVEL_FIELD_NUMBER = 3; + private int serviceLevel_ = 0; + /** + * + * + *
+   * Required. The service level to set for this property.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for serviceLevel. + */ + @java.lang.Override + public int getServiceLevelValue() { + return serviceLevel_; + } + /** + * + * + *
+   * Required. The service level to set for this property.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serviceLevel. + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel getServiceLevel() { + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel result = + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel.forNumber( + serviceLevel_); + return result == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsAccountLink_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, analyticsAccountLink_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsProperty_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, analyticsProperty_); + } + if (serviceLevel_ + != com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel + .ANALYTICS_SERVICE_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, serviceLevel_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsAccountLink_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, analyticsAccountLink_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(analyticsProperty_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, analyticsProperty_); + } + if (serviceLevel_ + != com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel + .ANALYTICS_SERVICE_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, serviceLevel_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest other = + (com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) obj; + + if (!getAnalyticsAccountLink().equals(other.getAnalyticsAccountLink())) return false; + if (!getAnalyticsProperty().equals(other.getAnalyticsProperty())) return false; + if (serviceLevel_ != other.serviceLevel_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANALYTICS_ACCOUNT_LINK_FIELD_NUMBER; + hash = (53 * hash) + getAnalyticsAccountLink().hashCode(); + hash = (37 * hash) + ANALYTICS_PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getAnalyticsProperty().hashCode(); + hash = (37 * hash) + SERVICE_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + serviceLevel_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for SetPropertyServiceLevel RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.class, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.Builder + .class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + analyticsAccountLink_ = ""; + analyticsProperty_ = ""; + serviceLevel_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelRequest_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest build() { + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest result = + new com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.analyticsAccountLink_ = analyticsAccountLink_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.analyticsProperty_ = analyticsProperty_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serviceLevel_ = serviceLevel_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + .getDefaultInstance()) return this; + if (!other.getAnalyticsAccountLink().isEmpty()) { + analyticsAccountLink_ = other.analyticsAccountLink_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAnalyticsProperty().isEmpty()) { + analyticsProperty_ = other.analyticsProperty_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.serviceLevel_ != 0) { + setServiceLevelValue(other.getServiceLevelValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + analyticsAccountLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + analyticsProperty_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + serviceLevel_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object analyticsAccountLink_ = ""; + /** + * + * + *
+     * Required. The parent AnalyticsAccountLink scope where this property is in.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The analyticsAccountLink. + */ + public java.lang.String getAnalyticsAccountLink() { + java.lang.Object ref = analyticsAccountLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsAccountLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent AnalyticsAccountLink scope where this property is in.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for analyticsAccountLink. + */ + public com.google.protobuf.ByteString getAnalyticsAccountLinkBytes() { + java.lang.Object ref = analyticsAccountLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsAccountLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent AnalyticsAccountLink scope where this property is in.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The analyticsAccountLink to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsAccountLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + analyticsAccountLink_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent AnalyticsAccountLink scope where this property is in.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAnalyticsAccountLink() { + analyticsAccountLink_ = getDefaultInstance().getAnalyticsAccountLink(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent AnalyticsAccountLink scope where this property is in.
+     * Format:
+     * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+     * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for analyticsAccountLink to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsAccountLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + analyticsAccountLink_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object analyticsProperty_ = ""; + /** + * + * + *
+     * Required. The Analytics property to change the ServiceLevel setting. This
+     * field is the name of the Google Analytics Admin API property resource.
+     *
+     * Format: analyticsadmin.googleapis.com/properties/{property_id}
+     * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsProperty. + */ + public java.lang.String getAnalyticsProperty() { + java.lang.Object ref = analyticsProperty_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + analyticsProperty_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The Analytics property to change the ServiceLevel setting. This
+     * field is the name of the Google Analytics Admin API property resource.
+     *
+     * Format: analyticsadmin.googleapis.com/properties/{property_id}
+     * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsProperty. + */ + public com.google.protobuf.ByteString getAnalyticsPropertyBytes() { + java.lang.Object ref = analyticsProperty_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + analyticsProperty_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The Analytics property to change the ServiceLevel setting. This
+     * field is the name of the Google Analytics Admin API property resource.
+     *
+     * Format: analyticsadmin.googleapis.com/properties/{property_id}
+     * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The analyticsProperty to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsProperty(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + analyticsProperty_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Analytics property to change the ServiceLevel setting. This
+     * field is the name of the Google Analytics Admin API property resource.
+     *
+     * Format: analyticsadmin.googleapis.com/properties/{property_id}
+     * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAnalyticsProperty() { + analyticsProperty_ = getDefaultInstance().getAnalyticsProperty(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The Analytics property to change the ServiceLevel setting. This
+     * field is the name of the Google Analytics Admin API property resource.
+     *
+     * Format: analyticsadmin.googleapis.com/properties/{property_id}
+     * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for analyticsProperty to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsPropertyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + analyticsProperty_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int serviceLevel_ = 0; + /** + * + * + *
+     * Required. The service level to set for this property.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for serviceLevel. + */ + @java.lang.Override + public int getServiceLevelValue() { + return serviceLevel_; + } + /** + * + * + *
+     * Required. The service level to set for this property.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for serviceLevel to set. + * @return This builder for chaining. + */ + public Builder setServiceLevelValue(int value) { + serviceLevel_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service level to set for this property.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serviceLevel. + */ + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel getServiceLevel() { + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel result = + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel.forNumber( + serviceLevel_); + return result == null + ? com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The service level to set for this property.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The serviceLevel to set. + * @return This builder for chaining. + */ + public Builder setServiceLevel( + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + serviceLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service level to set for this property.
+     * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearServiceLevel() { + bitField0_ = (bitField0_ & ~0x00000004); + serviceLevel_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + private static final com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetPropertyServiceLevelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequestOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequestOrBuilder.java new file mode 100644 index 000000000000..d892514c2672 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface SetPropertyServiceLevelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent AnalyticsAccountLink scope where this property is in.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The analyticsAccountLink. + */ + java.lang.String getAnalyticsAccountLink(); + /** + * + * + *
+   * Required. The parent AnalyticsAccountLink scope where this property is in.
+   * Format:
+   * organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id}
+   * 
+ * + * string analytics_account_link = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for analyticsAccountLink. + */ + com.google.protobuf.ByteString getAnalyticsAccountLinkBytes(); + + /** + * + * + *
+   * Required. The Analytics property to change the ServiceLevel setting. This
+   * field is the name of the Google Analytics Admin API property resource.
+   *
+   * Format: analyticsadmin.googleapis.com/properties/{property_id}
+   * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The analyticsProperty. + */ + java.lang.String getAnalyticsProperty(); + /** + * + * + *
+   * Required. The Analytics property to change the ServiceLevel setting. This
+   * field is the name of the Google Analytics Admin API property resource.
+   *
+   * Format: analyticsadmin.googleapis.com/properties/{property_id}
+   * 
+ * + * + * string analytics_property = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for analyticsProperty. + */ + com.google.protobuf.ByteString getAnalyticsPropertyBytes(); + + /** + * + * + *
+   * Required. The service level to set for this property.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for serviceLevel. + */ + int getServiceLevelValue(); + /** + * + * + *
+   * Required. The service level to set for this property.
+   * 
+ * + * + * .google.marketingplatform.admin.v1alpha.AnalyticsServiceLevel service_level = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The serviceLevel. + */ + com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel getServiceLevel(); +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponse.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponse.java new file mode 100644 index 000000000000..3837c80f8ee6 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponse.java @@ -0,0 +1,459 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +/** + * + * + *
+ * Response message for SetPropertyServiceLevel RPC.
+ * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse} + */ +public final class SetPropertyServiceLevelResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) + SetPropertyServiceLevelResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SetPropertyServiceLevelResponse.newBuilder() to construct. + private SetPropertyServiceLevelResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SetPropertyServiceLevelResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SetPropertyServiceLevelResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.class, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.Builder + .class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse)) { + return super.equals(obj); + } + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse other = + (com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for SetPropertyServiceLevel RPC.
+   * 
+ * + * Protobuf type {@code google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.class, + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.Builder + .class); + } + + // Construct using + // com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminProto + .internal_static_google_marketingplatform_admin_v1alpha_SetPropertyServiceLevelResponse_descriptor; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + getDefaultInstanceForType() { + return com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse build() { + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + buildPartial() { + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse result = + new com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) { + return mergeFrom( + (com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse other) { + if (other + == com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) + } + + // @@protoc_insertion_point(class_scope:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) + private static final com.google.ads.marketingplatform.admin.v1alpha + .SetPropertyServiceLevelResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse(); + } + + public static com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SetPropertyServiceLevelResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponseOrBuilder.java b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponseOrBuilder.java new file mode 100644 index 000000000000..6407f08c4ee6 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/java/com/google/ads/marketingplatform/admin/v1alpha/SetPropertyServiceLevelResponseOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2024 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.ads.marketingplatform.admin.v1alpha; + +public interface SetPropertyServiceLevelResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto new file mode 100644 index 000000000000..11c5497a573b --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/marketingplatform_admin.proto @@ -0,0 +1,216 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.marketingplatform.admin.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/marketingplatform/admin/v1alpha/resources.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Ads.MarketingPlatform.Admin.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/marketingplatform/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "MarketingplatformAdminProto"; +option java_package = "com.google.ads.marketingplatform.admin.v1alpha"; +option php_namespace = "Google\\Ads\\MarketingPlatform\\Admin\\V1alpha"; +option ruby_package = "Google::Ads::MarketingPlatform::Admin::V1alpha"; +option (google.api.resource_definition) = { + type: "analyticsadmin.googleapis.com/Property" + pattern: "properties/{property}" +}; + +// Service Interface for the Google Marketing Platform Admin API. +service MarketingplatformAdminService { + option (google.api.default_host) = "marketingplatformadmin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/marketingplatformadmin.analytics.read," + "https://www.googleapis.com/auth/marketingplatformadmin.analytics.update"; + + // Lookup for a single organization. + rpc GetOrganization(GetOrganizationRequest) returns (Organization) { + option (google.api.http) = { + get: "/v1alpha/{name=organizations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the Google Analytics accounts link to the specified Google Marketing + // Platform organization. + rpc ListAnalyticsAccountLinks(ListAnalyticsAccountLinksRequest) + returns (ListAnalyticsAccountLinksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=organizations/*}/analyticsAccountLinks" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates the link between the Analytics account and the Google Marketing + // Platform organization. + // + // User needs to be an org user, and admin on the Analytics account to create + // the link. If the account is already linked to an organization, user needs + // to unlink the account from the current organization, then try link again. + rpc CreateAnalyticsAccountLink(CreateAnalyticsAccountLinkRequest) + returns (AnalyticsAccountLink) { + option (google.api.http) = { + post: "/v1alpha/{parent=organizations/*}/analyticsAccountLinks" + body: "analytics_account_link" + }; + option (google.api.method_signature) = "parent,analytics_account_link"; + } + + // Deletes the AnalyticsAccountLink, which detaches the Analytics account from + // the Google Marketing Platform organization. + // + // User needs to be an org user, and admin on the Analytics account in order + // to delete the link. + rpc DeleteAnalyticsAccountLink(DeleteAnalyticsAccountLinkRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=organizations/*/analyticsAccountLinks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the service level for an Analytics property. + rpc SetPropertyServiceLevel(SetPropertyServiceLevelRequest) + returns (SetPropertyServiceLevelResponse) { + option (google.api.http) = { + post: "/v1alpha/{analytics_account_link=organizations/*/analyticsAccountLinks/*}:setPropertyServiceLevel" + body: "*" + }; + option (google.api.method_signature) = "analytics_account_link"; + } +} + +// Various levels of service for Google Analytics. +enum AnalyticsServiceLevel { + // Service level unspecified. + ANALYTICS_SERVICE_LEVEL_UNSPECIFIED = 0; + + // The standard version of Google Analytics. + ANALYTICS_SERVICE_LEVEL_STANDARD = 1; + + // The premium version of Google Analytics. + ANALYTICS_SERVICE_LEVEL_360 = 2; +} + +// Request message for GetOrganization RPC. +message GetOrganizationRequest { + // Required. The name of the Organization to retrieve. + // Format: organizations/{org_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "marketingplatformadmin.googleapis.com/Organization" + } + ]; +} + +// Request message for ListAnalyticsAccountLinks RPC. +message ListAnalyticsAccountLinksRequest { + // Required. The parent organization, which owns this collection of Analytics + // account links. Format: organizations/{org_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "marketingplatformadmin.googleapis.com/AnalyticsAccountLink" + } + ]; + + // Optional. The maximum number of Analytics account links to return in one + // call. The service may return fewer than this value. + // + // If unspecified, at most 50 Analytics account links will be returned. The + // maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous ListAnalyticsAccountLinks + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListAnalyticsAccountLinks` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListAnalyticsAccountLinks RPC. +message ListAnalyticsAccountLinksResponse { + // Analytics account links in this organization. + repeated AnalyticsAccountLink analytics_account_links = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for CreateAnalyticsAccountLink RPC. +message CreateAnalyticsAccountLinkRequest { + // Required. The parent resource where this Analytics account link will be + // created. Format: organizations/{org_id} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "marketingplatformadmin.googleapis.com/AnalyticsAccountLink" + } + ]; + + // Required. The Analytics account link to create. + AnalyticsAccountLink analytics_account_link = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteAnalyticsAccountLink RPC. +message DeleteAnalyticsAccountLinkRequest { + // Required. The name of the Analytics account link to delete. + // Format: + // organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "marketingplatformadmin.googleapis.com/AnalyticsAccountLink" + } + ]; +} + +// Request message for SetPropertyServiceLevel RPC. +message SetPropertyServiceLevelRequest { + // Required. The parent AnalyticsAccountLink scope where this property is in. + // Format: + // organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + string analytics_account_link = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Analytics property to change the ServiceLevel setting. This + // field is the name of the Google Analytics Admin API property resource. + // + // Format: analyticsadmin.googleapis.com/properties/{property_id} + string analytics_property = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Property" + } + ]; + + // Required. The service level to set for this property. + AnalyticsServiceLevel service_level = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for SetPropertyServiceLevel RPC. +message SetPropertyServiceLevelResponse {} diff --git a/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/resources.proto b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/resources.proto new file mode 100644 index 000000000000..78b24833d9b3 --- /dev/null +++ b/java-marketingplatformadminapi/proto-admin-v1alpha/src/main/proto/google/marketingplatform/admin/v1alpha/resources.proto @@ -0,0 +1,103 @@ +// Copyright 2024 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 +// +// http://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. + +syntax = "proto3"; + +package google.marketingplatform.admin.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Ads.MarketingPlatform.Admin.V1Alpha"; +option go_package = "google.golang.org/genproto/googleapis/marketingplatform/admin/v1alpha;admin"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.ads.marketingplatform.admin.v1alpha"; +option php_namespace = "Google\\Ads\\MarketingPlatform\\Admin\\V1alpha"; +option ruby_package = "Google::Ads::MarketingPlatform::Admin::V1alpha"; +option (google.api.resource_definition) = { + type: "analyticsadmin.googleapis.com/Account" + pattern: "accounts/{account}" +}; + +// The verification state of the link between a product account and a GMP +// organization. +enum LinkVerificationState { + // The link state is unknown. + LINK_VERIFICATION_STATE_UNSPECIFIED = 0; + + // The link is established. + LINK_VERIFICATION_STATE_VERIFIED = 1; + + // The link is requested, but hasn't been approved by the product account + // admin. + LINK_VERIFICATION_STATE_NOT_VERIFIED = 2; +} + +// A resource message representing a Google Marketing Platform organization. +message Organization { + option (google.api.resource) = { + type: "marketingplatformadmin.googleapis.com/Organization" + pattern: "organizations/{organization}" + plural: "organizations" + singular: "organization" + }; + + // Identifier. The resource name of the GMP organization. + // Format: organizations/{org_id} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The human-readable name for the organization. + string display_name = 2; +} + +// A resource message representing the link between a Google Analytics account +// and a Google Marketing Platform organization. +message AnalyticsAccountLink { + option (google.api.resource) = { + type: "marketingplatformadmin.googleapis.com/AnalyticsAccountLink" + pattern: "organizations/{organization}/analyticsAccountLinks/{analytics_account_link}" + plural: "analyticsAccountLinks" + singular: "analyticsAccountLink" + }; + + // Identifier. Resource name of this AnalyticsAccountLink. Note the resource + // ID is the same as the ID of the Analtyics account. + // + // Format: + // organizations/{org_id}/analyticsAccountLinks/{analytics_account_link_id} + // Example: "organizations/xyz/analyticsAccountLinks/1234" + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. Immutable. The resource name of the AnalyticsAdmin API account. + // The account ID will be used as the ID of this AnalyticsAccountLink + // resource, which will become the final component of the resource name. + // + // Format: analyticsadmin.googleapis.com/accounts/{account_id} + string analytics_account = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "analyticsadmin.googleapis.com/Account" + } + ]; + + // Output only. The human-readable name for the Analytics account. + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The verification state of the link between the Analytics + // account and the parent organization. + LinkVerificationState link_verification_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..bf20c4958573 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetCredentialsProvider_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceSettings; +import com.google.ads.marketingplatform.admin.v1alpha.myCredentials; +import com.google.api.gax.core.FixedCredentialsProvider; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings = + MarketingplatformAdminServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetCredentialsProvider_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider1.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..1521436027d7 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetCredentialsProvider1_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings = + MarketingplatformAdminServiceSettings.newHttpJsonBuilder().build(); + MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetCredentialsProvider1_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetEndpoint.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..008103070d6d --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetEndpoint_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceSettings; +import com.google.ads.marketingplatform.admin.v1alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings = + MarketingplatformAdminServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create(marketingplatformAdminServiceSettings); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_Create_SetEndpoint_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/AsyncCreateAnalyticsAccountLink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/AsyncCreateAnalyticsAccountLink.java new file mode 100644 index 000000000000..5d10017f747b --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/AsyncCreateAnalyticsAccountLink.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_async] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; +import com.google.api.core.ApiFuture; + +public class AsyncCreateAnalyticsAccountLink { + + public static void main(String[] args) throws Exception { + asyncCreateAnalyticsAccountLink(); + } + + public static void asyncCreateAnalyticsAccountLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + CreateAnalyticsAccountLinkRequest request = + CreateAnalyticsAccountLinkRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]").toString()) + .setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build()) + .build(); + ApiFuture future = + marketingplatformAdminServiceClient + .createAnalyticsAccountLinkCallable() + .futureCall(request); + // Do something. + AnalyticsAccountLink response = future.get(); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLink.java new file mode 100644 index 000000000000..502ca021b026 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.CreateAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncCreateAnalyticsAccountLink { + + public static void main(String[] args) throws Exception { + syncCreateAnalyticsAccountLink(); + } + + public static void syncCreateAnalyticsAccountLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + CreateAnalyticsAccountLinkRequest request = + CreateAnalyticsAccountLinkRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]").toString()) + .setAnalyticsAccountLink(AnalyticsAccountLink.newBuilder().build()) + .build(); + AnalyticsAccountLink response = + marketingplatformAdminServiceClient.createAnalyticsAccountLink(request); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink.java new file mode 100644 index 000000000000..cf21dc458111 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_OrganizationnameAnalyticsaccountlink_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink { + + public static void main(String[] args) throws Exception { + syncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink(); + } + + public static void syncCreateAnalyticsAccountLinkOrganizationnameAnalyticsaccountlink() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + AnalyticsAccountLink response = + marketingplatformAdminServiceClient.createAnalyticsAccountLink( + parent, analyticsAccountLink); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_OrganizationnameAnalyticsaccountlink_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkStringAnalyticsaccountlink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkStringAnalyticsaccountlink.java new file mode 100644 index 000000000000..8a5fa352ca87 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/createanalyticsaccountlink/SyncCreateAnalyticsAccountLinkStringAnalyticsaccountlink.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_StringAnalyticsaccountlink_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncCreateAnalyticsAccountLinkStringAnalyticsaccountlink { + + public static void main(String[] args) throws Exception { + syncCreateAnalyticsAccountLinkStringAnalyticsaccountlink(); + } + + public static void syncCreateAnalyticsAccountLinkStringAnalyticsaccountlink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]").toString(); + AnalyticsAccountLink analyticsAccountLink = AnalyticsAccountLink.newBuilder().build(); + AnalyticsAccountLink response = + marketingplatformAdminServiceClient.createAnalyticsAccountLink( + parent, analyticsAccountLink); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_CreateAnalyticsAccountLink_StringAnalyticsaccountlink_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/AsyncDeleteAnalyticsAccountLink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/AsyncDeleteAnalyticsAccountLink.java new file mode 100644 index 000000000000..9b639605a580 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/AsyncDeleteAnalyticsAccountLink.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_async] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkName; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; + +public class AsyncDeleteAnalyticsAccountLink { + + public static void main(String[] args) throws Exception { + asyncDeleteAnalyticsAccountLink(); + } + + public static void asyncDeleteAnalyticsAccountLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + DeleteAnalyticsAccountLinkRequest request = + DeleteAnalyticsAccountLinkRequest.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .build(); + ApiFuture future = + marketingplatformAdminServiceClient + .deleteAnalyticsAccountLinkCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLink.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLink.java new file mode 100644 index 000000000000..a9240d0d52e8 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkName; +import com.google.ads.marketingplatform.admin.v1alpha.DeleteAnalyticsAccountLinkRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAnalyticsAccountLink { + + public static void main(String[] args) throws Exception { + syncDeleteAnalyticsAccountLink(); + } + + public static void syncDeleteAnalyticsAccountLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + DeleteAnalyticsAccountLinkRequest request = + DeleteAnalyticsAccountLinkRequest.newBuilder() + .setName( + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]") + .toString()) + .build(); + marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(request); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname.java new file mode 100644 index 000000000000..43e4ca278c6a --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_Analyticsaccountlinkname_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkName; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname { + + public static void main(String[] args) throws Exception { + syncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname(); + } + + public static void syncDeleteAnalyticsAccountLinkAnalyticsaccountlinkname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + AnalyticsAccountLinkName name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]"); + marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_Analyticsaccountlinkname_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkString.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkString.java new file mode 100644 index 000000000000..a3ce08c80bbb --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/deleteanalyticsaccountlink/SyncDeleteAnalyticsAccountLinkString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_String_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLinkName; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteAnalyticsAccountLinkString { + + public static void main(String[] args) throws Exception { + syncDeleteAnalyticsAccountLinkString(); + } + + public static void syncDeleteAnalyticsAccountLinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + String name = + AnalyticsAccountLinkName.of("[ORGANIZATION]", "[ANALYTICS_ACCOUNT_LINK]").toString(); + marketingplatformAdminServiceClient.deleteAnalyticsAccountLink(name); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_DeleteAnalyticsAccountLink_String_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/AsyncGetOrganization.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/AsyncGetOrganization.java new file mode 100644 index 000000000000..2f133748b259 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/AsyncGetOrganization.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_async] +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; +import com.google.api.core.ApiFuture; + +public class AsyncGetOrganization { + + public static void main(String[] args) throws Exception { + asyncGetOrganization(); + } + + public static void asyncGetOrganization() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + GetOrganizationRequest request = + GetOrganizationRequest.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .build(); + ApiFuture future = + marketingplatformAdminServiceClient.getOrganizationCallable().futureCall(request); + // Do something. + Organization response = future.get(); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganization.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganization.java new file mode 100644 index 000000000000..ea93f9f49437 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganization.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_sync] +import com.google.ads.marketingplatform.admin.v1alpha.GetOrganizationRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncGetOrganization { + + public static void main(String[] args) throws Exception { + syncGetOrganization(); + } + + public static void syncGetOrganization() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + GetOrganizationRequest request = + GetOrganizationRequest.newBuilder() + .setName(OrganizationName.of("[ORGANIZATION]").toString()) + .build(); + Organization response = marketingplatformAdminServiceClient.getOrganization(request); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationOrganizationname.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationOrganizationname.java new file mode 100644 index 000000000000..ab5baa67f1c8 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationOrganizationname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_Organizationname_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncGetOrganizationOrganizationname { + + public static void main(String[] args) throws Exception { + syncGetOrganizationOrganizationname(); + } + + public static void syncGetOrganizationOrganizationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + OrganizationName name = OrganizationName.of("[ORGANIZATION]"); + Organization response = marketingplatformAdminServiceClient.getOrganization(name); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_Organizationname_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationString.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationString.java new file mode 100644 index 000000000000..f798c09faf72 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/getorganization/SyncGetOrganizationString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_String_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.Organization; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncGetOrganizationString { + + public static void main(String[] args) throws Exception { + syncGetOrganizationString(); + } + + public static void syncGetOrganizationString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + String name = OrganizationName.of("[ORGANIZATION]").toString(); + Organization response = marketingplatformAdminServiceClient.getOrganization(name); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_GetOrganization_String_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinks.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinks.java new file mode 100644 index 000000000000..fce5d785f8f1 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinks.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_async] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; +import com.google.api.core.ApiFuture; + +public class AsyncListAnalyticsAccountLinks { + + public static void main(String[] args) throws Exception { + asyncListAnalyticsAccountLinks(); + } + + public static void asyncListAnalyticsAccountLinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + ListAnalyticsAccountLinksRequest request = + ListAnalyticsAccountLinksRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + marketingplatformAdminServiceClient + .listAnalyticsAccountLinksPagedCallable() + .futureCall(request); + // Do something. + for (AnalyticsAccountLink element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinksPaged.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinksPaged.java new file mode 100644 index 000000000000..430aa24bd4c7 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/AsyncListAnalyticsAccountLinksPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_Paged_async] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksResponse; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; +import com.google.common.base.Strings; + +public class AsyncListAnalyticsAccountLinksPaged { + + public static void main(String[] args) throws Exception { + asyncListAnalyticsAccountLinksPaged(); + } + + public static void asyncListAnalyticsAccountLinksPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + ListAnalyticsAccountLinksRequest request = + ListAnalyticsAccountLinksRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAnalyticsAccountLinksResponse response = + marketingplatformAdminServiceClient.listAnalyticsAccountLinksCallable().call(request); + for (AnalyticsAccountLink element : response.getAnalyticsAccountLinksList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_Paged_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinks.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinks.java new file mode 100644 index 000000000000..2e74eb1ae56f --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinks.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.ListAnalyticsAccountLinksRequest; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncListAnalyticsAccountLinks { + + public static void main(String[] args) throws Exception { + syncListAnalyticsAccountLinks(); + } + + public static void syncListAnalyticsAccountLinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + ListAnalyticsAccountLinksRequest request = + ListAnalyticsAccountLinksRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (AnalyticsAccountLink element : + marketingplatformAdminServiceClient.listAnalyticsAccountLinks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksOrganizationname.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksOrganizationname.java new file mode 100644 index 000000000000..5a194c938f87 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksOrganizationname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_Organizationname_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncListAnalyticsAccountLinksOrganizationname { + + public static void main(String[] args) throws Exception { + syncListAnalyticsAccountLinksOrganizationname(); + } + + public static void syncListAnalyticsAccountLinksOrganizationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (AnalyticsAccountLink element : + marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_Organizationname_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksString.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksString.java new file mode 100644 index 000000000000..29e07b4db3dd --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/listanalyticsaccountlinks/SyncListAnalyticsAccountLinksString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_String_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsAccountLink; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.OrganizationName; + +public class SyncListAnalyticsAccountLinksString { + + public static void main(String[] args) throws Exception { + syncListAnalyticsAccountLinksString(); + } + + public static void syncListAnalyticsAccountLinksString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]").toString(); + for (AnalyticsAccountLink element : + marketingplatformAdminServiceClient.listAnalyticsAccountLinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_ListAnalyticsAccountLinks_String_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/AsyncSetPropertyServiceLevel.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/AsyncSetPropertyServiceLevel.java new file mode 100644 index 000000000000..9f6bcbbc980a --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/AsyncSetPropertyServiceLevel.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_async] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.PropertyName; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; +import com.google.api.core.ApiFuture; + +public class AsyncSetPropertyServiceLevel { + + public static void main(String[] args) throws Exception { + asyncSetPropertyServiceLevel(); + } + + public static void asyncSetPropertyServiceLevel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + SetPropertyServiceLevelRequest request = + SetPropertyServiceLevelRequest.newBuilder() + .setAnalyticsAccountLink("analyticsAccountLink-397570975") + .setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString()) + .setServiceLevel(AnalyticsServiceLevel.forNumber(0)) + .build(); + ApiFuture future = + marketingplatformAdminServiceClient.setPropertyServiceLevelCallable().futureCall(request); + // Do something. + SetPropertyServiceLevelResponse response = future.get(); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_async] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevel.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevel.java new file mode 100644 index 000000000000..254bff4c4cf5 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevel.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_sync] +import com.google.ads.marketingplatform.admin.v1alpha.AnalyticsServiceLevel; +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.PropertyName; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelRequest; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; + +public class SyncSetPropertyServiceLevel { + + public static void main(String[] args) throws Exception { + syncSetPropertyServiceLevel(); + } + + public static void syncSetPropertyServiceLevel() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + SetPropertyServiceLevelRequest request = + SetPropertyServiceLevelRequest.newBuilder() + .setAnalyticsAccountLink("analyticsAccountLink-397570975") + .setAnalyticsProperty(PropertyName.of("[PROPERTY]").toString()) + .setServiceLevel(AnalyticsServiceLevel.forNumber(0)) + .build(); + SetPropertyServiceLevelResponse response = + marketingplatformAdminServiceClient.setPropertyServiceLevel(request); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevelString.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevelString.java new file mode 100644 index 000000000000..a3ff0203e70b --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservice/setpropertyservicelevel/SyncSetPropertyServiceLevelString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_String_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceClient; +import com.google.ads.marketingplatform.admin.v1alpha.SetPropertyServiceLevelResponse; + +public class SyncSetPropertyServiceLevelString { + + public static void main(String[] args) throws Exception { + syncSetPropertyServiceLevelString(); + } + + public static void syncSetPropertyServiceLevelString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MarketingplatformAdminServiceClient marketingplatformAdminServiceClient = + MarketingplatformAdminServiceClient.create()) { + String analyticsAccountLink = "analyticsAccountLink-397570975"; + SetPropertyServiceLevelResponse response = + marketingplatformAdminServiceClient.setPropertyServiceLevel(analyticsAccountLink); + } + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminService_SetPropertyServiceLevel_String_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservicesettings/getorganization/SyncGetOrganization.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservicesettings/getorganization/SyncGetOrganization.java new file mode 100644 index 000000000000..72451b464e2a --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/marketingplatformadminservicesettings/getorganization/SyncGetOrganization.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminServiceSettings_GetOrganization_sync] +import com.google.ads.marketingplatform.admin.v1alpha.MarketingplatformAdminServiceSettings; +import java.time.Duration; + +public class SyncGetOrganization { + + public static void main(String[] args) throws Exception { + syncGetOrganization(); + } + + public static void syncGetOrganization() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MarketingplatformAdminServiceSettings.Builder marketingplatformAdminServiceSettingsBuilder = + MarketingplatformAdminServiceSettings.newBuilder(); + marketingplatformAdminServiceSettingsBuilder + .getOrganizationSettings() + .setRetrySettings( + marketingplatformAdminServiceSettingsBuilder + .getOrganizationSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MarketingplatformAdminServiceSettings marketingplatformAdminServiceSettings = + marketingplatformAdminServiceSettingsBuilder.build(); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminServiceSettings_GetOrganization_sync] diff --git a/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/stub/marketingplatformadminservicestubsettings/getorganization/SyncGetOrganization.java b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/stub/marketingplatformadminservicestubsettings/getorganization/SyncGetOrganization.java new file mode 100644 index 000000000000..752f177badb1 --- /dev/null +++ b/java-marketingplatformadminapi/samples/snippets/generated/com/google/ads/marketingplatform/admin/v1alpha/stub/marketingplatformadminservicestubsettings/getorganization/SyncGetOrganization.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 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.ads.marketingplatform.admin.v1alpha.stub.samples; + +// [START marketingplatformadmin_v1alpha_generated_MarketingplatformAdminServiceStubSettings_GetOrganization_sync] +import com.google.ads.marketingplatform.admin.v1alpha.stub.MarketingplatformAdminServiceStubSettings; +import java.time.Duration; + +public class SyncGetOrganization { + + public static void main(String[] args) throws Exception { + syncGetOrganization(); + } + + public static void syncGetOrganization() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MarketingplatformAdminServiceStubSettings.Builder marketingplatformAdminServiceSettingsBuilder = + MarketingplatformAdminServiceStubSettings.newBuilder(); + marketingplatformAdminServiceSettingsBuilder + .getOrganizationSettings() + .setRetrySettings( + marketingplatformAdminServiceSettingsBuilder + .getOrganizationSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MarketingplatformAdminServiceStubSettings marketingplatformAdminServiceSettings = + marketingplatformAdminServiceSettingsBuilder.build(); + } +} +// [END marketingplatformadmin_v1alpha_generated_MarketingplatformAdminServiceStubSettings_GetOrganization_sync] diff --git a/pom.xml b/pom.xml index 6f04a3efb397..a88293f6e312 100644 --- a/pom.xml +++ b/pom.xml @@ -126,6 +126,7 @@ java-maps-routeoptimization java-maps-routing java-maps-solar + java-marketingplatformadminapi java-mediatranslation java-meet java-memcache diff --git a/versions.txt b/versions.txt index 19a9cad1fe55..44fcc9454233 100644 --- a/versions.txt +++ b/versions.txt @@ -810,5 +810,8 @@ grpc-google-cloud-connectgateway-v1:0.3.0:0.4.0-SNAPSHOT google-maps-area-insights:0.2.0:0.3.0-SNAPSHOT proto-google-maps-area-insights-v1:0.2.0:0.3.0-SNAPSHOT grpc-google-maps-area-insights-v1:0.2.0:0.3.0-SNAPSHOT +admin:0.0.0:0.0.1-SNAPSHOT +proto-admin-v1alpha:0.0.0:0.0.1-SNAPSHOT +grpc-admin-v1alpha:0.0.0:0.0.1-SNAPSHOT google-cloud-oracledatabase:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-oracledatabase-v1:0.0.0:0.0.1-SNAPSHOT