diff --git a/generation_config.yaml b/generation_config.yaml index 1f7b731c04b6..01f80d466000 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1736,6 +1736,21 @@ libraries: - proto_path: google/shopping/css/v1 # duplicated api_shortname +- api_shortname: shopping-merchant-conversions + name_pretty: Merchant Conversions API + product_documentation: https://developers.google.com/merchant/api + api_description: Programmatically manage your Merchant Center accounts. + client_documentation: + https://cloud.google.com/java/docs/reference/google-shopping-merchant-conversions/latest/overview + release_level: preview + distribution_name: com.google.shopping:google-shopping-merchant-conversions + api_id: shopping-merchant-conversions.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.shopping + cloud_api: false + GAPICs: + - proto_path: google/shopping/merchant/conversions/v1beta + requires_billing: true - api_shortname: merchantapi name_pretty: Merchant API product_documentation: https://developers.google.com/merchant/api diff --git a/java-shopping-merchant-conversions/.OwlBot-hermetic.yaml b/java-shopping-merchant-conversions/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..d39eaa52b245 --- /dev/null +++ b/java-shopping-merchant-conversions/.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-shopping-merchant-conversions/grpc-google-.*/src" +- "/java-shopping-merchant-conversions/proto-google-.*/src" +- "/java-shopping-merchant-conversions/google-.*/src" +- "/java-shopping-merchant-conversions/samples/snippets/generated" + +deep-preserve-regex: +- "/java-shopping-merchant-conversions/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/shopping/merchant/conversions/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-conversions/$1/proto-google-shopping-merchant-conversions-$1/src" +- source: "/google/shopping/merchant/conversions/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-conversions/$1/grpc-google-shopping-merchant-conversions-$1/src" +- source: "/google/shopping/merchant/conversions/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-conversions/$1/google-shopping-merchant-conversions/src" +- source: "/google/shopping/merchant/conversions/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-shopping-merchant-conversions/$1/samples/snippets/generated" + +api-name: shopping-merchant-conversions \ No newline at end of file diff --git a/java-shopping-merchant-conversions/.repo-metadata.json b/java-shopping-merchant-conversions/.repo-metadata.json new file mode 100644 index 000000000000..4723a3e9dbb2 --- /dev/null +++ b/java-shopping-merchant-conversions/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "shopping-merchant-conversions", + "name_pretty": "Merchant Conversions API", + "product_documentation": "https://developers.google.com/merchant/api", + "api_description": "Programmatically manage your Merchant Center accounts.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-shopping-merchant-conversions/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-shopping-merchant-conversions", + "distribution_name": "com.google.shopping:google-shopping-merchant-conversions", + "api_id": "shopping-merchant-conversions.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-shopping-merchant-conversions/README.md b/java-shopping-merchant-conversions/README.md new file mode 100644 index 000000000000..21e59d1fc2a9 --- /dev/null +++ b/java-shopping-merchant-conversions/README.md @@ -0,0 +1,225 @@ +# Google Merchant Conversions API Client for Java + +Java idiomatic client for [Merchant Conversions 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.37.0 + pom + import + + + + + + + com.google.shopping + google-shopping-merchant-conversions + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.shopping + google-shopping-merchant-conversions + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.shopping:google-shopping-merchant-conversions:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.shopping" % "google-shopping-merchant-conversions" % "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 Merchant Conversions API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Merchant Conversions API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Merchant Conversions API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Merchant Conversions 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 `google-shopping-merchant-conversions` library. See the [Quickstart](#quickstart) section +to add `google-shopping-merchant-conversions` as a dependency in your code. + +## About Merchant Conversions API + + +[Merchant Conversions API][product-docs] Programmatically manage your Merchant Center accounts. + +See the [Merchant Conversions API client library docs][javadocs] to learn how to +use this Merchant Conversions API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Merchant Conversions 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/merchant/api +[javadocs]: https://cloud.google.com/java/docs/reference/google-shopping-merchant-conversions/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.shopping/google-shopping-merchant-conversions.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.shopping/google-shopping-merchant-conversions/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=shopping-merchant-conversions.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-shopping-merchant-conversions/google-shopping-merchant-conversions-bom/pom.xml b/java-shopping-merchant-conversions/google-shopping-merchant-conversions-bom/pom.xml new file mode 100644 index 000000000000..824e6a337b6e --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-conversions-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.36.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Merchant Conversions API BOM + + BOM for Merchant Conversions API + + + + true + + + + + + com.google.shopping + google-shopping-merchant-conversions + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/pom.xml b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/pom.xml new file mode 100644 index 000000000000..e82abcf6cc20 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-conversions + 0.0.1-SNAPSHOT + jar + Google Merchant Conversions API + Merchant Conversions API Programmatically manage your Merchant Center accounts. + + com.google.shopping + google-shopping-merchant-conversions-parent + 0.0.1-SNAPSHOT + + + google-shopping-merchant-conversions + + + + 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.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1beta + 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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClient.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClient.java new file mode 100644 index 000000000000..ebf2c0ea2061 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClient.java @@ -0,0 +1,1125 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +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 com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1beta.stub.ConversionSourcesServiceStub; +import com.google.shopping.merchant.conversions.v1beta.stub.ConversionSourcesServiceStubSettings; +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 for managing conversion sources for a merchant account. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+ *     ConversionSourcesServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   ConversionSource conversionSource = ConversionSource.newBuilder().build();
+ *   ConversionSource response =
+ *       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
+ * }
+ * }
+ * + *

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

CreateConversionSource

Creates a new conversion source.

+ *

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

+ *
    + *
  • createConversionSource(CreateConversionSourceRequest request) + *

+ *

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

+ *
    + *
  • createConversionSource(AccountName parent, ConversionSource conversionSource) + *

  • createConversionSource(String parent, ConversionSource conversionSource) + *

+ *

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

+ *
    + *
  • createConversionSourceCallable() + *

+ *

UpdateConversionSource

Updates information of an existing conversion source. Available only for Merchant Center Destination conversion sources.

+ *

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

+ *
    + *
  • updateConversionSource(UpdateConversionSourceRequest request) + *

+ *

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

+ *
    + *
  • updateConversionSource(ConversionSource conversionSource, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updateConversionSourceCallable() + *

+ *

DeleteConversionSource

Archives an existing conversion source. If the conversion source is a Merchant Center Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics Link, it will be deleted immediately and can be restored by creating a new one.

+ *

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

+ *
    + *
  • deleteConversionSource(DeleteConversionSourceRequest request) + *

+ *

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

+ *
    + *
  • deleteConversionSource(ConversionSourceName name) + *

  • deleteConversionSource(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.

+ *
    + *
  • deleteConversionSourceCallable() + *

+ *

UndeleteConversionSource

Re-enables an archived conversion source. Only Available for Merchant Center Destination conversion sources.

+ *

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

+ *
    + *
  • undeleteConversionSource(UndeleteConversionSourceRequest request) + *

+ *

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

+ *
    + *
  • undeleteConversionSourceCallable() + *

+ *

GetConversionSource

Fetches a conversion source.

+ *

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

+ *
    + *
  • getConversionSource(GetConversionSourceRequest request) + *

+ *

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

+ *
    + *
  • getConversionSource(ConversionSourceName name) + *

  • getConversionSource(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.

+ *
    + *
  • getConversionSourceCallable() + *

+ *

ListConversionSources

Retrieves the list of conversion sources the caller has access to.

+ *

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

+ *
    + *
  • listConversionSources(ListConversionSourcesRequest request) + *

+ *

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

+ *
    + *
  • listConversionSources(AccountName parent) + *

  • listConversionSources(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.

+ *
    + *
  • listConversionSourcesPagedCallable() + *

  • listConversionSourcesCallable() + *

+ *
+ * + *

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 + * ConversionSourcesServiceSettings 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
+ * ConversionSourcesServiceSettings conversionSourcesServiceSettings =
+ *     ConversionSourcesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConversionSourcesServiceClient conversionSourcesServiceClient =
+ *     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
+ * }
+ * + *

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
+ * ConversionSourcesServiceSettings conversionSourcesServiceSettings =
+ *     ConversionSourcesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConversionSourcesServiceClient conversionSourcesServiceClient =
+ *     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
+ * }
+ * + *

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
+ * ConversionSourcesServiceSettings conversionSourcesServiceSettings =
+ *     ConversionSourcesServiceSettings.newHttpJsonBuilder().build();
+ * ConversionSourcesServiceClient conversionSourcesServiceClient =
+ *     ConversionSourcesServiceClient.create(conversionSourcesServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ConversionSourcesServiceClient implements BackgroundResource { + private final ConversionSourcesServiceSettings settings; + private final ConversionSourcesServiceStub stub; + + /** Constructs an instance of ConversionSourcesServiceClient with default settings. */ + public static final ConversionSourcesServiceClient create() throws IOException { + return create(ConversionSourcesServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConversionSourcesServiceClient, 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 ConversionSourcesServiceClient create( + ConversionSourcesServiceSettings settings) throws IOException { + return new ConversionSourcesServiceClient(settings); + } + + /** + * Constructs an instance of ConversionSourcesServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(ConversionSourcesServiceSettings). + */ + public static final ConversionSourcesServiceClient create(ConversionSourcesServiceStub stub) { + return new ConversionSourcesServiceClient(stub); + } + + /** + * Constructs an instance of ConversionSourcesServiceClient, 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 ConversionSourcesServiceClient(ConversionSourcesServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((ConversionSourcesServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ConversionSourcesServiceClient(ConversionSourcesServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ConversionSourcesServiceSettings getSettings() { + return settings; + } + + public ConversionSourcesServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   ConversionSource conversionSource = ConversionSource.newBuilder().build();
+   *   ConversionSource response =
+   *       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
+   * }
+   * }
+ * + * @param parent Required. The merchant account that will own the new conversion source. Format: + * accounts/{account} + * @param conversionSource Required. The conversion source description. A new ID will be + * automatically assigned to it upon creation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConversionSource createConversionSource( + AccountName parent, ConversionSource conversionSource) { + CreateConversionSourceRequest request = + CreateConversionSourceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setConversionSource(conversionSource) + .build(); + return createConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   ConversionSource conversionSource = ConversionSource.newBuilder().build();
+   *   ConversionSource response =
+   *       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
+   * }
+   * }
+ * + * @param parent Required. The merchant account that will own the new conversion source. Format: + * accounts/{account} + * @param conversionSource Required. The conversion source description. A new ID will be + * automatically assigned to it upon creation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConversionSource createConversionSource( + String parent, ConversionSource conversionSource) { + CreateConversionSourceRequest request = + CreateConversionSourceRequest.newBuilder() + .setParent(parent) + .setConversionSource(conversionSource) + .build(); + return createConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   CreateConversionSourceRequest request =
+   *       CreateConversionSourceRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setConversionSource(ConversionSource.newBuilder().build())
+   *           .build();
+   *   ConversionSource response = conversionSourcesServiceClient.createConversionSource(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 ConversionSource createConversionSource(CreateConversionSourceRequest request) { + return createConversionSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   CreateConversionSourceRequest request =
+   *       CreateConversionSourceRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setConversionSource(ConversionSource.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.createConversionSourceCallable().futureCall(request);
+   *   // Do something.
+   *   ConversionSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createConversionSourceCallable() { + return stub.createConversionSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates information of an existing conversion source. Available only for Merchant Center + * Destination conversion sources. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ConversionSource conversionSource = ConversionSource.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   ConversionSource response =
+   *       conversionSourcesServiceClient.updateConversionSource(conversionSource, updateMask);
+   * }
+   * }
+ * + * @param conversionSource Required. The new version of the conversion source data. Format: + * accounts/{account}/conversionSources/{conversion_source} + * @param updateMask Required. List of fields being updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConversionSource updateConversionSource( + ConversionSource conversionSource, FieldMask updateMask) { + UpdateConversionSourceRequest request = + UpdateConversionSourceRequest.newBuilder() + .setConversionSource(conversionSource) + .setUpdateMask(updateMask) + .build(); + return updateConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates information of an existing conversion source. Available only for Merchant Center + * Destination conversion sources. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   UpdateConversionSourceRequest request =
+   *       UpdateConversionSourceRequest.newBuilder()
+   *           .setConversionSource(ConversionSource.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ConversionSource response = conversionSourcesServiceClient.updateConversionSource(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 ConversionSource updateConversionSource(UpdateConversionSourceRequest request) { + return updateConversionSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates information of an existing conversion source. Available only for Merchant Center + * Destination conversion sources. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   UpdateConversionSourceRequest request =
+   *       UpdateConversionSourceRequest.newBuilder()
+   *           .setConversionSource(ConversionSource.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.updateConversionSourceCallable().futureCall(request);
+   *   // Do something.
+   *   ConversionSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateConversionSourceCallable() { + return stub.updateConversionSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Archives an existing conversion source. If the conversion source is a Merchant Center + * Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics + * Link, it will be deleted immediately and can be restored by creating a new one. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]");
+   *   conversionSourcesServiceClient.deleteConversionSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the conversion source to be deleted. Format: + * accounts/{account}/conversionSources/{conversion_source} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversionSource(ConversionSourceName name) { + DeleteConversionSourceRequest request = + DeleteConversionSourceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Archives an existing conversion source. If the conversion source is a Merchant Center + * Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics + * Link, it will be deleted immediately and can be restored by creating a new one. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString();
+   *   conversionSourcesServiceClient.deleteConversionSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the conversion source to be deleted. Format: + * accounts/{account}/conversionSources/{conversion_source} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteConversionSource(String name) { + DeleteConversionSourceRequest request = + DeleteConversionSourceRequest.newBuilder().setName(name).build(); + deleteConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Archives an existing conversion source. If the conversion source is a Merchant Center + * Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics + * Link, it will be deleted immediately and can be restored by creating a new one. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   DeleteConversionSourceRequest request =
+   *       DeleteConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   conversionSourcesServiceClient.deleteConversionSource(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 deleteConversionSource(DeleteConversionSourceRequest request) { + deleteConversionSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Archives an existing conversion source. If the conversion source is a Merchant Center + * Destination, it will be recoverable for 30 days. If the conversion source is a Google Analytics + * Link, it will be deleted immediately and can be restored by creating a new one. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   DeleteConversionSourceRequest request =
+   *       DeleteConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.deleteConversionSourceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteConversionSourceCallable() { + return stub.deleteConversionSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Re-enables an archived conversion source. Only Available for Merchant Center Destination + * conversion sources. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   UndeleteConversionSourceRequest request =
+   *       UndeleteConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   ConversionSource response = conversionSourcesServiceClient.undeleteConversionSource(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 ConversionSource undeleteConversionSource(UndeleteConversionSourceRequest request) { + return undeleteConversionSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Re-enables an archived conversion source. Only Available for Merchant Center Destination + * conversion sources. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   UndeleteConversionSourceRequest request =
+   *       UndeleteConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.undeleteConversionSourceCallable().futureCall(request);
+   *   // Do something.
+   *   ConversionSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + undeleteConversionSourceCallable() { + return stub.undeleteConversionSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches a conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]");
+   *   ConversionSource response = conversionSourcesServiceClient.getConversionSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the conversion source to be fetched. Format: + * accounts/{account}/conversionsources/{conversion_source} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConversionSource getConversionSource(ConversionSourceName name) { + GetConversionSourceRequest request = + GetConversionSourceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches a conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString();
+   *   ConversionSource response = conversionSourcesServiceClient.getConversionSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the conversion source to be fetched. Format: + * accounts/{account}/conversionsources/{conversion_source} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ConversionSource getConversionSource(String name) { + GetConversionSourceRequest request = + GetConversionSourceRequest.newBuilder().setName(name).build(); + return getConversionSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches a conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   GetConversionSourceRequest request =
+   *       GetConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   ConversionSource response = conversionSourcesServiceClient.getConversionSource(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 ConversionSource getConversionSource(GetConversionSourceRequest request) { + return getConversionSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Fetches a conversion source. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   GetConversionSourceRequest request =
+   *       GetConversionSourceRequest.newBuilder()
+   *           .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.getConversionSourceCallable().futureCall(request);
+   *   // Do something.
+   *   ConversionSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getConversionSourceCallable() { + return stub.getConversionSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the list of conversion sources the caller has access to. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (ConversionSource element :
+   *       conversionSourcesServiceClient.listConversionSources(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the collection of conversion sources. + * Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversionSourcesPagedResponse listConversionSources(AccountName parent) { + ListConversionSourcesRequest request = + ListConversionSourcesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listConversionSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the list of conversion sources the caller has access to. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (ConversionSource element :
+   *       conversionSourcesServiceClient.listConversionSources(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the collection of conversion sources. + * Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListConversionSourcesPagedResponse listConversionSources(String parent) { + ListConversionSourcesRequest request = + ListConversionSourcesRequest.newBuilder().setParent(parent).build(); + return listConversionSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the list of conversion sources the caller has access to. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ListConversionSourcesRequest request =
+   *       ListConversionSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   for (ConversionSource element :
+   *       conversionSourcesServiceClient.listConversionSources(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 ListConversionSourcesPagedResponse listConversionSources( + ListConversionSourcesRequest request) { + return listConversionSourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the list of conversion sources the caller has access to. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ListConversionSourcesRequest request =
+   *       ListConversionSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   ApiFuture future =
+   *       conversionSourcesServiceClient.listConversionSourcesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (ConversionSource element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversionSourcesPagedCallable() { + return stub.listConversionSourcesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the list of conversion sources the caller has access to. + * + *

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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+   *     ConversionSourcesServiceClient.create()) {
+   *   ListConversionSourcesRequest request =
+   *       ListConversionSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setShowDeleted(true)
+   *           .build();
+   *   while (true) {
+   *     ListConversionSourcesResponse response =
+   *         conversionSourcesServiceClient.listConversionSourcesCallable().call(request);
+   *     for (ConversionSource element : response.getConversionSourcesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listConversionSourcesCallable() { + return stub.listConversionSourcesCallable(); + } + + @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 ListConversionSourcesPagedResponse + extends AbstractPagedListResponse< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ConversionSource, + ListConversionSourcesPage, + ListConversionSourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListConversionSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListConversionSourcesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListConversionSourcesPagedResponse(ListConversionSourcesPage page) { + super(page, ListConversionSourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListConversionSourcesPage + extends AbstractPage< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ConversionSource, + ListConversionSourcesPage> { + + private ListConversionSourcesPage( + PageContext + context, + ListConversionSourcesResponse response) { + super(context, response); + } + + private static ListConversionSourcesPage createEmptyPage() { + return new ListConversionSourcesPage(null, null); + } + + @Override + protected ListConversionSourcesPage createPage( + PageContext + context, + ListConversionSourcesResponse response) { + return new ListConversionSourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListConversionSourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ConversionSource, + ListConversionSourcesPage, + ListConversionSourcesFixedSizeCollection> { + + private ListConversionSourcesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListConversionSourcesFixedSizeCollection createEmptyCollection() { + return new ListConversionSourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListConversionSourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListConversionSourcesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceSettings.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceSettings.java new file mode 100644 index 000000000000..5c0013ce29f2 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceSettings.java @@ -0,0 +1,282 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.shopping.merchant.conversions.v1beta.stub.ConversionSourcesServiceStubSettings; +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 ConversionSourcesServiceClient}. + * + *

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

    + *
  • The default service address (merchantapi.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 total timeout of createConversionSource to 30 seconds: + * + *

{@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
+ * ConversionSourcesServiceSettings.Builder conversionSourcesServiceSettingsBuilder =
+ *     ConversionSourcesServiceSettings.newBuilder();
+ * conversionSourcesServiceSettingsBuilder
+ *     .createConversionSourceSettings()
+ *     .setRetrySettings(
+ *         conversionSourcesServiceSettingsBuilder
+ *             .createConversionSourceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversionSourcesServiceSettings conversionSourcesServiceSettings =
+ *     conversionSourcesServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ConversionSourcesServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to createConversionSource. */ + public UnaryCallSettings + createConversionSourceSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()) + .createConversionSourceSettings(); + } + + /** Returns the object with the settings used for calls to updateConversionSource. */ + public UnaryCallSettings + updateConversionSourceSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()) + .updateConversionSourceSettings(); + } + + /** Returns the object with the settings used for calls to deleteConversionSource. */ + public UnaryCallSettings deleteConversionSourceSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()) + .deleteConversionSourceSettings(); + } + + /** Returns the object with the settings used for calls to undeleteConversionSource. */ + public UnaryCallSettings + undeleteConversionSourceSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()) + .undeleteConversionSourceSettings(); + } + + /** Returns the object with the settings used for calls to getConversionSource. */ + public UnaryCallSettings + getConversionSourceSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()).getConversionSourceSettings(); + } + + /** Returns the object with the settings used for calls to listConversionSources. */ + public PagedCallSettings< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings() { + return ((ConversionSourcesServiceStubSettings) getStubSettings()) + .listConversionSourcesSettings(); + } + + public static final ConversionSourcesServiceSettings create( + ConversionSourcesServiceStubSettings stub) throws IOException { + return new ConversionSourcesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConversionSourcesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConversionSourcesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConversionSourcesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConversionSourcesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConversionSourcesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ConversionSourcesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConversionSourcesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversionSourcesServiceStubSettings.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 ConversionSourcesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConversionSourcesServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ConversionSourcesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ConversionSourcesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConversionSourcesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ConversionSourcesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(ConversionSourcesServiceStubSettings.newHttpJsonBuilder()); + } + + public ConversionSourcesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ConversionSourcesServiceStubSettings.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 createConversionSource. */ + public UnaryCallSettings.Builder + createConversionSourceSettings() { + return getStubSettingsBuilder().createConversionSourceSettings(); + } + + /** Returns the builder for the settings used for calls to updateConversionSource. */ + public UnaryCallSettings.Builder + updateConversionSourceSettings() { + return getStubSettingsBuilder().updateConversionSourceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteConversionSource. */ + public UnaryCallSettings.Builder + deleteConversionSourceSettings() { + return getStubSettingsBuilder().deleteConversionSourceSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteConversionSource. */ + public UnaryCallSettings.Builder + undeleteConversionSourceSettings() { + return getStubSettingsBuilder().undeleteConversionSourceSettings(); + } + + /** Returns the builder for the settings used for calls to getConversionSource. */ + public UnaryCallSettings.Builder + getConversionSourceSettings() { + return getStubSettingsBuilder().getConversionSourceSettings(); + } + + /** Returns the builder for the settings used for calls to listConversionSources. */ + public PagedCallSettings.Builder< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings() { + return getStubSettingsBuilder().listConversionSourcesSettings(); + } + + @Override + public ConversionSourcesServiceSettings build() throws IOException { + return new ConversionSourcesServiceSettings(this); + } + } +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/gapic_metadata.json b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..ca9fc3c13c88 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.conversions.v1beta", + "libraryPackage": "com.google.shopping.merchant.conversions.v1beta", + "services": { + "ConversionSourcesService": { + "clients": { + "grpc": { + "libraryClient": "ConversionSourcesServiceClient", + "rpcs": { + "CreateConversionSource": { + "methods": ["createConversionSource", "createConversionSource", "createConversionSource", "createConversionSourceCallable"] + }, + "DeleteConversionSource": { + "methods": ["deleteConversionSource", "deleteConversionSource", "deleteConversionSource", "deleteConversionSourceCallable"] + }, + "GetConversionSource": { + "methods": ["getConversionSource", "getConversionSource", "getConversionSource", "getConversionSourceCallable"] + }, + "ListConversionSources": { + "methods": ["listConversionSources", "listConversionSources", "listConversionSources", "listConversionSourcesPagedCallable", "listConversionSourcesCallable"] + }, + "UndeleteConversionSource": { + "methods": ["undeleteConversionSource", "undeleteConversionSourceCallable"] + }, + "UpdateConversionSource": { + "methods": ["updateConversionSource", "updateConversionSource", "updateConversionSourceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/package-info.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/package-info.java new file mode 100644 index 000000000000..dd6d7c7abd02 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/package-info.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. + */ + +/** + * A client to Merchant API + * + *

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

======================= ConversionSourcesServiceClient ======================= + * + *

Service Description: Service for managing conversion sources for a merchant account. + * + *

Sample for ConversionSourcesServiceClient: + * + *

{@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 (ConversionSourcesServiceClient conversionSourcesServiceClient =
+ *     ConversionSourcesServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   ConversionSource conversionSource = ConversionSource.newBuilder().build();
+ *   ConversionSource response =
+ *       conversionSourcesServiceClient.createConversionSource(parent, conversionSource);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.merchant.conversions.v1beta; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStub.java new file mode 100644 index 000000000000..11df202a912e --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStub.java @@ -0,0 +1,81 @@ +/* + * 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.shopping.merchant.conversions.v1beta.stub; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ConversionSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ConversionSourcesServiceStub implements BackgroundResource { + + public UnaryCallable + createConversionSourceCallable() { + throw new UnsupportedOperationException("Not implemented: createConversionSourceCallable()"); + } + + public UnaryCallable + updateConversionSourceCallable() { + throw new UnsupportedOperationException("Not implemented: updateConversionSourceCallable()"); + } + + public UnaryCallable deleteConversionSourceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteConversionSourceCallable()"); + } + + public UnaryCallable + undeleteConversionSourceCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteConversionSourceCallable()"); + } + + public UnaryCallable getConversionSourceCallable() { + throw new UnsupportedOperationException("Not implemented: getConversionSourceCallable()"); + } + + public UnaryCallable + listConversionSourcesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listConversionSourcesPagedCallable()"); + } + + public UnaryCallable + listConversionSourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listConversionSourcesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStubSettings.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStubSettings.java new file mode 100644 index 000000000000..3862b81e53ab --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/ConversionSourcesServiceStubSettings.java @@ -0,0 +1,560 @@ +/* + * 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.shopping.merchant.conversions.v1beta.stub; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +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 com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; +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 ConversionSourcesServiceStub}. + * + *

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

    + *
  • The default service address (merchantapi.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 total timeout of createConversionSource to 30 seconds: + * + *

{@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
+ * ConversionSourcesServiceStubSettings.Builder conversionSourcesServiceSettingsBuilder =
+ *     ConversionSourcesServiceStubSettings.newBuilder();
+ * conversionSourcesServiceSettingsBuilder
+ *     .createConversionSourceSettings()
+ *     .setRetrySettings(
+ *         conversionSourcesServiceSettingsBuilder
+ *             .createConversionSourceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ConversionSourcesServiceStubSettings conversionSourcesServiceSettings =
+ *     conversionSourcesServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ConversionSourcesServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/content").build(); + + private final UnaryCallSettings + createConversionSourceSettings; + private final UnaryCallSettings + updateConversionSourceSettings; + private final UnaryCallSettings + deleteConversionSourceSettings; + private final UnaryCallSettings + undeleteConversionSourceSettings; + private final UnaryCallSettings + getConversionSourceSettings; + private final PagedCallSettings< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings; + + private static final PagedListDescriptor< + ListConversionSourcesRequest, ListConversionSourcesResponse, ConversionSource> + LIST_CONVERSION_SOURCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListConversionSourcesRequest, ListConversionSourcesResponse, ConversionSource>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListConversionSourcesRequest injectToken( + ListConversionSourcesRequest payload, String token) { + return ListConversionSourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListConversionSourcesRequest injectPageSize( + ListConversionSourcesRequest payload, int pageSize) { + return ListConversionSourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListConversionSourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListConversionSourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListConversionSourcesResponse payload) { + return payload.getConversionSourcesList() == null + ? ImmutableList.of() + : payload.getConversionSourcesList(); + } + }; + + private static final PagedListResponseFactory< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + LIST_CONVERSION_SOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListConversionSourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListConversionSourcesRequest, ListConversionSourcesResponse, ConversionSource> + pageContext = + PageContext.create( + callable, LIST_CONVERSION_SOURCES_PAGE_STR_DESC, request, context); + return ListConversionSourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createConversionSource. */ + public UnaryCallSettings + createConversionSourceSettings() { + return createConversionSourceSettings; + } + + /** Returns the object with the settings used for calls to updateConversionSource. */ + public UnaryCallSettings + updateConversionSourceSettings() { + return updateConversionSourceSettings; + } + + /** Returns the object with the settings used for calls to deleteConversionSource. */ + public UnaryCallSettings deleteConversionSourceSettings() { + return deleteConversionSourceSettings; + } + + /** Returns the object with the settings used for calls to undeleteConversionSource. */ + public UnaryCallSettings + undeleteConversionSourceSettings() { + return undeleteConversionSourceSettings; + } + + /** Returns the object with the settings used for calls to getConversionSource. */ + public UnaryCallSettings + getConversionSourceSettings() { + return getConversionSourceSettings; + } + + /** Returns the object with the settings used for calls to listConversionSources. */ + public PagedCallSettings< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings() { + return listConversionSourcesSettings; + } + + public ConversionSourcesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConversionSourcesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonConversionSourcesServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "merchantapi"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "merchantapi.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "merchantapi.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(ConversionSourcesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConversionSourcesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConversionSourcesServiceStubSettings.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 ConversionSourcesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createConversionSourceSettings = settingsBuilder.createConversionSourceSettings().build(); + updateConversionSourceSettings = settingsBuilder.updateConversionSourceSettings().build(); + deleteConversionSourceSettings = settingsBuilder.deleteConversionSourceSettings().build(); + undeleteConversionSourceSettings = settingsBuilder.undeleteConversionSourceSettings().build(); + getConversionSourceSettings = settingsBuilder.getConversionSourceSettings().build(); + listConversionSourcesSettings = settingsBuilder.listConversionSourcesSettings().build(); + } + + /** Builder for ConversionSourcesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createConversionSourceSettings; + private final UnaryCallSettings.Builder + updateConversionSourceSettings; + private final UnaryCallSettings.Builder + deleteConversionSourceSettings; + private final UnaryCallSettings.Builder + undeleteConversionSourceSettings; + private final UnaryCallSettings.Builder + getConversionSourceSettings; + private final PagedCallSettings.Builder< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings; + 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))); + 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(10000L)) + .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); + + createConversionSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateConversionSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteConversionSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteConversionSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getConversionSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listConversionSourcesSettings = + PagedCallSettings.newBuilder(LIST_CONVERSION_SOURCES_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConversionSourceSettings, + updateConversionSourceSettings, + deleteConversionSourceSettings, + undeleteConversionSourceSettings, + getConversionSourceSettings, + listConversionSourcesSettings); + initDefaults(this); + } + + protected Builder(ConversionSourcesServiceStubSettings settings) { + super(settings); + + createConversionSourceSettings = settings.createConversionSourceSettings.toBuilder(); + updateConversionSourceSettings = settings.updateConversionSourceSettings.toBuilder(); + deleteConversionSourceSettings = settings.deleteConversionSourceSettings.toBuilder(); + undeleteConversionSourceSettings = settings.undeleteConversionSourceSettings.toBuilder(); + getConversionSourceSettings = settings.getConversionSourceSettings.toBuilder(); + listConversionSourcesSettings = settings.listConversionSourcesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createConversionSourceSettings, + updateConversionSourceSettings, + deleteConversionSourceSettings, + undeleteConversionSourceSettings, + getConversionSourceSettings, + listConversionSourcesSettings); + } + + 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 + .createConversionSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateConversionSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteConversionSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .undeleteConversionSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getConversionSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listConversionSourcesSettings() + .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 createConversionSource. */ + public UnaryCallSettings.Builder + createConversionSourceSettings() { + return createConversionSourceSettings; + } + + /** Returns the builder for the settings used for calls to updateConversionSource. */ + public UnaryCallSettings.Builder + updateConversionSourceSettings() { + return updateConversionSourceSettings; + } + + /** Returns the builder for the settings used for calls to deleteConversionSource. */ + public UnaryCallSettings.Builder + deleteConversionSourceSettings() { + return deleteConversionSourceSettings; + } + + /** Returns the builder for the settings used for calls to undeleteConversionSource. */ + public UnaryCallSettings.Builder + undeleteConversionSourceSettings() { + return undeleteConversionSourceSettings; + } + + /** Returns the builder for the settings used for calls to getConversionSource. */ + public UnaryCallSettings.Builder + getConversionSourceSettings() { + return getConversionSourceSettings; + } + + /** Returns the builder for the settings used for calls to listConversionSources. */ + public PagedCallSettings.Builder< + ListConversionSourcesRequest, + ListConversionSourcesResponse, + ListConversionSourcesPagedResponse> + listConversionSourcesSettings() { + return listConversionSourcesSettings; + } + + @Override + public ConversionSourcesServiceStubSettings build() throws IOException { + return new ConversionSourcesServiceStubSettings(this); + } + } +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceCallableFactory.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..d2fbdf7b73d2 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceCallableFactory.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.shopping.merchant.conversions.v1beta.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 ConversionSourcesService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcConversionSourcesServiceCallableFactory 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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceStub.java new file mode 100644 index 000000000000..7b876aa50e1e --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/GrpcConversionSourcesServiceStub.java @@ -0,0 +1,368 @@ +/* + * 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.shopping.merchant.conversions.v1beta.stub; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; +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 ConversionSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcConversionSourcesServiceStub extends ConversionSourcesServiceStub { + private static final MethodDescriptor + createConversionSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/CreateConversionSource") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConversionSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateConversionSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/UpdateConversionSource") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConversionSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteConversionSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/DeleteConversionSource") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + undeleteConversionSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/UndeleteConversionSource") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeleteConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConversionSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getConversionSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/GetConversionSource") + .setRequestMarshaller( + ProtoUtils.marshaller(GetConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ConversionSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listConversionSourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/ListConversionSources") + .setRequestMarshaller( + ProtoUtils.marshaller(ListConversionSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListConversionSourcesResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + createConversionSourceCallable; + private final UnaryCallable + updateConversionSourceCallable; + private final UnaryCallable deleteConversionSourceCallable; + private final UnaryCallable + undeleteConversionSourceCallable; + private final UnaryCallable + getConversionSourceCallable; + private final UnaryCallable + listConversionSourcesCallable; + private final UnaryCallable + listConversionSourcesPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConversionSourcesServiceStub create( + ConversionSourcesServiceStubSettings settings) throws IOException { + return new GrpcConversionSourcesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcConversionSourcesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConversionSourcesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConversionSourcesServiceStub, 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 GrpcConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcConversionSourcesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcConversionSourcesServiceStub, 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 GrpcConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + createConversionSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createConversionSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateConversionSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateConversionSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversion_source.name", + String.valueOf(request.getConversionSource().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteConversionSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteConversionSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + undeleteConversionSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteConversionSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getConversionSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getConversionSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listConversionSourcesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listConversionSourcesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.createConversionSourceCallable = + callableFactory.createUnaryCallable( + createConversionSourceTransportSettings, + settings.createConversionSourceSettings(), + clientContext); + this.updateConversionSourceCallable = + callableFactory.createUnaryCallable( + updateConversionSourceTransportSettings, + settings.updateConversionSourceSettings(), + clientContext); + this.deleteConversionSourceCallable = + callableFactory.createUnaryCallable( + deleteConversionSourceTransportSettings, + settings.deleteConversionSourceSettings(), + clientContext); + this.undeleteConversionSourceCallable = + callableFactory.createUnaryCallable( + undeleteConversionSourceTransportSettings, + settings.undeleteConversionSourceSettings(), + clientContext); + this.getConversionSourceCallable = + callableFactory.createUnaryCallable( + getConversionSourceTransportSettings, + settings.getConversionSourceSettings(), + clientContext); + this.listConversionSourcesCallable = + callableFactory.createUnaryCallable( + listConversionSourcesTransportSettings, + settings.listConversionSourcesSettings(), + clientContext); + this.listConversionSourcesPagedCallable = + callableFactory.createPagedCallable( + listConversionSourcesTransportSettings, + settings.listConversionSourcesSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + createConversionSourceCallable() { + return createConversionSourceCallable; + } + + @Override + public UnaryCallable + updateConversionSourceCallable() { + return updateConversionSourceCallable; + } + + @Override + public UnaryCallable deleteConversionSourceCallable() { + return deleteConversionSourceCallable; + } + + @Override + public UnaryCallable + undeleteConversionSourceCallable() { + return undeleteConversionSourceCallable; + } + + @Override + public UnaryCallable getConversionSourceCallable() { + return getConversionSourceCallable; + } + + @Override + public UnaryCallable + listConversionSourcesCallable() { + return listConversionSourcesCallable; + } + + @Override + public UnaryCallable + listConversionSourcesPagedCallable() { + return listConversionSourcesPagedCallable; + } + + @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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceCallableFactory.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..b035162bd6fc --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceCallableFactory.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.shopping.merchant.conversions.v1beta.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 ConversionSourcesService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonConversionSourcesServiceCallableFactory + 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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceStub.java new file mode 100644 index 000000000000..df27998a508e --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1beta/stub/HttpJsonConversionSourcesServiceStub.java @@ -0,0 +1,554 @@ +/* + * 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.shopping.merchant.conversions.v1beta.stub; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; +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 ConversionSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonConversionSourcesServiceStub extends ConversionSourcesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createConversionSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/CreateConversionSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{parent=accounts/*}/conversionSources", + 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("conversionSource", request.getConversionSource(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConversionSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateConversionSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/UpdateConversionSource") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{conversionSource.name=accounts/*/conversionSources/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "conversionSource.name", + request.getConversionSource().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("conversionSource", request.getConversionSource(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConversionSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteConversionSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/DeleteConversionSource") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{name=accounts/*/conversionSources/*}", + 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 + undeleteConversionSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/UndeleteConversionSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{name=accounts/*/conversionSources/*}:undelete", + 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 -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ConversionSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getConversionSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/GetConversionSource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{name=accounts/*/conversionSources/*}", + 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(ConversionSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListConversionSourcesRequest, ListConversionSourcesResponse> + listConversionSourcesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService/ListConversionSources") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1beta/{parent=accounts/*}/conversionSources", + 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, "showDeleted", request.getShowDeleted()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListConversionSourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createConversionSourceCallable; + private final UnaryCallable + updateConversionSourceCallable; + private final UnaryCallable deleteConversionSourceCallable; + private final UnaryCallable + undeleteConversionSourceCallable; + private final UnaryCallable + getConversionSourceCallable; + private final UnaryCallable + listConversionSourcesCallable; + private final UnaryCallable + listConversionSourcesPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonConversionSourcesServiceStub create( + ConversionSourcesServiceStubSettings settings) throws IOException { + return new HttpJsonConversionSourcesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonConversionSourcesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonConversionSourcesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonConversionSourcesServiceStub, 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 HttpJsonConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonConversionSourcesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonConversionSourcesServiceStub, 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 HttpJsonConversionSourcesServiceStub( + ConversionSourcesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createConversionSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createConversionSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateConversionSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateConversionSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "conversion_source.name", + String.valueOf(request.getConversionSource().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteConversionSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteConversionSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + undeleteConversionSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(undeleteConversionSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getConversionSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getConversionSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listConversionSourcesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listConversionSourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.createConversionSourceCallable = + callableFactory.createUnaryCallable( + createConversionSourceTransportSettings, + settings.createConversionSourceSettings(), + clientContext); + this.updateConversionSourceCallable = + callableFactory.createUnaryCallable( + updateConversionSourceTransportSettings, + settings.updateConversionSourceSettings(), + clientContext); + this.deleteConversionSourceCallable = + callableFactory.createUnaryCallable( + deleteConversionSourceTransportSettings, + settings.deleteConversionSourceSettings(), + clientContext); + this.undeleteConversionSourceCallable = + callableFactory.createUnaryCallable( + undeleteConversionSourceTransportSettings, + settings.undeleteConversionSourceSettings(), + clientContext); + this.getConversionSourceCallable = + callableFactory.createUnaryCallable( + getConversionSourceTransportSettings, + settings.getConversionSourceSettings(), + clientContext); + this.listConversionSourcesCallable = + callableFactory.createUnaryCallable( + listConversionSourcesTransportSettings, + settings.listConversionSourcesSettings(), + clientContext); + this.listConversionSourcesPagedCallable = + callableFactory.createPagedCallable( + listConversionSourcesTransportSettings, + settings.listConversionSourcesSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createConversionSourceMethodDescriptor); + methodDescriptors.add(updateConversionSourceMethodDescriptor); + methodDescriptors.add(deleteConversionSourceMethodDescriptor); + methodDescriptors.add(undeleteConversionSourceMethodDescriptor); + methodDescriptors.add(getConversionSourceMethodDescriptor); + methodDescriptors.add(listConversionSourcesMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + createConversionSourceCallable() { + return createConversionSourceCallable; + } + + @Override + public UnaryCallable + updateConversionSourceCallable() { + return updateConversionSourceCallable; + } + + @Override + public UnaryCallable deleteConversionSourceCallable() { + return deleteConversionSourceCallable; + } + + @Override + public UnaryCallable + undeleteConversionSourceCallable() { + return undeleteConversionSourceCallable; + } + + @Override + public UnaryCallable getConversionSourceCallable() { + return getConversionSourceCallable; + } + + @Override + public UnaryCallable + listConversionSourcesCallable() { + return listConversionSourcesCallable; + } + + @Override + public UnaryCallable + listConversionSourcesPagedCallable() { + return listConversionSourcesPagedCallable; + } + + @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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/resources/META-INF/native-image/com.google.shopping.merchant.conversions.v1beta/reflect-config.json b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/resources/META-INF/native-image/com.google.shopping.merchant.conversions.v1beta/reflect-config.json new file mode 100644 index 000000000000..f08cce4e4472 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/resources/META-INF/native-image/com.google.shopping.merchant.conversions.v1beta/reflect-config.json @@ -0,0 +1,1424 @@ +[ + { + "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.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 + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.AttributionSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.AttributionSettings$AttributionModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.AttributionSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.AttributionSettings$ConversionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.AttributionSettings$ConversionType$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ConversionSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ConversionSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ConversionSource$Controller", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ConversionSource$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientHttpJsonTest.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..328a7999467b --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientHttpJsonTest.java @@ -0,0 +1,550 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import com.google.shopping.merchant.conversions.v1beta.stub.HttpJsonConversionSourcesServiceStub; +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 ConversionSourcesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ConversionSourcesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonConversionSourcesServiceStub.getMethodDescriptors(), + ConversionSourcesServiceSettings.getDefaultEndpoint()); + ConversionSourcesServiceSettings settings = + ConversionSourcesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ConversionSourcesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversionSourcesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + + ConversionSource actualResponse = client.createConversionSource(parent, conversionSource); + 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 createConversionSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + client.createConversionSource(parent, conversionSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversionSourceTest2() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + + ConversionSource actualResponse = client.createConversionSource(parent, conversionSource); + 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 createConversionSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + client.createConversionSource(parent, conversionSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ConversionSource conversionSource = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ConversionSource actualResponse = client.updateConversionSource(conversionSource, updateMask); + 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 updateConversionSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversionSource conversionSource = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversionSource(conversionSource, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversionSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + + client.deleteConversionSource(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 deleteConversionSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + client.deleteConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversionSourceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-8890/conversionSources/conversionSource-8890"; + + client.deleteConversionSource(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 deleteConversionSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-8890/conversionSources/conversionSource-8890"; + client.deleteConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void undeleteConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + + ConversionSource actualResponse = client.undeleteConversionSource(request); + 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 undeleteConversionSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + client.undeleteConversionSource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + + ConversionSource actualResponse = client.getConversionSource(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 getConversionSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + client.getConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversionSourceTest2() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-8890/conversionSources/conversionSource-8890"; + + ConversionSource actualResponse = client.getConversionSource(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 getConversionSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-8890/conversionSources/conversionSource-8890"; + client.getConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversionSourcesTest() throws Exception { + ConversionSource responsesElement = ConversionSource.newBuilder().build(); + ListConversionSourcesResponse expectedResponse = + ListConversionSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllConversionSources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListConversionSourcesPagedResponse pagedListResponse = client.listConversionSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversionSourcesList().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 listConversionSourcesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listConversionSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversionSourcesTest2() throws Exception { + ConversionSource responsesElement = ConversionSource.newBuilder().build(); + ListConversionSourcesResponse expectedResponse = + ListConversionSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllConversionSources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListConversionSourcesPagedResponse pagedListResponse = client.listConversionSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversionSourcesList().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 listConversionSourcesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + client.listConversionSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientTest.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientTest.java new file mode 100644 index 000000000000..f8a3aab8725d --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceClientTest.java @@ -0,0 +1,497 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +import static com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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 com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +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 ConversionSourcesServiceClientTest { + private static MockConversionSourcesService mockConversionSourcesService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ConversionSourcesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockConversionSourcesService = new MockConversionSourcesService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockConversionSourcesService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ConversionSourcesServiceSettings settings = + ConversionSourcesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConversionSourcesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + + ConversionSource actualResponse = client.createConversionSource(parent, conversionSource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversionSourceRequest actualRequest = + ((CreateConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(conversionSource, actualRequest.getConversionSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversionSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + client.createConversionSource(parent, conversionSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createConversionSourceTest2() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + + ConversionSource actualResponse = client.createConversionSource(parent, conversionSource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateConversionSourceRequest actualRequest = + ((CreateConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(conversionSource, actualRequest.getConversionSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createConversionSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + String parent = "parent-995424086"; + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + client.createConversionSource(parent, conversionSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + ConversionSource actualResponse = client.updateConversionSource(conversionSource, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateConversionSourceRequest actualRequest = + ((UpdateConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(conversionSource, actualRequest.getConversionSource()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateConversionSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateConversionSource(conversionSource, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversionSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversionSourcesService.addResponse(expectedResponse); + + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + + client.deleteConversionSource(name); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversionSourceRequest actualRequest = + ((DeleteConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversionSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + client.deleteConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteConversionSourceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConversionSourcesService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteConversionSource(name); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteConversionSourceRequest actualRequest = + ((DeleteConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteConversionSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + String name = "name3373707"; + client.deleteConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void undeleteConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + + ConversionSource actualResponse = client.undeleteConversionSource(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteConversionSourceRequest actualRequest = + ((UndeleteConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteConversionSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + client.undeleteConversionSource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversionSourceTest() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + + ConversionSource actualResponse = client.getConversionSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversionSourceRequest actualRequest = ((GetConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversionSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + client.getConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getConversionSourceTest2() throws Exception { + ConversionSource expectedResponse = + ConversionSource.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .setExpireTime(Timestamp.newBuilder().build()) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + String name = "name3373707"; + + ConversionSource actualResponse = client.getConversionSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetConversionSourceRequest actualRequest = ((GetConversionSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getConversionSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + String name = "name3373707"; + client.getConversionSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversionSourcesTest() throws Exception { + ConversionSource responsesElement = ConversionSource.newBuilder().build(); + ListConversionSourcesResponse expectedResponse = + ListConversionSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllConversionSources(Arrays.asList(responsesElement)) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListConversionSourcesPagedResponse pagedListResponse = client.listConversionSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversionSourcesList().get(0), resources.get(0)); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversionSourcesRequest actualRequest = + ((ListConversionSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversionSourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listConversionSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listConversionSourcesTest2() throws Exception { + ConversionSource responsesElement = ConversionSource.newBuilder().build(); + ListConversionSourcesResponse expectedResponse = + ListConversionSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllConversionSources(Arrays.asList(responsesElement)) + .build(); + mockConversionSourcesService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListConversionSourcesPagedResponse pagedListResponse = client.listConversionSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getConversionSourcesList().get(0), resources.get(0)); + + List actualRequests = mockConversionSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListConversionSourcesRequest actualRequest = + ((ListConversionSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listConversionSourcesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConversionSourcesService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listConversionSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesService.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesService.java new file mode 100644 index 000000000000..6436916010d0 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesService.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.shopping.merchant.conversions.v1beta; + +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 MockConversionSourcesService implements MockGrpcService { + private final MockConversionSourcesServiceImpl serviceImpl; + + public MockConversionSourcesService() { + serviceImpl = new MockConversionSourcesServiceImpl(); + } + + @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-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesServiceImpl.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesServiceImpl.java new file mode 100644 index 000000000000..07024d8fa084 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1beta/MockConversionSourcesServiceImpl.java @@ -0,0 +1,188 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceGrpc.ConversionSourcesServiceImplBase; +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 MockConversionSourcesServiceImpl extends ConversionSourcesServiceImplBase { + private List requests; + private Queue responses; + + public MockConversionSourcesServiceImpl() { + 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 createConversionSource( + CreateConversionSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConversionSource) { + requests.add(request); + responseObserver.onNext(((ConversionSource) 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 CreateConversionSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConversionSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateConversionSource( + UpdateConversionSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConversionSource) { + requests.add(request); + responseObserver.onNext(((ConversionSource) 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 UpdateConversionSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConversionSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteConversionSource( + DeleteConversionSourceRequest 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 DeleteConversionSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeleteConversionSource( + UndeleteConversionSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConversionSource) { + requests.add(request); + responseObserver.onNext(((ConversionSource) 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 UndeleteConversionSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConversionSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getConversionSource( + GetConversionSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ConversionSource) { + requests.add(request); + responseObserver.onNext(((ConversionSource) 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 GetConversionSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ConversionSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listConversionSources( + ListConversionSourcesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListConversionSourcesResponse) { + requests.add(request); + responseObserver.onNext(((ListConversionSourcesResponse) 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 ListConversionSources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListConversionSourcesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/pom.xml b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/pom.xml new file mode 100644 index 000000000000..720e5cbbcfe0 --- /dev/null +++ b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + grpc-google-shopping-merchant-conversions-v1beta + GRPC library for google-shopping-merchant-conversions + + com.google.shopping + google-shopping-merchant-conversions-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.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1beta + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceGrpc.java b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceGrpc.java new file mode 100644 index 000000000000..d86f1d35438d --- /dev/null +++ b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesServiceGrpc.java @@ -0,0 +1,1081 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing conversion sources for a merchant account.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/conversions/v1beta/conversionsources.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ConversionSourcesServiceGrpc { + + private ConversionSourcesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.conversions.v1beta.ConversionSourcesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getCreateConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getCreateConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getCreateConversionSourceMethod; + if ((getCreateConversionSourceMethod = + ConversionSourcesServiceGrpc.getCreateConversionSourceMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getCreateConversionSourceMethod = + ConversionSourcesServiceGrpc.getCreateConversionSourceMethod) + == null) { + ConversionSourcesServiceGrpc.getCreateConversionSourceMethod = + getCreateConversionSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateConversionSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .CreateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "CreateConversionSource")) + .build(); + } + } + } + return getCreateConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUpdateConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUpdateConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUpdateConversionSourceMethod; + if ((getUpdateConversionSourceMethod = + ConversionSourcesServiceGrpc.getUpdateConversionSourceMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getUpdateConversionSourceMethod = + ConversionSourcesServiceGrpc.getUpdateConversionSourceMethod) + == null) { + ConversionSourcesServiceGrpc.getUpdateConversionSourceMethod = + getUpdateConversionSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateConversionSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .UpdateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "UpdateConversionSource")) + .build(); + } + } + } + return getUpdateConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest, + com.google.protobuf.Empty> + getDeleteConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest, + com.google.protobuf.Empty> + getDeleteConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest, + com.google.protobuf.Empty> + getDeleteConversionSourceMethod; + if ((getDeleteConversionSourceMethod = + ConversionSourcesServiceGrpc.getDeleteConversionSourceMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getDeleteConversionSourceMethod = + ConversionSourcesServiceGrpc.getDeleteConversionSourceMethod) + == null) { + ConversionSourcesServiceGrpc.getDeleteConversionSourceMethod = + getDeleteConversionSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteConversionSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .DeleteConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "DeleteConversionSource")) + .build(); + } + } + } + return getDeleteConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUndeleteConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUndeleteConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getUndeleteConversionSourceMethod; + if ((getUndeleteConversionSourceMethod = + ConversionSourcesServiceGrpc.getUndeleteConversionSourceMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getUndeleteConversionSourceMethod = + ConversionSourcesServiceGrpc.getUndeleteConversionSourceMethod) + == null) { + ConversionSourcesServiceGrpc.getUndeleteConversionSourceMethod = + getUndeleteConversionSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UndeleteConversionSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .UndeleteConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "UndeleteConversionSource")) + .build(); + } + } + } + return getUndeleteConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getGetConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getGetConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getGetConversionSourceMethod; + if ((getGetConversionSourceMethod = ConversionSourcesServiceGrpc.getGetConversionSourceMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getGetConversionSourceMethod = + ConversionSourcesServiceGrpc.getGetConversionSourceMethod) + == null) { + ConversionSourcesServiceGrpc.getGetConversionSourceMethod = + getGetConversionSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetConversionSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .GetConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "GetConversionSource")) + .build(); + } + } + } + return getGetConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + getListConversionSourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConversionSources", + requestType = + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.class, + responseType = + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + getListConversionSourcesMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + getListConversionSourcesMethod; + if ((getListConversionSourcesMethod = + ConversionSourcesServiceGrpc.getListConversionSourcesMethod) + == null) { + synchronized (ConversionSourcesServiceGrpc.class) { + if ((getListConversionSourcesMethod = + ConversionSourcesServiceGrpc.getListConversionSourcesMethod) + == null) { + ConversionSourcesServiceGrpc.getListConversionSourcesMethod = + getListConversionSourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListConversionSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .ListConversionSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1beta + .ListConversionSourcesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "ListConversionSources")) + .build(); + } + } + } + return getListConversionSourcesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ConversionSourcesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversionSourcesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceStub(channel, callOptions); + } + }; + return ConversionSourcesServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConversionSourcesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversionSourcesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceBlockingStub(channel, callOptions); + } + }; + return ConversionSourcesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ConversionSourcesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversionSourcesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceFutureStub(channel, callOptions); + } + }; + return ConversionSourcesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing conversion sources for a merchant account.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a new conversion source.
+     * 
+ */ + default void createConversionSource( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates information of an existing conversion source. Available only for
+     * Merchant Center Destination conversion sources.
+     * 
+ */ + default void updateConversionSource( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Archives an existing conversion source. If the conversion source is a
+     * Merchant Center Destination, it will be recoverable for 30 days. If the
+     * conversion source is a Google Analytics Link, it will be deleted
+     * immediately and can be restored by creating a new one.
+     * 
+ */ + default void deleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Re-enables an archived conversion source. Only Available for Merchant
+     * Center Destination conversion sources.
+     * 
+ */ + default void undeleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + default void getConversionSource( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the list of conversion sources the caller has access to.
+     * 
+ */ + default void listConversionSources( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListConversionSourcesMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ConversionSourcesService. + * + *
+   * Service for managing conversion sources for a merchant account.
+   * 
+ */ + public abstract static class ConversionSourcesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ConversionSourcesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ConversionSourcesService. + * + *
+   * Service for managing conversion sources for a merchant account.
+   * 
+ */ + public static final class ConversionSourcesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ConversionSourcesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversionSourcesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new conversion source.
+     * 
+ */ + public void createConversionSource( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates information of an existing conversion source. Available only for
+     * Merchant Center Destination conversion sources.
+     * 
+ */ + public void updateConversionSource( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Archives an existing conversion source. If the conversion source is a
+     * Merchant Center Destination, it will be recoverable for 30 days. If the
+     * conversion source is a Google Analytics Link, it will be deleted
+     * immediately and can be restored by creating a new one.
+     * 
+ */ + public void deleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Re-enables an archived conversion source. Only Available for Merchant
+     * Center Destination conversion sources.
+     * 
+ */ + public void undeleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public void getConversionSource( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves the list of conversion sources the caller has access to.
+     * 
+ */ + public void listConversionSources( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListConversionSourcesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ConversionSourcesService. + * + *
+   * Service for managing conversion sources for a merchant account.
+   * 
+ */ + public static final class ConversionSourcesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ConversionSourcesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversionSourcesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new conversion source.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource createConversionSource( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates information of an existing conversion source. Available only for
+     * Merchant Center Destination conversion sources.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource updateConversionSource( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Archives an existing conversion source. If the conversion source is a
+     * Merchant Center Destination, it will be recoverable for 30 days. If the
+     * conversion source is a Google Analytics Link, it will be deleted
+     * immediately and can be restored by creating a new one.
+     * 
+ */ + public com.google.protobuf.Empty deleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Re-enables an archived conversion source. Only Available for Merchant
+     * Center Destination conversion sources.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource + undeleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the list of conversion sources the caller has access to.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + listConversionSources( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConversionSourcesMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * ConversionSourcesService. + * + *
+   * Service for managing conversion sources for a merchant account.
+   * 
+ */ + public static final class ConversionSourcesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ConversionSourcesServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversionSourcesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new conversion source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + createConversionSource( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateConversionSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates information of an existing conversion source. Available only for
+     * Merchant Center Destination conversion sources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + updateConversionSource( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateConversionSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Archives an existing conversion source. If the conversion source is a
+     * Merchant Center Destination, it will be recoverable for 30 days. If the
+     * conversion source is a Google Analytics Link, it will be deleted
+     * immediately and can be restored by creating a new one.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteConversionSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Re-enables an archived conversion source. Only Available for Merchant
+     * Center Destination conversion sources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + undeleteConversionSource( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeleteConversionSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.conversions.v1beta.ConversionSource> + getConversionSource( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetConversionSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves the list of conversion sources the caller has access to.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse> + listConversionSources( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListConversionSourcesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_CONVERSION_SOURCE = 0; + private static final int METHODID_UPDATE_CONVERSION_SOURCE = 1; + private static final int METHODID_DELETE_CONVERSION_SOURCE = 2; + private static final int METHODID_UNDELETE_CONVERSION_SOURCE = 3; + private static final int METHODID_GET_CONVERSION_SOURCE = 4; + private static final int METHODID_LIST_CONVERSION_SOURCES = 5; + + 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_CREATE_CONVERSION_SOURCE: + serviceImpl.createConversionSource( + (com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource>) + responseObserver); + break; + case METHODID_UPDATE_CONVERSION_SOURCE: + serviceImpl.updateConversionSource( + (com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource>) + responseObserver); + break; + case METHODID_DELETE_CONVERSION_SOURCE: + serviceImpl.deleteConversionSource( + (com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_CONVERSION_SOURCE: + serviceImpl.undeleteConversionSource( + (com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource>) + responseObserver); + break; + case METHODID_GET_CONVERSION_SOURCE: + serviceImpl.getConversionSource( + (com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta.ConversionSource>) + responseObserver); + break; + case METHODID_LIST_CONVERSION_SOURCES: + serviceImpl.listConversionSources( + (com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1beta + .ListConversionSourcesResponse>) + 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( + getCreateConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource>( + service, METHODID_CREATE_CONVERSION_SOURCE))) + .addMethod( + getUpdateConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource>( + service, METHODID_UPDATE_CONVERSION_SOURCE))) + .addMethod( + getDeleteConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_CONVERSION_SOURCE))) + .addMethod( + getUndeleteConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource>( + service, METHODID_UNDELETE_CONVERSION_SOURCE))) + .addMethod( + getGetConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1beta.ConversionSource>( + service, METHODID_GET_CONVERSION_SOURCE))) + .addMethod( + getListConversionSourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse>( + service, METHODID_LIST_CONVERSION_SOURCES))) + .build(); + } + + private abstract static class ConversionSourcesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConversionSourcesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConversionSourcesService"); + } + } + + private static final class ConversionSourcesServiceFileDescriptorSupplier + extends ConversionSourcesServiceBaseDescriptorSupplier { + ConversionSourcesServiceFileDescriptorSupplier() {} + } + + private static final class ConversionSourcesServiceMethodDescriptorSupplier + extends ConversionSourcesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ConversionSourcesServiceMethodDescriptorSupplier(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 (ConversionSourcesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConversionSourcesServiceFileDescriptorSupplier()) + .addMethod(getCreateConversionSourceMethod()) + .addMethod(getUpdateConversionSourceMethod()) + .addMethod(getDeleteConversionSourceMethod()) + .addMethod(getUndeleteConversionSourceMethod()) + .addMethod(getGetConversionSourceMethod()) + .addMethod(getListConversionSourcesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-conversions/owlbot.py b/java-shopping-merchant-conversions/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-shopping-merchant-conversions/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-shopping-merchant-conversions/pom.xml b/java-shopping-merchant-conversions/pom.xml new file mode 100644 index 000000000000..f3f6c7dd75c3 --- /dev/null +++ b/java-shopping-merchant-conversions/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-conversions-parent + pom + 0.0.1-SNAPSHOT + Google Merchant Conversions API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.36.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-shopping-merchant-conversions-parent + + + + + + com.google.shopping + google-shopping-merchant-conversions + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-shopping-merchant-conversions + grpc-google-shopping-merchant-conversions-v1beta + proto-google-shopping-merchant-conversions-v1beta + google-shopping-merchant-conversions-bom + + + diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/clirr-ignored-differences.xml b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..77cb3c019513 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/shopping/merchant/conversions/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/conversions/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/conversions/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/pom.xml b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/pom.xml new file mode 100644 index 000000000000..51fbe4f6388f --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1beta + 0.0.1-SNAPSHOT + proto-google-shopping-merchant-conversions-v1beta + Proto library for google-shopping-merchant-conversions + + com.google.shopping + google-shopping-merchant-conversions-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-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AccountName.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AccountName.java new file mode 100644 index 000000000000..5c641061372c --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AccountName.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.shopping.merchant.conversions.v1beta; + +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 AccountName implements ResourceName { + private static final PathTemplate ACCOUNT = + PathTemplate.createWithoutUrlEncoding("accounts/{account}"); + private volatile Map fieldValuesMap; + private final String account; + + @Deprecated + protected AccountName() { + account = null; + } + + private AccountName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + } + + public String getAccount() { + return account; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccountName of(String account) { + return newBuilder().setAccount(account).build(); + } + + public static String format(String account) { + return newBuilder().setAccount(account).build().toString(); + } + + public static AccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT.validatedMatch( + formattedString, "AccountName.parse: formattedString not in valid format"); + return of(matchMap.get("account")); + } + + 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 (AccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT.instantiate("account", account); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccountName that = ((AccountName) o); + return Objects.equals(this.account, that.account); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + return h; + } + + /** Builder for accounts/{account}. */ + public static class Builder { + private String account; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + private Builder(AccountName accountName) { + this.account = accountName.account; + } + + public AccountName build() { + return new AccountName(this); + } + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettings.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettings.java new file mode 100644 index 000000000000..9c636b1be92d --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettings.java @@ -0,0 +1,2450 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Represents attribution settings for conversion sources receiving
+ * pre-attribution data.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.AttributionSettings} + */ +public final class AttributionSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.AttributionSettings) + AttributionSettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AttributionSettings.newBuilder() to construct. + private AttributionSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttributionSettings() { + attributionModel_ = 0; + conversionType_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttributionSettings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.class, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder.class); + } + + /** + * + * + *
+   * The attribution model used for this source. We support the same set of
+   * models offered by Google Analytics 4, as described in:
+   * https://support.google.com/analytics/answer/10596866.
+   * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel} + */ + public enum AttributionModel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified model.
+     * 
+ * + * ATTRIBUTION_MODEL_UNSPECIFIED = 0; + */ + ATTRIBUTION_MODEL_UNSPECIFIED(0), + /** + * + * + *
+     * Cross-channel Last Click model.
+     * 
+ * + * CROSS_CHANNEL_LAST_CLICK = 1; + */ + CROSS_CHANNEL_LAST_CLICK(1), + /** + * + * + *
+     * Ads-preferred Last Click model.
+     * 
+ * + * ADS_PREFERRED_LAST_CLICK = 2; + */ + ADS_PREFERRED_LAST_CLICK(2), + /** + * + * + *
+     * Cross-channel Data Driven model.
+     * 
+ * + * CROSS_CHANNEL_DATA_DRIVEN = 5; + */ + CROSS_CHANNEL_DATA_DRIVEN(5), + /** + * + * + *
+     * Cross-channel First Click model.
+     * 
+ * + * CROSS_CHANNEL_FIRST_CLICK = 6; + */ + CROSS_CHANNEL_FIRST_CLICK(6), + /** + * + * + *
+     * Cross-channel Linear model.
+     * 
+ * + * CROSS_CHANNEL_LINEAR = 7; + */ + CROSS_CHANNEL_LINEAR(7), + /** + * + * + *
+     * Cross-channel Position Based model.
+     * 
+ * + * CROSS_CHANNEL_POSITION_BASED = 8; + */ + CROSS_CHANNEL_POSITION_BASED(8), + /** + * + * + *
+     * Cross-channel Time Decay model.
+     * 
+ * + * CROSS_CHANNEL_TIME_DECAY = 9; + */ + CROSS_CHANNEL_TIME_DECAY(9), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified model.
+     * 
+ * + * ATTRIBUTION_MODEL_UNSPECIFIED = 0; + */ + public static final int ATTRIBUTION_MODEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Cross-channel Last Click model.
+     * 
+ * + * CROSS_CHANNEL_LAST_CLICK = 1; + */ + public static final int CROSS_CHANNEL_LAST_CLICK_VALUE = 1; + /** + * + * + *
+     * Ads-preferred Last Click model.
+     * 
+ * + * ADS_PREFERRED_LAST_CLICK = 2; + */ + public static final int ADS_PREFERRED_LAST_CLICK_VALUE = 2; + /** + * + * + *
+     * Cross-channel Data Driven model.
+     * 
+ * + * CROSS_CHANNEL_DATA_DRIVEN = 5; + */ + public static final int CROSS_CHANNEL_DATA_DRIVEN_VALUE = 5; + /** + * + * + *
+     * Cross-channel First Click model.
+     * 
+ * + * CROSS_CHANNEL_FIRST_CLICK = 6; + */ + public static final int CROSS_CHANNEL_FIRST_CLICK_VALUE = 6; + /** + * + * + *
+     * Cross-channel Linear model.
+     * 
+ * + * CROSS_CHANNEL_LINEAR = 7; + */ + public static final int CROSS_CHANNEL_LINEAR_VALUE = 7; + /** + * + * + *
+     * Cross-channel Position Based model.
+     * 
+ * + * CROSS_CHANNEL_POSITION_BASED = 8; + */ + public static final int CROSS_CHANNEL_POSITION_BASED_VALUE = 8; + /** + * + * + *
+     * Cross-channel Time Decay model.
+     * 
+ * + * CROSS_CHANNEL_TIME_DECAY = 9; + */ + public static final int CROSS_CHANNEL_TIME_DECAY_VALUE = 9; + + 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 AttributionModel 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 AttributionModel forNumber(int value) { + switch (value) { + case 0: + return ATTRIBUTION_MODEL_UNSPECIFIED; + case 1: + return CROSS_CHANNEL_LAST_CLICK; + case 2: + return ADS_PREFERRED_LAST_CLICK; + case 5: + return CROSS_CHANNEL_DATA_DRIVEN; + case 6: + return CROSS_CHANNEL_FIRST_CLICK; + case 7: + return CROSS_CHANNEL_LINEAR; + case 8: + return CROSS_CHANNEL_POSITION_BASED; + case 9: + return CROSS_CHANNEL_TIME_DECAY; + 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 AttributionModel findValueByNumber(int number) { + return AttributionModel.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.shopping.merchant.conversions.v1beta.AttributionSettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AttributionModel[] VALUES = values(); + + public static AttributionModel 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 AttributionModel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel) + } + + public interface ConversionTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Conversion event name, as it'll be reported by the client.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Output only. Conversion event name, as it'll be reported by the client.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Output only. Option indicating if the type should be included in Merchant
+     * Center reporting.
+     * 
+ * + * bool report = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The report. + */ + boolean getReport(); + } + /** + * + * + *
+   * Message representing a types of conversion events
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType} + */ + public static final class ConversionType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + ConversionTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversionType.newBuilder() to construct. + private ConversionType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversionType() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversionType(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .class, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Conversion event name, as it'll be reported by the client.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. Conversion event name, as it'll be reported by the client.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 REPORT_FIELD_NUMBER = 2; + private boolean report_ = false; + /** + * + * + *
+     * Output only. Option indicating if the type should be included in Merchant
+     * Center reporting.
+     * 
+ * + * bool report = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The report. + */ + @java.lang.Override + public boolean getReport() { + return report_; + } + + 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 (report_ != false) { + output.writeBool(2, report_); + } + 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 (report_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, report_); + } + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType other = + (com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) obj; + + if (!getName().equals(other.getName())) return false; + if (getReport() != other.getReport()) 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) + REPORT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReport()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + 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; + } + /** + * + * + *
+     * Message representing a types of conversion events
+     * 
+ * + * Protobuf type {@code + * google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .class, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + report_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + build() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType result = + new com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.report_ = report_; + } + } + + @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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getReport() != false) { + setReport(other.getReport()); + } + 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 16: + { + report_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + 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_ = ""; + /** + * + * + *
+       * Output only. Conversion event name, as it'll be reported by the client.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+       * Output only. Conversion event name, as it'll be reported by the client.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+       * Output only. Conversion event name, as it'll be reported by the client.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+       * Output only. Conversion event name, as it'll be reported by the client.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Conversion event name, as it'll be reported by the client.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 boolean report_; + /** + * + * + *
+       * Output only. Option indicating if the type should be included in Merchant
+       * Center reporting.
+       * 
+ * + * bool report = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The report. + */ + @java.lang.Override + public boolean getReport() { + return report_; + } + /** + * + * + *
+       * Output only. Option indicating if the type should be included in Merchant
+       * Center reporting.
+       * 
+ * + * bool report = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The report to set. + * @return This builder for chaining. + */ + public Builder setReport(boolean value) { + + report_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Option indicating if the type should be included in Merchant
+       * Center reporting.
+       * 
+ * + * bool report = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReport() { + bitField0_ = (bitField0_ & ~0x00000002); + report_ = false; + 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType) + private static final com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionType + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType(); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversionType 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.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ATTRIBUTION_LOOKBACK_WINDOW_DAYS_FIELD_NUMBER = 1; + private int attributionLookbackWindowDays_ = 0; + /** + * + * + *
+   * Required. Lookback windows (in days) used for attribution in this source.
+   * Supported values are 7, 30, 40.
+   * 
+ * + * int32 attribution_lookback_window_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionLookbackWindowDays. + */ + @java.lang.Override + public int getAttributionLookbackWindowDays() { + return attributionLookbackWindowDays_; + } + + public static final int ATTRIBUTION_MODEL_FIELD_NUMBER = 2; + private int attributionModel_ = 0; + /** + * + * + *
+   * Required. Attribution model.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for attributionModel. + */ + @java.lang.Override + public int getAttributionModelValue() { + return attributionModel_; + } + /** + * + * + *
+   * Required. Attribution model.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + getAttributionModel() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel result = + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .forNumber(attributionModel_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .UNRECOGNIZED + : result; + } + + public static final int CONVERSION_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType> + conversionType_; + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType> + getConversionTypeList() { + return conversionType_; + } + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder> + getConversionTypeOrBuilderList() { + return conversionType_; + } + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public int getConversionTypeCount() { + return conversionType_.size(); + } + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getConversionType(int index) { + return conversionType_.get(index); + } + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionTypeOrBuilder + getConversionTypeOrBuilder(int index) { + return conversionType_.get(index); + } + + 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 (attributionLookbackWindowDays_ != 0) { + output.writeInt32(1, attributionLookbackWindowDays_); + } + if (attributionModel_ + != com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .ATTRIBUTION_MODEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, attributionModel_); + } + for (int i = 0; i < conversionType_.size(); i++) { + output.writeMessage(3, conversionType_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attributionLookbackWindowDays_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(1, attributionLookbackWindowDays_); + } + if (attributionModel_ + != com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .ATTRIBUTION_MODEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, attributionModel_); + } + for (int i = 0; i < conversionType_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, conversionType_.get(i)); + } + 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.shopping.merchant.conversions.v1beta.AttributionSettings)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.AttributionSettings other = + (com.google.shopping.merchant.conversions.v1beta.AttributionSettings) obj; + + if (getAttributionLookbackWindowDays() != other.getAttributionLookbackWindowDays()) + return false; + if (attributionModel_ != other.attributionModel_) return false; + if (!getConversionTypeList().equals(other.getConversionTypeList())) 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) + ATTRIBUTION_LOOKBACK_WINDOW_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getAttributionLookbackWindowDays(); + hash = (37 * hash) + ATTRIBUTION_MODEL_FIELD_NUMBER; + hash = (53 * hash) + attributionModel_; + if (getConversionTypeCount() > 0) { + hash = (37 * hash) + CONVERSION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getConversionTypeList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings 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.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings 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.shopping.merchant.conversions.v1beta.AttributionSettings + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings + 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.shopping.merchant.conversions.v1beta.AttributionSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings 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.shopping.merchant.conversions.v1beta.AttributionSettings 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; + } + /** + * + * + *
+   * Represents attribution settings for conversion sources receiving
+   * pre-attribution data.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.AttributionSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.AttributionSettings) + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.class, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.AttributionSettings.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + attributionLookbackWindowDays_ = 0; + attributionModel_ = 0; + if (conversionTypeBuilder_ == null) { + conversionType_ = java.util.Collections.emptyList(); + } else { + conversionType_ = null; + conversionTypeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings build() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings buildPartial() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings result = + new com.google.shopping.merchant.conversions.v1beta.AttributionSettings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings result) { + if (conversionTypeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + conversionType_ = java.util.Collections.unmodifiableList(conversionType_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.conversionType_ = conversionType_; + } else { + result.conversionType_ = conversionTypeBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.attributionLookbackWindowDays_ = attributionLookbackWindowDays_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributionModel_ = attributionModel_; + } + } + + @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.shopping.merchant.conversions.v1beta.AttributionSettings) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.AttributionSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance()) return this; + if (other.getAttributionLookbackWindowDays() != 0) { + setAttributionLookbackWindowDays(other.getAttributionLookbackWindowDays()); + } + if (other.attributionModel_ != 0) { + setAttributionModelValue(other.getAttributionModelValue()); + } + if (conversionTypeBuilder_ == null) { + if (!other.conversionType_.isEmpty()) { + if (conversionType_.isEmpty()) { + conversionType_ = other.conversionType_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureConversionTypeIsMutable(); + conversionType_.addAll(other.conversionType_); + } + onChanged(); + } + } else { + if (!other.conversionType_.isEmpty()) { + if (conversionTypeBuilder_.isEmpty()) { + conversionTypeBuilder_.dispose(); + conversionTypeBuilder_ = null; + conversionType_ = other.conversionType_; + bitField0_ = (bitField0_ & ~0x00000004); + conversionTypeBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConversionTypeFieldBuilder() + : null; + } else { + conversionTypeBuilder_.addAllMessages(other.conversionType_); + } + } + } + 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 8: + { + attributionLookbackWindowDays_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + attributionModel_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + m = + input.readMessage( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionType.parser(), + extensionRegistry); + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + conversionType_.add(m); + } else { + conversionTypeBuilder_.addMessage(m); + } + 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 int attributionLookbackWindowDays_; + /** + * + * + *
+     * Required. Lookback windows (in days) used for attribution in this source.
+     * Supported values are 7, 30, 40.
+     * 
+ * + * int32 attribution_lookback_window_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionLookbackWindowDays. + */ + @java.lang.Override + public int getAttributionLookbackWindowDays() { + return attributionLookbackWindowDays_; + } + /** + * + * + *
+     * Required. Lookback windows (in days) used for attribution in this source.
+     * Supported values are 7, 30, 40.
+     * 
+ * + * int32 attribution_lookback_window_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The attributionLookbackWindowDays to set. + * @return This builder for chaining. + */ + public Builder setAttributionLookbackWindowDays(int value) { + + attributionLookbackWindowDays_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Lookback windows (in days) used for attribution in this source.
+     * Supported values are 7, 30, 40.
+     * 
+ * + * int32 attribution_lookback_window_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAttributionLookbackWindowDays() { + bitField0_ = (bitField0_ & ~0x00000001); + attributionLookbackWindowDays_ = 0; + onChanged(); + return this; + } + + private int attributionModel_ = 0; + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for attributionModel. + */ + @java.lang.Override + public int getAttributionModelValue() { + return attributionModel_; + } + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for attributionModel to set. + * @return This builder for chaining. + */ + public Builder setAttributionModelValue(int value) { + attributionModel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + getAttributionModel() { + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel result = + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .forNumber(attributionModel_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The attributionModel to set. + * @return This builder for chaining. + */ + public Builder setAttributionModel( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + attributionModel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearAttributionModel() { + bitField0_ = (bitField0_ & ~0x00000002); + attributionModel_ = 0; + onChanged(); + return this; + } + + private java.util.List< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType> + conversionType_ = java.util.Collections.emptyList(); + + private void ensureConversionTypeIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + conversionType_ = + new java.util.ArrayList< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType>( + conversionType_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder> + conversionTypeBuilder_; + + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType> + getConversionTypeList() { + if (conversionTypeBuilder_ == null) { + return java.util.Collections.unmodifiableList(conversionType_); + } else { + return conversionTypeBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public int getConversionTypeCount() { + if (conversionTypeBuilder_ == null) { + return conversionType_.size(); + } else { + return conversionTypeBuilder_.getCount(); + } + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getConversionType(int index) { + if (conversionTypeBuilder_ == null) { + return conversionType_.get(index); + } else { + return conversionTypeBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setConversionType( + int index, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType value) { + if (conversionTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionTypeIsMutable(); + conversionType_.set(index, value); + onChanged(); + } else { + conversionTypeBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setConversionType( + int index, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType.Builder + builderForValue) { + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + conversionType_.set(index, builderForValue.build()); + onChanged(); + } else { + conversionTypeBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType value) { + if (conversionTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionTypeIsMutable(); + conversionType_.add(value); + onChanged(); + } else { + conversionTypeBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + int index, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType value) { + if (conversionTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionTypeIsMutable(); + conversionType_.add(index, value); + onChanged(); + } else { + conversionTypeBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType.Builder + builderForValue) { + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + conversionType_.add(builderForValue.build()); + onChanged(); + } else { + conversionTypeBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + int index, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType.Builder + builderForValue) { + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + conversionType_.add(index, builderForValue.build()); + onChanged(); + } else { + conversionTypeBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAllConversionType( + java.lang.Iterable< + ? extends + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionType> + values) { + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conversionType_); + onChanged(); + } else { + conversionTypeBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearConversionType() { + if (conversionTypeBuilder_ == null) { + conversionType_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + conversionTypeBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder removeConversionType(int index) { + if (conversionTypeBuilder_ == null) { + ensureConversionTypeIsMutable(); + conversionType_.remove(index); + onChanged(); + } else { + conversionTypeBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder + getConversionTypeBuilder(int index) { + return getConversionTypeFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder + getConversionTypeOrBuilder(int index) { + if (conversionTypeBuilder_ == null) { + return conversionType_.get(index); + } else { + return conversionTypeBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List< + ? extends + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder> + getConversionTypeOrBuilderList() { + if (conversionTypeBuilder_ != null) { + return conversionTypeBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversionType_); + } + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder + addConversionTypeBuilder() { + return getConversionTypeFieldBuilder() + .addBuilder( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .getDefaultInstance()); + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder + addConversionTypeBuilder(int index) { + return getConversionTypeFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .getDefaultInstance()); + } + /** + * + * + *
+     * Immutable. Unordered list. List of different conversion types a conversion
+     * event can be classified as. A standard "purchase" type will be
+     * automatically created if this list is empty at creation time.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder> + getConversionTypeBuilderList() { + return getConversionTypeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder> + getConversionTypeFieldBuilder() { + if (conversionTypeBuilder_ == null) { + conversionTypeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + .Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder>( + conversionType_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + conversionType_ = null; + } + return conversionTypeBuilder_; + } + + @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.shopping.merchant.conversions.v1beta.AttributionSettings) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.AttributionSettings) + private static final com.google.shopping.merchant.conversions.v1beta.AttributionSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1beta.AttributionSettings(); + } + + public static com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttributionSettings 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.shopping.merchant.conversions.v1beta.AttributionSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettingsOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettingsOrBuilder.java new file mode 100644 index 000000000000..8e256e347c13 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/AttributionSettingsOrBuilder.java @@ -0,0 +1,149 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface AttributionSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.AttributionSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Lookback windows (in days) used for attribution in this source.
+   * Supported values are 7, 30, 40.
+   * 
+ * + * int32 attribution_lookback_window_days = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionLookbackWindowDays. + */ + int getAttributionLookbackWindowDays(); + + /** + * + * + *
+   * Required. Attribution model.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for attributionModel. + */ + int getAttributionModelValue(); + /** + * + * + *
+   * Required. Attribution model.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.AttributionModel + getAttributionModel(); + + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List + getConversionTypeList(); + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType + getConversionType(int index); + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + int getConversionTypeCount(); + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List< + ? extends + com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .ConversionTypeOrBuilder> + getConversionTypeOrBuilderList(); + /** + * + * + *
+   * Immutable. Unordered list. List of different conversion types a conversion
+   * event can be classified as. A standard "purchase" type will be
+   * automatically created if this list is empty at creation time.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.ConversionTypeOrBuilder + getConversionTypeOrBuilder(int index); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSource.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSource.java new file mode 100644 index 000000000000..e2b19bd3f73c --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSource.java @@ -0,0 +1,2469 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Represents a conversion source owned by a Merchant account. A merchant
+ * account can have up to 200 conversion sources.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ConversionSource} + */ +public final class ConversionSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.ConversionSource) + ConversionSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConversionSource.newBuilder() to construct. + private ConversionSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConversionSource() { + name_ = ""; + state_ = 0; + controller_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConversionSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder.class); + } + + /** + * + * + *
+   * Represents state of the conversion source.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.conversions.v1beta.ConversionSource.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Conversion source has unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Conversion source is fully functional.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Conversion source has been archived in the last 30 days and not
+     * currently functional. Can be restored using the undelete method.
+     * 
+ * + * ARCHIVED = 2; + */ + ARCHIVED(2), + /** + * + * + *
+     * Conversion source creation has started but not fully finished yet.
+     * 
+ * + * PENDING = 3; + */ + PENDING(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Conversion source has unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Conversion source is fully functional.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Conversion source has been archived in the last 30 days and not
+     * currently functional. Can be restored using the undelete method.
+     * 
+ * + * ARCHIVED = 2; + */ + public static final int ARCHIVED_VALUE = 2; + /** + * + * + *
+     * Conversion source creation has started but not fully finished yet.
+     * 
+ * + * PENDING = 3; + */ + public static final int PENDING_VALUE = 3; + + 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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return ARCHIVED; + case 3: + return PENDING; + 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 State findValueByNumber(int number) { + return State.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.shopping.merchant.conversions.v1beta.ConversionSource.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.conversions.v1beta.ConversionSource.State) + } + + /** + * + * + *
+   * Entity controlling the conversion source.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.conversions.v1beta.ConversionSource.Controller} + */ + public enum Controller implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * CONTROLLER_UNSPECIFIED = 0; + */ + CONTROLLER_UNSPECIFIED(0), + /** + * + * + *
+     * Controlled by the Merchant who owns the Conversion Source.
+     * 
+ * + * MERCHANT = 1; + */ + MERCHANT(1), + /** + * + * + *
+     * Controlled by the YT Affiliates program.
+     * 
+ * + * YOUTUBE_AFFILIATES = 2; + */ + YOUTUBE_AFFILIATES(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is unused.
+     * 
+ * + * CONTROLLER_UNSPECIFIED = 0; + */ + public static final int CONTROLLER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Controlled by the Merchant who owns the Conversion Source.
+     * 
+ * + * MERCHANT = 1; + */ + public static final int MERCHANT_VALUE = 1; + /** + * + * + *
+     * Controlled by the YT Affiliates program.
+     * 
+ * + * YOUTUBE_AFFILIATES = 2; + */ + public static final int YOUTUBE_AFFILIATES_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 Controller 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 Controller forNumber(int value) { + switch (value) { + case 0: + return CONTROLLER_UNSPECIFIED; + case 1: + return MERCHANT; + case 2: + return YOUTUBE_AFFILIATES; + 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 Controller findValueByNumber(int number) { + return Controller.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.shopping.merchant.conversions.v1beta.ConversionSource.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final Controller[] VALUES = values(); + + public static Controller 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 Controller(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.conversions.v1beta.ConversionSource.Controller) + } + + private int bitField0_; + private int sourceDataCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object sourceData_; + + public enum SourceDataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GOOGLE_ANALYTICS_LINK(3), + MERCHANT_CENTER_DESTINATION(4), + SOURCEDATA_NOT_SET(0); + private final int value; + + private SourceDataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceDataCase valueOf(int value) { + return forNumber(value); + } + + public static SourceDataCase forNumber(int value) { + switch (value) { + case 3: + return GOOGLE_ANALYTICS_LINK; + case 4: + return MERCHANT_CENTER_DESTINATION; + case 0: + return SOURCEDATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceDataCase getSourceDataCase() { + return SourceDataCase.forNumber(sourceDataCase_); + } + + public static final int GOOGLE_ANALYTICS_LINK_FIELD_NUMBER = 3; + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the googleAnalyticsLink field is set. + */ + @java.lang.Override + public boolean hasGoogleAnalyticsLink() { + return sourceDataCase_ == 3; + } + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + getGoogleAnalyticsLink() { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.getDefaultInstance(); + } + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder() { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.getDefaultInstance(); + } + + public static final int MERCHANT_CENTER_DESTINATION_FIELD_NUMBER = 4; + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return Whether the merchantCenterDestination field is set. + */ + @java.lang.Override + public boolean hasMerchantCenterDestination() { + return sourceDataCase_ == 4; + } + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getMerchantCenterDestination() { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder + getMerchantCenterDestinationOrBuilder() { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Identifier. Generated by the Content API upon creation of a
+   * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+   * colon represent the type of conversio source. Content after the colon
+   * represents the ID of the conversion source within that type. The ID of two
+   * different conversion sources might be the same across different types. The
+   * following type prefixes are supported:
+   * - galk: For GoogleAnalyticsLink sources.
+   * - mcdn: For MerchantCenterDestination sources.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+   * Output only. Identifier. Generated by the Content API upon creation of a
+   * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+   * colon represent the type of conversio source. Content after the colon
+   * represents the ID of the conversion source within that type. The ID of two
+   * different conversion sources might be the same across different types. The
+   * following type prefixes are supported:
+   * - galk: For GoogleAnalyticsLink sources.
+   * - mcdn: For MerchantCenterDestination sources.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. Current state of this conversion source. Can't be edited
+   * through the API.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. Current state of this conversion source. Can't be edited
+   * through the API.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.State getState() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State result = + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.forNumber(state_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.UNRECOGNIZED + : result; + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp expireTime_; + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; + } + + public static final int CONTROLLER_FIELD_NUMBER = 7; + private int controller_ = 0; + /** + * + * + *
+   * Output only. Controller of the conversion source.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for controller. + */ + @java.lang.Override + public int getControllerValue() { + return controller_; + } + /** + * + * + *
+   * Output only. Controller of the conversion source.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller + getController() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller result = + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller.forNumber( + controller_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller.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 (sourceDataCase_ == 3) { + output.writeMessage( + 3, (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_); + } + if (sourceDataCase_ == 4) { + output.writeMessage( + 4, + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) sourceData_); + } + if (state_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, state_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getExpireTime()); + } + if (controller_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller + .CONTROLLER_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, controller_); + } + 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 (sourceDataCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_); + } + if (sourceDataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_); + } + if (state_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getExpireTime()); + } + if (controller_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller + .CONTROLLER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, controller_); + } + 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.shopping.merchant.conversions.v1beta.ConversionSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.ConversionSource other = + (com.google.shopping.merchant.conversions.v1beta.ConversionSource) obj; + + if (!getName().equals(other.getName())) return false; + if (state_ != other.state_) return false; + if (hasExpireTime() != other.hasExpireTime()) return false; + if (hasExpireTime()) { + if (!getExpireTime().equals(other.getExpireTime())) return false; + } + if (controller_ != other.controller_) return false; + if (!getSourceDataCase().equals(other.getSourceDataCase())) return false; + switch (sourceDataCase_) { + case 3: + if (!getGoogleAnalyticsLink().equals(other.getGoogleAnalyticsLink())) return false; + break; + case 4: + if (!getMerchantCenterDestination().equals(other.getMerchantCenterDestination())) + return false; + break; + case 0: + default: + } + 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasExpireTime()) { + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + } + hash = (37 * hash) + CONTROLLER_FIELD_NUMBER; + hash = (53 * hash) + controller_; + switch (sourceDataCase_) { + case 3: + hash = (37 * hash) + GOOGLE_ANALYTICS_LINK_FIELD_NUMBER; + hash = (53 * hash) + getGoogleAnalyticsLink().hashCode(); + break; + case 4: + hash = (37 * hash) + MERCHANT_CENTER_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getMerchantCenterDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource 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.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource 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.shopping.merchant.conversions.v1beta.ConversionSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource 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.shopping.merchant.conversions.v1beta.ConversionSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource 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.shopping.merchant.conversions.v1beta.ConversionSource 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; + } + /** + * + * + *
+   * Represents a conversion source owned by a Merchant account. A merchant
+   * account can have up to 200 conversion sources.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ConversionSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.ConversionSource) + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.class, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder.class); + } + + // Construct using com.google.shopping.merchant.conversions.v1beta.ConversionSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExpireTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (googleAnalyticsLinkBuilder_ != null) { + googleAnalyticsLinkBuilder_.clear(); + } + if (merchantCenterDestinationBuilder_ != null) { + merchantCenterDestinationBuilder_.clear(); + } + name_ = ""; + state_ = 0; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + controller_ = 0; + sourceDataCase_ = 0; + sourceData_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource build() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource buildPartial() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource result = + new com.google.shopping.merchant.conversions.v1beta.ConversionSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.ConversionSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.expireTime_ = expireTimeBuilder_ == null ? expireTime_ : expireTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.controller_ = controller_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs( + com.google.shopping.merchant.conversions.v1beta.ConversionSource result) { + result.sourceDataCase_ = sourceDataCase_; + result.sourceData_ = this.sourceData_; + if (sourceDataCase_ == 3 && googleAnalyticsLinkBuilder_ != null) { + result.sourceData_ = googleAnalyticsLinkBuilder_.build(); + } + if (sourceDataCase_ == 4 && merchantCenterDestinationBuilder_ != null) { + result.sourceData_ = merchantCenterDestinationBuilder_.build(); + } + } + + @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.shopping.merchant.conversions.v1beta.ConversionSource) { + return mergeFrom((com.google.shopping.merchant.conversions.v1beta.ConversionSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.ConversionSource other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasExpireTime()) { + mergeExpireTime(other.getExpireTime()); + } + if (other.controller_ != 0) { + setControllerValue(other.getControllerValue()); + } + switch (other.getSourceDataCase()) { + case GOOGLE_ANALYTICS_LINK: + { + mergeGoogleAnalyticsLink(other.getGoogleAnalyticsLink()); + break; + } + case MERCHANT_CENTER_DESTINATION: + { + mergeMerchantCenterDestination(other.getMerchantCenterDestination()); + break; + } + case SOURCEDATA_NOT_SET: + { + break; + } + } + 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_ |= 0x00000004; + break; + } // case 10 + case 26: + { + input.readMessage( + getGoogleAnalyticsLinkFieldBuilder().getBuilder(), extensionRegistry); + sourceDataCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getMerchantCenterDestinationFieldBuilder().getBuilder(), extensionRegistry); + sourceDataCase_ = 4; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 50: + { + input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 56: + { + controller_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 + 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 sourceDataCase_ = 0; + private java.lang.Object sourceData_; + + public SourceDataCase getSourceDataCase() { + return SourceDataCase.forNumber(sourceDataCase_); + } + + public Builder clearSourceData() { + sourceDataCase_ = 0; + sourceData_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder> + googleAnalyticsLinkBuilder_; + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the googleAnalyticsLink field is set. + */ + @java.lang.Override + public boolean hasGoogleAnalyticsLink() { + return sourceDataCase_ == 3; + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + getGoogleAnalyticsLink() { + if (googleAnalyticsLinkBuilder_ == null) { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance(); + } else { + if (sourceDataCase_ == 3) { + return googleAnalyticsLinkBuilder_.getMessage(); + } + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink value) { + if (googleAnalyticsLinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceData_ = value; + onChanged(); + } else { + googleAnalyticsLinkBuilder_.setMessage(value); + } + sourceDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder + builderForValue) { + if (googleAnalyticsLinkBuilder_ == null) { + sourceData_ = builderForValue.build(); + onChanged(); + } else { + googleAnalyticsLinkBuilder_.setMessage(builderForValue.build()); + } + sourceDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink value) { + if (googleAnalyticsLinkBuilder_ == null) { + if (sourceDataCase_ == 3 + && sourceData_ + != com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance()) { + sourceData_ = + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.newBuilder( + (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + sourceData_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceData_ = value; + } + onChanged(); + } else { + if (sourceDataCase_ == 3) { + googleAnalyticsLinkBuilder_.mergeFrom(value); + } else { + googleAnalyticsLinkBuilder_.setMessage(value); + } + } + sourceDataCase_ = 3; + return this; + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearGoogleAnalyticsLink() { + if (googleAnalyticsLinkBuilder_ == null) { + if (sourceDataCase_ == 3) { + sourceDataCase_ = 0; + sourceData_ = null; + onChanged(); + } + } else { + if (sourceDataCase_ == 3) { + sourceDataCase_ = 0; + sourceData_ = null; + } + googleAnalyticsLinkBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder + getGoogleAnalyticsLinkBuilder() { + return getGoogleAnalyticsLinkFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder() { + if ((sourceDataCase_ == 3) && (googleAnalyticsLinkBuilder_ != null)) { + return googleAnalyticsLinkBuilder_.getMessageOrBuilder(); + } else { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder> + getGoogleAnalyticsLinkFieldBuilder() { + if (googleAnalyticsLinkBuilder_ == null) { + if (!(sourceDataCase_ == 3)) { + sourceData_ = + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance(); + } + googleAnalyticsLinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder>( + (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) sourceData_, + getParentForChildren(), + isClean()); + sourceData_ = null; + } + sourceDataCase_ = 3; + onChanged(); + return googleAnalyticsLinkBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder> + merchantCenterDestinationBuilder_; + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return Whether the merchantCenterDestination field is set. + */ + @java.lang.Override + public boolean hasMerchantCenterDestination() { + return sourceDataCase_ == 4; + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getMerchantCenterDestination() { + if (merchantCenterDestinationBuilder_ == null) { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } else { + if (sourceDataCase_ == 4) { + return merchantCenterDestinationBuilder_.getMessage(); + } + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder setMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination value) { + if (merchantCenterDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceData_ = value; + onChanged(); + } else { + merchantCenterDestinationBuilder_.setMessage(value); + } + sourceDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder setMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder + builderForValue) { + if (merchantCenterDestinationBuilder_ == null) { + sourceData_ = builderForValue.build(); + onChanged(); + } else { + merchantCenterDestinationBuilder_.setMessage(builderForValue.build()); + } + sourceDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder mergeMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination value) { + if (merchantCenterDestinationBuilder_ == null) { + if (sourceDataCase_ == 4 + && sourceData_ + != com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance()) { + sourceData_ = + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.newBuilder( + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceData_ = value; + } + onChanged(); + } else { + if (sourceDataCase_ == 4) { + merchantCenterDestinationBuilder_.mergeFrom(value); + } else { + merchantCenterDestinationBuilder_.setMessage(value); + } + } + sourceDataCase_ = 4; + return this; + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder clearMerchantCenterDestination() { + if (merchantCenterDestinationBuilder_ == null) { + if (sourceDataCase_ == 4) { + sourceDataCase_ = 0; + sourceData_ = null; + onChanged(); + } + } else { + if (sourceDataCase_ == 4) { + sourceDataCase_ = 0; + sourceData_ = null; + } + merchantCenterDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder + getMerchantCenterDestinationBuilder() { + return getMerchantCenterDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder + getMerchantCenterDestinationOrBuilder() { + if ((sourceDataCase_ == 4) && (merchantCenterDestinationBuilder_ != null)) { + return merchantCenterDestinationBuilder_.getMessageOrBuilder(); + } else { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder> + getMerchantCenterDestinationFieldBuilder() { + if (merchantCenterDestinationBuilder_ == null) { + if (!(sourceDataCase_ == 4)) { + sourceData_ = + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + merchantCenterDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder>( + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + sourceData_, + getParentForChildren(), + isClean()); + sourceData_ = null; + } + sourceDataCase_ = 4; + onChanged(); + return merchantCenterDestinationBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. Identifier. Generated by the Content API upon creation of a
+     * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+     * colon represent the type of conversio source. Content after the colon
+     * represents the ID of the conversion source within that type. The ID of two
+     * different conversion sources might be the same across different types. The
+     * following type prefixes are supported:
+     * - galk: For GoogleAnalyticsLink sources.
+     * - mcdn: For MerchantCenterDestination sources.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Generated by the Content API upon creation of a
+     * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+     * colon represent the type of conversio source. Content after the colon
+     * represents the ID of the conversion source within that type. The ID of two
+     * different conversion sources might be the same across different types. The
+     * following type prefixes are supported:
+     * - galk: For GoogleAnalyticsLink sources.
+     * - mcdn: For MerchantCenterDestination sources.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. Generated by the Content API upon creation of a
+     * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+     * colon represent the type of conversio source. Content after the colon
+     * represents the ID of the conversion source within that type. The ID of two
+     * different conversion sources might be the same across different types. The
+     * following type prefixes are supported:
+     * - galk: For GoogleAnalyticsLink sources.
+     * - mcdn: For MerchantCenterDestination sources.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. Generated by the Content API upon creation of a
+     * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+     * colon represent the type of conversio source. Content after the colon
+     * represents the ID of the conversion source within that type. The ID of two
+     * different conversion sources might be the same across different types. The
+     * following type prefixes are supported:
+     * - galk: For GoogleAnalyticsLink sources.
+     * - mcdn: For MerchantCenterDestination sources.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. Generated by the Content API upon creation of a
+     * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+     * colon represent the type of conversio source. Content after the colon
+     * represents the ID of the conversion source within that type. The ID of two
+     * different conversion sources might be the same across different types. The
+     * following type prefixes are supported:
+     * - galk: For GoogleAnalyticsLink sources.
+     * - mcdn: For MerchantCenterDestination sources.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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_ |= 0x00000004; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.State getState() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State result = + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.forNumber(state_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000008); + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp expireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + public boolean hasExpireTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } else { + return expireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expireTime_ = value; + } else { + expireTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expireTime_ = builderForValue.build(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); + } else { + expireTime_ = value; + } + } else { + expireTimeBuilder_.mergeFrom(value); + } + if (expireTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearExpireTime() { + bitField0_ = (bitField0_ & ~0x00000010); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); + expireTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expireTimeBuilder_ != null) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + return expireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expireTime_; + } + } + /** + * + * + *
+     * Output only. The time when an archived conversion source becomes
+     * permanently deleted and is no longer available to undelete.
+     * 
+ * + * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + private int controller_ = 0; + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for controller. + */ + @java.lang.Override + public int getControllerValue() { + return controller_; + } + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for controller to set. + * @return This builder for chaining. + */ + public Builder setControllerValue(int value) { + controller_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller + getController() { + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller result = + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller.forNumber( + controller_); + return result == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The controller to set. + * @return This builder for chaining. + */ + public Builder setController( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + controller_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearController() { + bitField0_ = (bitField0_ & ~0x00000020); + controller_ = 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.shopping.merchant.conversions.v1beta.ConversionSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.ConversionSource) + private static final com.google.shopping.merchant.conversions.v1beta.ConversionSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1beta.ConversionSource(); + } + + public static com.google.shopping.merchant.conversions.v1beta.ConversionSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConversionSource 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.shopping.merchant.conversions.v1beta.ConversionSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceName.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceName.java new file mode 100644 index 000000000000..6d9dc7e4cb71 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceName.java @@ -0,0 +1,198 @@ +/* + * 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.shopping.merchant.conversions.v1beta; + +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 ConversionSourceName implements ResourceName { + private static final PathTemplate ACCOUNT_CONVERSION_SOURCE = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/conversionSources/{conversion_source}"); + private volatile Map fieldValuesMap; + private final String account; + private final String conversionSource; + + @Deprecated + protected ConversionSourceName() { + account = null; + conversionSource = null; + } + + private ConversionSourceName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + conversionSource = Preconditions.checkNotNull(builder.getConversionSource()); + } + + public String getAccount() { + return account; + } + + public String getConversionSource() { + return conversionSource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ConversionSourceName of(String account, String conversionSource) { + return newBuilder().setAccount(account).setConversionSource(conversionSource).build(); + } + + public static String format(String account, String conversionSource) { + return newBuilder() + .setAccount(account) + .setConversionSource(conversionSource) + .build() + .toString(); + } + + public static ConversionSourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_CONVERSION_SOURCE.validatedMatch( + formattedString, "ConversionSourceName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("conversion_source")); + } + + 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 (ConversionSourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_CONVERSION_SOURCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + if (conversionSource != null) { + fieldMapBuilder.put("conversion_source", conversionSource); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_CONVERSION_SOURCE.instantiate( + "account", account, "conversion_source", conversionSource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ConversionSourceName that = ((ConversionSourceName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.conversionSource, that.conversionSource); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(conversionSource); + return h; + } + + /** Builder for accounts/{account}/conversionSources/{conversion_source}. */ + public static class Builder { + private String account; + private String conversionSource; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getConversionSource() { + return conversionSource; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setConversionSource(String conversionSource) { + this.conversionSource = conversionSource; + return this; + } + + private Builder(ConversionSourceName conversionSourceName) { + this.account = conversionSourceName.account; + this.conversionSource = conversionSourceName.conversionSource; + } + + public ConversionSourceName build() { + return new ConversionSourceName(this); + } + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceOrBuilder.java new file mode 100644 index 000000000000..45aa0dc2f82a --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourceOrBuilder.java @@ -0,0 +1,258 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface ConversionSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.ConversionSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the googleAnalyticsLink field is set. + */ + boolean hasGoogleAnalyticsLink(); + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink getGoogleAnalyticsLink(); + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder(); + + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return Whether the merchantCenterDestination field is set. + */ + boolean hasMerchantCenterDestination(); + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getMerchantCenterDestination(); + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.MerchantCenterDestination merchant_center_destination = 4; + * + */ + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder + getMerchantCenterDestinationOrBuilder(); + + /** + * + * + *
+   * Output only. Identifier. Generated by the Content API upon creation of a
+   * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+   * colon represent the type of conversio source. Content after the colon
+   * represents the ID of the conversion source within that type. The ID of two
+   * different conversion sources might be the same across different types. The
+   * following type prefixes are supported:
+   * - galk: For GoogleAnalyticsLink sources.
+   * - mcdn: For MerchantCenterDestination sources.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Identifier. Generated by the Content API upon creation of a
+   * new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the
+   * colon represent the type of conversio source. Content after the colon
+   * represents the ID of the conversion source within that type. The ID of two
+   * different conversion sources might be the same across different types. The
+   * following type prefixes are supported:
+   * - galk: For GoogleAnalyticsLink sources.
+   * - mcdn: For MerchantCenterDestination sources.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Current state of this conversion source. Can't be edited
+   * through the API.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of this conversion source. Can't be edited
+   * through the API.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSource.State getState(); + + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + /** + * + * + *
+   * Output only. The time when an archived conversion source becomes
+   * permanently deleted and is no longer available to undelete.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Controller of the conversion source.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for controller. + */ + int getControllerValue(); + /** + * + * + *
+   * Output only. Controller of the conversion source.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Controller getController(); + + com.google.shopping.merchant.conversions.v1beta.ConversionSource.SourceDataCase + getSourceDataCase(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesProto.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesProto.java new file mode 100644 index 000000000000..3db69815021a --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ConversionSourcesProto.java @@ -0,0 +1,353 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public final class ConversionSourcesProto { + private ConversionSourcesProto() {} + + 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_shopping_merchant_conversions_v1beta_ConversionSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nCgoogle/shopping/merchant/conversions/v" + + "1beta/conversionsources.proto\022+google.sh" + + "opping.merchant.conversions.v1beta\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\032\033google/pr" + + "otobuf/empty.proto\032 google/protobuf/fiel" + + "d_mask.proto\032\037google/protobuf/timestamp." + + "proto\"\252\006\n\020ConversionSource\022f\n\025google_ana" + + "lytics_link\030\003 \001(\0132@.google.shopping.merc" + + "hant.conversions.v1beta.GoogleAnalyticsL" + + "inkB\003\340A\005H\000\022m\n\033merchant_center_destinatio" + + "n\030\004 \001(\0132F.google.shopping.merchant.conve" + + "rsions.v1beta.MerchantCenterDestinationH" + + "\000\022\024\n\004name\030\001 \001(\tB\006\340A\003\340A\010\022W\n\005state\030\005 \001(\0162C" + + ".google.shopping.merchant.conversions.v1" + + "beta.ConversionSource.StateB\003\340A\003\0224\n\013expi" + + "re_time\030\006 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\022a\n\ncontroller\030\007 \001(\0162H.google.shop" + + "ping.merchant.conversions.v1beta.Convers" + + "ionSource.ControllerB\003\340A\003\"E\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\014\n\010ARCHIVE" + + "D\020\002\022\013\n\007PENDING\020\003\"N\n\nController\022\032\n\026CONTRO" + + "LLER_UNSPECIFIED\020\000\022\014\n\010MERCHANT\020\001\022\026\n\022YOUT" + + "UBE_AFFILIATES\020\002:\220\001\352A\214\001\n+merchantapi.goo" + + "gleapis.com/ConversionSource\0228accounts/{" + + "account}/conversionSources/{conversion_s" + + "ource}*\021conversionSources2\020conversionSou" + + "rceB\r\n\013source_data\"\357\004\n\023AttributionSettin" + + "gs\022-\n attribution_lookback_window_days\030\001" + + " \001(\005B\003\340A\002\022q\n\021attribution_model\030\002 \001(\0162Q.g" + + "oogle.shopping.merchant.conversions.v1be" + + "ta.AttributionSettings.AttributionModelB" + + "\003\340A\002\022p\n\017conversion_type\030\003 \003(\0132O.google.s" + + "hopping.merchant.conversions.v1beta.Attr" + + "ibutionSettings.ConversionTypeB\006\340A\006\340A\005\0328" + + "\n\016ConversionType\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\023\n\006r" + + "eport\030\002 \001(\010B\003\340A\003\"\211\002\n\020AttributionModel\022!\n" + + "\035ATTRIBUTION_MODEL_UNSPECIFIED\020\000\022\034\n\030CROS" + + "S_CHANNEL_LAST_CLICK\020\001\022\034\n\030ADS_PREFERRED_" + + "LAST_CLICK\020\002\022\035\n\031CROSS_CHANNEL_DATA_DRIVE" + + "N\020\005\022\035\n\031CROSS_CHANNEL_FIRST_CLICK\020\006\022\030\n\024CR" + + "OSS_CHANNEL_LINEAR\020\007\022 \n\034CROSS_CHANNEL_PO" + + "SITION_BASED\020\010\022\034\n\030CROSS_CHANNEL_TIME_DEC" + + "AY\020\t\"\256\001\n\023GoogleAnalyticsLink\022\033\n\013property" + + "_id\030\001 \001(\003B\006\340A\002\340A\005\022c\n\024attribution_setting" + + "s\030\002 \001(\0132@.google.shopping.merchant.conve" + + "rsions.v1beta.AttributionSettingsB\003\340A\003\022\025" + + "\n\010property\030\003 \001(\tB\003\340A\003\"\321\001\n\031MerchantCenter" + + "Destination\022\030\n\013destination\030\001 \001(\tB\003\340A\003\022c\n" + + "\024attribution_settings\030\002 \001(\0132@.google.sho" + + "pping.merchant.conversions.v1beta.Attrib" + + "utionSettingsB\003\340A\002\022\031\n\014display_name\030\003 \001(\t" + + "B\003\340A\002\022\032\n\rcurrency_code\030\004 \001(\tB\003\340A\002\"\303\001\n\035Cr" + + "eateConversionSourceRequest\022C\n\006parent\030\001 " + + "\001(\tB3\340A\002\372A-\022+merchantapi.googleapis.com/" + + "ConversionSource\022]\n\021conversion_source\030\002 " + + "\001(\0132=.google.shopping.merchant.conversio" + + "ns.v1beta.ConversionSourceB\003\340A\002\"\264\001\n\035Upda" + + "teConversionSourceRequest\022]\n\021conversion_" + + "source\030\001 \001(\0132=.google.shopping.merchant." + + "conversions.v1beta.ConversionSourceB\003\340A\002" + + "\0224\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMaskB\003\340A\002\"b\n\035DeleteConversionSource" + + "Request\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+merchanta" + + "pi.googleapis.com/ConversionSource\"d\n\037Un" + + "deleteConversionSourceRequest\022A\n\004name\030\001 " + + "\001(\tB3\340A\002\372A-\n+merchantapi.googleapis.com/" + + "ConversionSource\"_\n\032GetConversionSourceR" + + "equest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+merchantap" + + "i.googleapis.com/ConversionSource\"\257\001\n\034Li" + + "stConversionSourcesRequest\022C\n\006parent\030\001 \001" + + "(\tB3\340A\002\372A-\022+merchantapi.googleapis.com/C" + + "onversionSource\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022" + + "\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\031\n\014show_deleted" + + "\030\004 \001(\010B\003\340A\001\"\223\001\n\035ListConversionSourcesRes" + + "ponse\022Y\n\022conversion_sources\030\001 \003(\0132=.goog" + + "le.shopping.merchant.conversions.v1beta." + + "ConversionSource\022\027\n\017next_page_token\030\002 \001(" + + "\t2\322\014\n\030ConversionSourcesService\022\224\002\n\026Creat" + + "eConversionSource\022J.google.shopping.merc" + + "hant.conversions.v1beta.CreateConversion" + + "SourceRequest\032=.google.shopping.merchant" + + ".conversions.v1beta.ConversionSource\"o\332A" + + "\030parent,conversion_source\202\323\344\223\002N\"9/conver" + + "sions/v1beta/{parent=accounts/*}/convers" + + "ionSources:\021conversion_source\022\254\002\n\026Update" + + "ConversionSource\022J.google.shopping.merch" + + "ant.conversions.v1beta.UpdateConversionS" + + "ourceRequest\032=.google.shopping.merchant." + + "conversions.v1beta.ConversionSource\"\206\001\332A" + + "\035conversion_source,update_mask\202\323\344\223\002`2K/c" + + "onversions/v1beta/{conversion_source.nam" + + "e=accounts/*/conversionSources/*}:\021conve" + + "rsion_source\022\306\001\n\026DeleteConversionSource\022" + + "J.google.shopping.merchant.conversions.v" + + "1beta.DeleteConversionSourceRequest\032\026.go" + + "ogle.protobuf.Empty\"H\332A\004name\202\323\344\223\002;*9/con" + + "versions/v1beta/{name=accounts/*/convers" + + "ionSources/*}\022\366\001\n\030UndeleteConversionSour" + + "ce\022L.google.shopping.merchant.conversion" + + "s.v1beta.UndeleteConversionSourceRequest" + + "\032=.google.shopping.merchant.conversions." + + "v1beta.ConversionSource\"M\202\323\344\223\002G\"B/conver" + + "sions/v1beta/{name=accounts/*/conversion" + + "Sources/*}:undelete:\001*\022\347\001\n\023GetConversion" + + "Source\022G.google.shopping.merchant.conver" + + "sions.v1beta.GetConversionSourceRequest\032" + + "=.google.shopping.merchant.conversions.v" + + "1beta.ConversionSource\"H\332A\004name\202\323\344\223\002;\0229/" + + "conversions/v1beta/{name=accounts/*/conv" + + "ersionSources/*}\022\372\001\n\025ListConversionSourc" + + "es\022I.google.shopping.merchant.conversion" + + "s.v1beta.ListConversionSourcesRequest\032J." + + "google.shopping.merchant.conversions.v1b" + + "eta.ListConversionSourcesResponse\"J\332A\006pa" + + "rent\202\323\344\223\002;\0229/conversions/v1beta/{parent=" + + "accounts/*}/conversionSources\032G\312A\032mercha" + + "ntapi.googleapis.com\322A\'https://www.googl" + + "eapis.com/auth/contentB\337\001\n/com.google.sh" + + "opping.merchant.conversions.v1betaB\026Conv" + + "ersionSourcesProtoP\001ZWcloud.google.com/g" + + "o/shopping/merchant/conversions/apiv1bet" + + "a/conversionspb;conversionspb\352A8\n\"mercha" + + "ntapi.googleapis.com/Account\022\022accounts/{" + + "account}b\006proto3" + }; + 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.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_ConversionSource_descriptor, + new java.lang.String[] { + "GoogleAnalyticsLink", + "MerchantCenterDestination", + "Name", + "State", + "ExpireTime", + "Controller", + "SourceData", + }); + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor, + new java.lang.String[] { + "AttributionLookbackWindowDays", "AttributionModel", "ConversionType", + }); + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor = + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_descriptor + .getNestedTypes() + .get(0); + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_AttributionSettings_ConversionType_descriptor, + new java.lang.String[] { + "Name", "Report", + }); + internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor, + new java.lang.String[] { + "PropertyId", "AttributionSettings", "Property", + }); + internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor, + new java.lang.String[] { + "Destination", "AttributionSettings", "DisplayName", "CurrencyCode", + }); + internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor, + new java.lang.String[] { + "Parent", "ConversionSource", + }); + internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor, + new java.lang.String[] { + "ConversionSource", "UpdateMask", + }); + internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "ShowDeleted", + }); + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor, + new java.lang.String[] { + "ConversionSources", "NextPageToken", + }); + 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.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.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequest.java new file mode 100644 index 000000000000..6683e8e8b503 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequest.java @@ -0,0 +1,996 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the CreateConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest} + */ +public final class CreateConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + CreateConversionSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateConversionSourceRequest.newBuilder() to construct. + private CreateConversionSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateConversionSourceRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateConversionSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.Builder + .class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The merchant account that will own the new conversion source.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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 merchant account that will own the new conversion source.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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 CONVERSION_SOURCE_FIELD_NUMBER = 2; + private com.google.shopping.merchant.conversions.v1beta.ConversionSource conversionSource_; + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + @java.lang.Override + public boolean hasConversionSource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + + 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, getConversionSource()); + } + 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, getConversionSource()); + } + 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasConversionSource() != other.hasConversionSource()) return false; + if (hasConversionSource()) { + if (!getConversionSource().equals(other.getConversionSource())) 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 (hasConversionSource()) { + hash = (37 * hash) + CONVERSION_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getConversionSource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest 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 the CreateConversionSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConversionSourceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + conversionSource_ = null; + if (conversionSourceBuilder_ != null) { + conversionSourceBuilder_.dispose(); + conversionSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.conversionSource_ = + conversionSourceBuilder_ == null ? conversionSource_ : conversionSourceBuilder_.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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasConversionSource()) { + mergeConversionSource(other.getConversionSource()); + } + 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( + getConversionSourceFieldBuilder().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 merchant account that will own the new conversion source.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account that will own the new conversion source.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account that will own the new conversion source.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account that will own the new conversion source.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account that will own the new conversion source.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.ConversionSource conversionSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + conversionSourceBuilder_; + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + public boolean hasConversionSource() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource() { + if (conversionSourceBuilder_ == null) { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } else { + return conversionSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversionSource_ = value; + } else { + conversionSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder builderForValue) { + if (conversionSourceBuilder_ == null) { + conversionSource_ = builderForValue.build(); + } else { + conversionSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversionSource_ != null + && conversionSource_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance()) { + getConversionSourceBuilder().mergeFrom(value); + } else { + conversionSource_ = value; + } + } else { + conversionSourceBuilder_.mergeFrom(value); + } + if (conversionSource_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversionSource() { + bitField0_ = (bitField0_ & ~0x00000002); + conversionSource_ = null; + if (conversionSourceBuilder_ != null) { + conversionSourceBuilder_.dispose(); + conversionSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder + getConversionSourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConversionSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + if (conversionSourceBuilder_ != null) { + return conversionSourceBuilder_.getMessageOrBuilder(); + } else { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + } + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourceFieldBuilder() { + if (conversionSourceBuilder_ == null) { + conversionSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder>( + getConversionSource(), getParentForChildren(), isClean()); + conversionSource_ = null; + } + return conversionSourceBuilder_; + } + + @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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateConversionSourceRequest 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.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..3a901662567f --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/CreateConversionSourceRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface CreateConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The merchant account that will own the new conversion source.
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The merchant account that will own the new conversion source.
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + boolean hasConversionSource(); + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource(); + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequest.java new file mode 100644 index 000000000000..4d4b41b960b8 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequest.java @@ -0,0 +1,671 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the DeleteConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest} + */ +public final class DeleteConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + DeleteConversionSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConversionSourceRequest.newBuilder() to construct. + private DeleteConversionSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteConversionSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteConversionSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the conversion source to be deleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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 conversion source to be deleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest 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 the DeleteConversionSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest.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.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + .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 conversion source to be deleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be deleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be deleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be deleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be deleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConversionSourceRequest 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.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..18f4af72a938 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/DeleteConversionSourceRequestOrBuilder.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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface DeleteConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the conversion source to be deleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the conversion source to be deleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequest.java new file mode 100644 index 000000000000..19f3e25a1e94 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequest.java @@ -0,0 +1,670 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the GetConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest} + */ +public final class GetConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) + GetConversionSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConversionSourceRequest.newBuilder() to construct. + private GetConversionSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetConversionSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetConversionSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the conversion source to be fetched.
+   * Format: accounts/{account}/conversionsources/{conversion_source}
+   * 
+ * + * + * 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 conversion source to be fetched.
+   * Format: accounts/{account}/conversionsources/{conversion_source}
+   * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest 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 the GetConversionSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest.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.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + .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 conversion source to be fetched.
+     * Format: accounts/{account}/conversionsources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be fetched.
+     * Format: accounts/{account}/conversionsources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be fetched.
+     * Format: accounts/{account}/conversionsources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be fetched.
+     * Format: accounts/{account}/conversionsources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be fetched.
+     * Format: accounts/{account}/conversionsources/{conversion_source}
+     * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConversionSourceRequest 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.shopping.merchant.conversions.v1beta.GetConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..27986972a1a1 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GetConversionSourceRequestOrBuilder.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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface GetConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the conversion source to be fetched.
+   * Format: accounts/{account}/conversionsources/{conversion_source}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the conversion source to be fetched.
+   * Format: accounts/{account}/conversionsources/{conversion_source}
+   * 
+ * + * + * 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-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLink.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLink.java new file mode 100644 index 000000000000..6e0743a370d8 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLink.java @@ -0,0 +1,1072 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * "Google Analytics Link" sources can be used to get conversion data from an
+ * existing Google Analytics property into the linked Merchant Center account.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink} + */ +public final class GoogleAnalyticsLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + GoogleAnalyticsLinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use GoogleAnalyticsLink.newBuilder() to construct. + private GoogleAnalyticsLink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GoogleAnalyticsLink() { + property_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GoogleAnalyticsLink(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.class, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder.class); + } + + private int bitField0_; + public static final int PROPERTY_ID_FIELD_NUMBER = 1; + private long propertyId_ = 0L; + /** + * + * + *
+   * Required. Immutable. ID of the Google Analytics property the merchant is
+   * linked to.
+   * 
+ * + * + * int64 property_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The propertyId. + */ + @java.lang.Override + public long getPropertyId() { + return propertyId_; + } + + public static final int ATTRIBUTION_SETTINGS_FIELD_NUMBER = 2; + private com.google.shopping.merchant.conversions.v1beta.AttributionSettings attributionSettings_; + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributionSettings field is set. + */ + @java.lang.Override + public boolean hasAttributionSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getAttributionSettings() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + + public static final int PROPERTY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object property_ = ""; + /** + * + * + *
+   * Output only. Name of the Google Analytics property the merchant is linked
+   * to.
+   * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The property. + */ + @java.lang.Override + public java.lang.String getProperty() { + java.lang.Object ref = property_; + 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(); + property_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the Google Analytics property the merchant is linked
+   * to.
+   * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for property. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPropertyBytes() { + java.lang.Object ref = property_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + property_ = 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 (propertyId_ != 0L) { + output.writeInt64(1, propertyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttributionSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(property_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, property_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (propertyId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, propertyId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttributionSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(property_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, property_); + } + 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink other = + (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) obj; + + if (getPropertyId() != other.getPropertyId()) return false; + if (hasAttributionSettings() != other.hasAttributionSettings()) return false; + if (hasAttributionSettings()) { + if (!getAttributionSettings().equals(other.getAttributionSettings())) return false; + } + if (!getProperty().equals(other.getProperty())) 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) + PROPERTY_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPropertyId()); + if (hasAttributionSettings()) { + hash = (37 * hash) + ATTRIBUTION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getAttributionSettings().hashCode(); + } + hash = (37 * hash) + PROPERTY_FIELD_NUMBER; + hash = (53 * hash) + getProperty().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink 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; + } + /** + * + * + *
+   * "Google Analytics Link" sources can be used to get conversion data from an
+   * existing Google Analytics property into the linked Merchant Center account.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.class, + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttributionSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + propertyId_ = 0L; + attributionSettings_ = null; + if (attributionSettingsBuilder_ != null) { + attributionSettingsBuilder_.dispose(); + attributionSettingsBuilder_ = null; + } + property_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink build() { + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink buildPartial() { + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink result = + new com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.propertyId_ = propertyId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributionSettings_ = + attributionSettingsBuilder_ == null + ? attributionSettings_ + : attributionSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.property_ = property_; + } + 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + .getDefaultInstance()) return this; + if (other.getPropertyId() != 0L) { + setPropertyId(other.getPropertyId()); + } + if (other.hasAttributionSettings()) { + mergeAttributionSettings(other.getAttributionSettings()); + } + if (!other.getProperty().isEmpty()) { + property_ = other.property_; + 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 8: + { + propertyId_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getAttributionSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + property_ = 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 long propertyId_; + /** + * + * + *
+     * Required. Immutable. ID of the Google Analytics property the merchant is
+     * linked to.
+     * 
+ * + * + * int64 property_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The propertyId. + */ + @java.lang.Override + public long getPropertyId() { + return propertyId_; + } + /** + * + * + *
+     * Required. Immutable. ID of the Google Analytics property the merchant is
+     * linked to.
+     * 
+ * + * + * int64 property_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The propertyId to set. + * @return This builder for chaining. + */ + public Builder setPropertyId(long value) { + + propertyId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Immutable. ID of the Google Analytics property the merchant is
+     * linked to.
+     * 
+ * + * + * int64 property_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearPropertyId() { + bitField0_ = (bitField0_ & ~0x00000001); + propertyId_ = 0L; + onChanged(); + return this; + } + + private com.google.shopping.merchant.conversions.v1beta.AttributionSettings + attributionSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder> + attributionSettingsBuilder_; + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributionSettings field is set. + */ + public boolean hasAttributionSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getAttributionSettings() { + if (attributionSettingsBuilder_ == null) { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance() + : attributionSettings_; + } else { + return attributionSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributionSettings_ = value; + } else { + attributionSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder + builderForValue) { + if (attributionSettingsBuilder_ == null) { + attributionSettings_ = builderForValue.build(); + } else { + attributionSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attributionSettings_ != null + && attributionSettings_ + != com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance()) { + getAttributionSettingsBuilder().mergeFrom(value); + } else { + attributionSettings_ = value; + } + } else { + attributionSettingsBuilder_.mergeFrom(value); + } + if (attributionSettings_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAttributionSettings() { + bitField0_ = (bitField0_ & ~0x00000002); + attributionSettings_ = null; + if (attributionSettingsBuilder_ != null) { + attributionSettingsBuilder_.dispose(); + attributionSettingsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder + getAttributionSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttributionSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + if (attributionSettingsBuilder_ != null) { + return attributionSettingsBuilder_.getMessageOrBuilder(); + } else { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance() + : attributionSettings_; + } + } + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder> + getAttributionSettingsFieldBuilder() { + if (attributionSettingsBuilder_ == null) { + attributionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder>( + getAttributionSettings(), getParentForChildren(), isClean()); + attributionSettings_ = null; + } + return attributionSettingsBuilder_; + } + + private java.lang.Object property_ = ""; + /** + * + * + *
+     * Output only. Name of the Google Analytics property the merchant is linked
+     * to.
+     * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The property. + */ + public java.lang.String getProperty() { + java.lang.Object ref = property_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + property_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the Google Analytics property the merchant is linked
+     * to.
+     * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for property. + */ + public com.google.protobuf.ByteString getPropertyBytes() { + java.lang.Object ref = property_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + property_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the Google Analytics property the merchant is linked
+     * to.
+     * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The property to set. + * @return This builder for chaining. + */ + public Builder setProperty(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + property_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the Google Analytics property the merchant is linked
+     * to.
+     * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearProperty() { + property_ = getDefaultInstance().getProperty(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the Google Analytics property the merchant is linked
+     * to.
+     * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for property to set. + * @return This builder for chaining. + */ + public Builder setPropertyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + property_ = 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + private static final com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink(); + } + + public static com.google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GoogleAnalyticsLink 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.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLinkOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLinkOrBuilder.java new file mode 100644 index 000000000000..ba7c16495065 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/GoogleAnalyticsLinkOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface GoogleAnalyticsLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.GoogleAnalyticsLink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. ID of the Google Analytics property the merchant is
+   * linked to.
+   * 
+ * + * + * int64 property_id = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The propertyId. + */ + long getPropertyId(); + + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributionSettings field is set. + */ + boolean hasAttributionSettings(); + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettings getAttributionSettings(); + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder(); + + /** + * + * + *
+   * Output only. Name of the Google Analytics property the merchant is linked
+   * to.
+   * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The property. + */ + java.lang.String getProperty(); + /** + * + * + *
+   * Output only. Name of the Google Analytics property the merchant is linked
+   * to.
+   * 
+ * + * string property = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for property. + */ + com.google.protobuf.ByteString getPropertyBytes(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequest.java new file mode 100644 index 000000000000..7215e6adabb6 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequest.java @@ -0,0 +1,1054 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the ListConversionSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest} + */ +public final class ListConversionSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + ListConversionSourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversionSourcesRequest.newBuilder() to construct. + private ListConversionSourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversionSourcesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversionSourcesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.class, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The merchant account who owns the collection of conversion
+   * sources. Format: accounts/{account}
+   * 
+ * + * + * 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 merchant account who owns the collection of conversion
+   * sources. Format: accounts/{account}
+   * 
+ * + * + * 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 conversion sources to return in a page.
+   * If no `page_size` is specified, `100` is used as the default value. The
+   * maximum value is `200`. Values above `200` will be coerced to `200`.
+   * Regardless of pagination, at most `200` conversion sources are returned
+   * in total.
+   * 
+ * + * 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. 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. 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; + } + } + + public static final int SHOW_DELETED_FIELD_NUMBER = 4; + private boolean showDeleted_ = false; + /** + * + * + *
+   * Optional. Show deleted (archived) option.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + + 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_); + } + if (showDeleted_ != false) { + output.writeBool(4, showDeleted_); + } + 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_); + } + if (showDeleted_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, showDeleted_); + } + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest other = + (com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getShowDeleted() != other.getShowDeleted()) 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 = (37 * hash) + SHOW_DELETED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getShowDeleted()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest 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 the ListConversionSources method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.class, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest.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_ = ""; + showDeleted_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest build() { + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest result = + new com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest 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_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.showDeleted_ = showDeleted_; + } + } + + @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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + .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(); + } + if (other.getShowDeleted() != false) { + setShowDeleted(other.getShowDeleted()); + } + 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 + case 32: + { + showDeleted_ = input.readBool(); + 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 parent_ = ""; + /** + * + * + *
+     * Required. The merchant account who owns the collection of conversion
+     * sources. Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account who owns the collection of conversion
+     * sources. Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account who owns the collection of conversion
+     * sources. Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account who owns the collection of conversion
+     * sources. Format: accounts/{account}
+     * 
+ * + * + * 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 merchant account who owns the collection of conversion
+     * sources. Format: accounts/{account}
+     * 
+ * + * + * 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 conversion sources to return in a page.
+     * If no `page_size` is specified, `100` is used as the default value. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * Regardless of pagination, at most `200` conversion sources are returned
+     * in total.
+     * 
+ * + * 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 conversion sources to return in a page.
+     * If no `page_size` is specified, `100` is used as the default value. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * Regardless of pagination, at most `200` conversion sources are returned
+     * in total.
+     * 
+ * + * 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 conversion sources to return in a page.
+     * If no `page_size` is specified, `100` is used as the default value. The
+     * maximum value is `200`. Values above `200` will be coerced to `200`.
+     * Regardless of pagination, at most `200` conversion sources are returned
+     * in total.
+     * 
+ * + * 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. 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. 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. 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. 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. 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; + } + + private boolean showDeleted_; + /** + * + * + *
+     * Optional. Show deleted (archived) option.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + /** + * + * + *
+     * Optional. Show deleted (archived) option.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The showDeleted to set. + * @return This builder for chaining. + */ + public Builder setShowDeleted(boolean value) { + + showDeleted_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Show deleted (archived) option.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearShowDeleted() { + bitField0_ = (bitField0_ & ~0x00000008); + showDeleted_ = false; + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + private static final com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversionSourcesRequest 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.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..9cd3ff84b461 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesRequestOrBuilder.java @@ -0,0 +1,112 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface ListConversionSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The merchant account who owns the collection of conversion
+   * sources. Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The merchant account who owns the collection of conversion
+   * sources. Format: accounts/{account}
+   * 
+ * + * + * 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 conversion sources to return in a page.
+   * If no `page_size` is specified, `100` is used as the default value. The
+   * maximum value is `200`. Values above `200` will be coerced to `200`.
+   * Regardless of pagination, at most `200` conversion sources are returned
+   * in total.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. Page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. Page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Show deleted (archived) option.
+   * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + boolean getShowDeleted(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponse.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponse.java new file mode 100644 index 000000000000..2e2e745eb38c --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponse.java @@ -0,0 +1,1222 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Response message for the ListConversionSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse} + */ +public final class ListConversionSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) + ListConversionSourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListConversionSourcesResponse.newBuilder() to construct. + private ListConversionSourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListConversionSourcesResponse() { + conversionSources_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListConversionSourcesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.class, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.Builder + .class); + } + + public static final int CONVERSION_SOURCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + conversionSources_; + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public java.util.List + getConversionSourcesList() { + return conversionSources_; + } + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourcesOrBuilderList() { + return conversionSources_; + } + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public int getConversionSourcesCount() { + return conversionSources_.size(); + } + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSources( + int index) { + return conversionSources_.get(index); + } + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourcesOrBuilder(int index) { + return conversionSources_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * Token to be used to fetch the next results page.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Token to be used to fetch the next results page.
+   * 
+ * + * 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 < conversionSources_.size(); i++) { + output.writeMessage(1, conversionSources_.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 < conversionSources_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, conversionSources_.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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse other = + (com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) obj; + + if (!getConversionSourcesList().equals(other.getConversionSourcesList())) 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 (getConversionSourcesCount() > 0) { + hash = (37 * hash) + CONVERSION_SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getConversionSourcesList().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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse 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 the ListConversionSources method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.class, + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (conversionSourcesBuilder_ == null) { + conversionSources_ = java.util.Collections.emptyList(); + } else { + conversionSources_ = null; + conversionSourcesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse build() { + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse result = + new com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse result) { + if (conversionSourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + conversionSources_ = java.util.Collections.unmodifiableList(conversionSources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.conversionSources_ = conversionSources_; + } else { + result.conversionSources_ = conversionSourcesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + .getDefaultInstance()) return this; + if (conversionSourcesBuilder_ == null) { + if (!other.conversionSources_.isEmpty()) { + if (conversionSources_.isEmpty()) { + conversionSources_ = other.conversionSources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConversionSourcesIsMutable(); + conversionSources_.addAll(other.conversionSources_); + } + onChanged(); + } + } else { + if (!other.conversionSources_.isEmpty()) { + if (conversionSourcesBuilder_.isEmpty()) { + conversionSourcesBuilder_.dispose(); + conversionSourcesBuilder_ = null; + conversionSources_ = other.conversionSources_; + bitField0_ = (bitField0_ & ~0x00000001); + conversionSourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConversionSourcesFieldBuilder() + : null; + } else { + conversionSourcesBuilder_.addAllMessages(other.conversionSources_); + } + } + } + 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.shopping.merchant.conversions.v1beta.ConversionSource m = + input.readMessage( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.parser(), + extensionRegistry); + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + conversionSources_.add(m); + } else { + conversionSourcesBuilder_.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 + conversionSources_ = java.util.Collections.emptyList(); + + private void ensureConversionSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + conversionSources_ = + new java.util.ArrayList< + com.google.shopping.merchant.conversions.v1beta.ConversionSource>( + conversionSources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + conversionSourcesBuilder_; + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public java.util.List + getConversionSourcesList() { + if (conversionSourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(conversionSources_); + } else { + return conversionSourcesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public int getConversionSourcesCount() { + if (conversionSourcesBuilder_ == null) { + return conversionSources_.size(); + } else { + return conversionSourcesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSources( + int index) { + if (conversionSourcesBuilder_ == null) { + return conversionSources_.get(index); + } else { + return conversionSourcesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder setConversionSources( + int index, com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionSourcesIsMutable(); + conversionSources_.set(index, value); + onChanged(); + } else { + conversionSourcesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder setConversionSources( + int index, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder builderForValue) { + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + conversionSources_.set(index, builderForValue.build()); + onChanged(); + } else { + conversionSourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionSourcesIsMutable(); + conversionSources_.add(value); + onChanged(); + } else { + conversionSourcesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + int index, com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConversionSourcesIsMutable(); + conversionSources_.add(index, value); + onChanged(); + } else { + conversionSourcesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder builderForValue) { + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + conversionSources_.add(builderForValue.build()); + onChanged(); + } else { + conversionSourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + int index, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder builderForValue) { + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + conversionSources_.add(index, builderForValue.build()); + onChanged(); + } else { + conversionSourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder addAllConversionSources( + java.lang.Iterable< + ? extends com.google.shopping.merchant.conversions.v1beta.ConversionSource> + values) { + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, conversionSources_); + onChanged(); + } else { + conversionSourcesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder clearConversionSources() { + if (conversionSourcesBuilder_ == null) { + conversionSources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + conversionSourcesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public Builder removeConversionSources(int index) { + if (conversionSourcesBuilder_ == null) { + ensureConversionSourcesIsMutable(); + conversionSources_.remove(index); + onChanged(); + } else { + conversionSourcesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder + getConversionSourcesBuilder(int index) { + return getConversionSourcesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourcesOrBuilder(int index) { + if (conversionSourcesBuilder_ == null) { + return conversionSources_.get(index); + } else { + return conversionSourcesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourcesOrBuilderList() { + if (conversionSourcesBuilder_ != null) { + return conversionSourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversionSources_); + } + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder + addConversionSourcesBuilder() { + return getConversionSourcesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance()); + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder + addConversionSourcesBuilder(int index) { + return getConversionSourcesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance()); + } + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + public java.util.List + getConversionSourcesBuilderList() { + return getConversionSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourcesFieldBuilder() { + if (conversionSourcesBuilder_ == null) { + conversionSourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder>( + conversionSources_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + conversionSources_ = null; + } + return conversionSourcesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to be used to fetch the next results page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to be used to fetch the next results page.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to be used to fetch the next results page.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to be used to fetch the next results page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to be used to fetch the next results page.
+     * 
+ * + * 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) + private static final com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse(); + } + + public static com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListConversionSourcesResponse 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.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponseOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..0d90fff938d7 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/ListConversionSourcesResponseOrBuilder.java @@ -0,0 +1,116 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface ListConversionSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + java.util.List + getConversionSourcesList(); + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSources(int index); + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + int getConversionSourcesCount(); + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + java.util.List< + ? extends com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourcesOrBuilderList(); + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_sources = 1; + * + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourcesOrBuilder(int index); + + /** + * + * + *
+   * Token to be used to fetch the next results page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to be used to fetch the next results page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestination.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestination.java new file mode 100644 index 000000000000..799600ee1ad6 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestination.java @@ -0,0 +1,1373 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * "Merchant Center Destination" sources can be used to send conversion events
+ * from a website using a Google tag directly to a Merchant Center account
+ * where the source is created.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.MerchantCenterDestination} + */ +public final class MerchantCenterDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + MerchantCenterDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use MerchantCenterDestination.newBuilder() to construct. + private MerchantCenterDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantCenterDestination() { + destination_ = ""; + displayName_ = ""; + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantCenterDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.class, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder + .class); + } + + private int bitField0_; + public static final int DESTINATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object destination_ = ""; + /** + * + * + *
+   * Output only. Merchant Center Destination ID.
+   * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The destination. + */ + @java.lang.Override + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + 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(); + destination_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Merchant Center Destination ID.
+   * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for destination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTION_SETTINGS_FIELD_NUMBER = 2; + private com.google.shopping.merchant.conversions.v1beta.AttributionSettings attributionSettings_; + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributionSettings field is set. + */ + @java.lang.Override + public boolean hasAttributionSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getAttributionSettings() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Required. Merchant-specified display name for the destination. This is the
+   * name that identifies the conversion source within the Merchant Center UI.
+   * Limited to 64 characters.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. Merchant-specified display name for the destination. This is the
+   * name that identifies the conversion source within the Merchant Center UI.
+   * Limited to 64 characters.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 CURRENCY_CODE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object currencyCode_ = ""; + /** + * + * + *
+   * Required. Three-letter currency code (ISO 4217). The currency code defines
+   * in which currency the conversions sent to this destination will be reported
+   * in Merchant Center.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + 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(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Three-letter currency code (ISO 4217). The currency code defines
+   * in which currency the conversions sent to this destination will be reported
+   * in Merchant Center.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = 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(destination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getAttributionSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, currencyCode_); + } + 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(destination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAttributionSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(currencyCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, currencyCode_); + } + 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination other = + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) obj; + + if (!getDestination().equals(other.getDestination())) return false; + if (hasAttributionSettings() != other.hasAttributionSettings()) return false; + if (hasAttributionSettings()) { + if (!getAttributionSettings().equals(other.getAttributionSettings())) return false; + } + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getCurrencyCode().equals(other.getCurrencyCode())) 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) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + if (hasAttributionSettings()) { + hash = (37 * hash) + ATTRIBUTION_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getAttributionSettings().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination 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; + } + /** + * + * + *
+   * "Merchant Center Destination" sources can be used to send conversion events
+   * from a website using a Google tag directly to a Merchant Center account
+   * where the source is created.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.MerchantCenterDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.class, + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAttributionSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destination_ = ""; + attributionSettings_ = null; + if (attributionSettingsBuilder_ != null) { + attributionSettingsBuilder_.dispose(); + attributionSettingsBuilder_ = null; + } + displayName_ = ""; + currencyCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination build() { + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination result = + new com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.destination_ = destination_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributionSettings_ = + attributionSettingsBuilder_ == null + ? attributionSettings_ + : attributionSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.currencyCode_ = currencyCode_; + } + 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + .getDefaultInstance()) return this; + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAttributionSettings()) { + mergeAttributionSettings(other.getAttributionSettings()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getCurrencyCode().isEmpty()) { + currencyCode_ = other.currencyCode_; + bitField0_ |= 0x00000008; + 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: + { + destination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getAttributionSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + currencyCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 destination_ = ""; + /** + * + * + *
+     * Output only. Merchant Center Destination ID.
+     * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The destination. + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Merchant Center Destination ID.
+     * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for destination. + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Merchant Center Destination ID.
+     * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Merchant Center Destination ID.
+     * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + destination_ = getDefaultInstance().getDestination(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Merchant Center Destination ID.
+     * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.shopping.merchant.conversions.v1beta.AttributionSettings + attributionSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder> + attributionSettingsBuilder_; + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributionSettings field is set. + */ + public boolean hasAttributionSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings + getAttributionSettings() { + if (attributionSettingsBuilder_ == null) { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance() + : attributionSettings_; + } else { + return attributionSettingsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributionSettings_ = value; + } else { + attributionSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder + builderForValue) { + if (attributionSettingsBuilder_ == null) { + attributionSettings_ = builderForValue.build(); + } else { + attributionSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttributionSettings( + com.google.shopping.merchant.conversions.v1beta.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attributionSettings_ != null + && attributionSettings_ + != com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance()) { + getAttributionSettingsBuilder().mergeFrom(value); + } else { + attributionSettings_ = value; + } + } else { + attributionSettingsBuilder_.mergeFrom(value); + } + if (attributionSettings_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAttributionSettings() { + bitField0_ = (bitField0_ & ~0x00000002); + attributionSettings_ = null; + if (attributionSettingsBuilder_ != null) { + attributionSettingsBuilder_.dispose(); + attributionSettingsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder + getAttributionSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttributionSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + if (attributionSettingsBuilder_ != null) { + return attributionSettingsBuilder_.getMessageOrBuilder(); + } else { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1beta.AttributionSettings + .getDefaultInstance() + : attributionSettings_; + } + } + /** + * + * + *
+     * Required. Attribution settings being used for the Merchant Center
+     * Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder> + getAttributionSettingsFieldBuilder() { + if (attributionSettingsBuilder_ == null) { + attributionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.AttributionSettings, + com.google.shopping.merchant.conversions.v1beta.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder>( + getAttributionSettings(), getParentForChildren(), isClean()); + attributionSettings_ = null; + } + return attributionSettingsBuilder_; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. Merchant-specified display name for the destination. This is the
+     * name that identifies the conversion source within the Merchant Center UI.
+     * Limited to 64 characters.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Merchant-specified display name for the destination. This is the
+     * name that identifies the conversion source within the Merchant Center UI.
+     * Limited to 64 characters.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. Merchant-specified display name for the destination. This is the
+     * name that identifies the conversion source within the Merchant Center UI.
+     * Limited to 64 characters.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + /** + * + * + *
+     * Required. Merchant-specified display name for the destination. This is the
+     * name that identifies the conversion source within the Merchant Center UI.
+     * Limited to 64 characters.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Merchant-specified display name for the destination. This is the
+     * name that identifies the conversion source within the Merchant Center UI.
+     * Limited to 64 characters.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * Required. Three-letter currency code (ISO 4217). The currency code defines
+     * in which currency the conversions sent to this destination will be reported
+     * in Merchant Center.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Three-letter currency code (ISO 4217). The currency code defines
+     * in which currency the conversions sent to this destination will be reported
+     * in Merchant Center.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Three-letter currency code (ISO 4217). The currency code defines
+     * in which currency the conversions sent to this destination will be reported
+     * in Merchant Center.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + currencyCode_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Three-letter currency code (ISO 4217). The currency code defines
+     * in which currency the conversions sent to this destination will be reported
+     * in Merchant Center.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + currencyCode_ = getDefaultInstance().getCurrencyCode(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Three-letter currency code (ISO 4217). The currency code defines
+     * in which currency the conversions sent to this destination will be reported
+     * in Merchant Center.
+     * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + currencyCode_ = value; + bitField0_ |= 0x00000008; + 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + private static final com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination(); + } + + public static com.google.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantCenterDestination 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.shopping.merchant.conversions.v1beta.MerchantCenterDestination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestinationOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestinationOrBuilder.java new file mode 100644 index 000000000000..d3d1383f8850 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/MerchantCenterDestinationOrBuilder.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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface MerchantCenterDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.MerchantCenterDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Merchant Center Destination ID.
+   * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The destination. + */ + java.lang.String getDestination(); + /** + * + * + *
+   * Output only. Merchant Center Destination ID.
+   * 
+ * + * string destination = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for destination. + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributionSettings field is set. + */ + boolean hasAttributionSettings(); + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettings getAttributionSettings(); + /** + * + * + *
+   * Required. Attribution settings being used for the Merchant Center
+   * Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1beta.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder(); + + /** + * + * + *
+   * Required. Merchant-specified display name for the destination. This is the
+   * name that identifies the conversion source within the Merchant Center UI.
+   * Limited to 64 characters.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. Merchant-specified display name for the destination. This is the
+   * name that identifies the conversion source within the Merchant Center UI.
+   * Limited to 64 characters.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. Three-letter currency code (ISO 4217). The currency code defines
+   * in which currency the conversions sent to this destination will be reported
+   * in Merchant Center.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * Required. Three-letter currency code (ISO 4217). The currency code defines
+   * in which currency the conversions sent to this destination will be reported
+   * in Merchant Center.
+   * 
+ * + * string currency_code = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequest.java new file mode 100644 index 000000000000..426113b192a3 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequest.java @@ -0,0 +1,676 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the UndeleteConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest} + */ +public final class UndeleteConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + UndeleteConversionSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteConversionSourceRequest.newBuilder() to construct. + private UndeleteConversionSourceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteConversionSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteConversionSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the conversion source to be undeleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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 conversion source to be undeleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest 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 the UndeleteConversionSource method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest.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.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + .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 conversion source to be undeleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be undeleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be undeleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be undeleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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 conversion source to be undeleted.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1beta + .UndeleteConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteConversionSourceRequest 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.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..c6ea40424ece --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UndeleteConversionSourceRequestOrBuilder.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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface UndeleteConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the conversion source to be undeleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the conversion source to be undeleted.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * 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-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequest.java new file mode 100644 index 000000000000..124090114a07 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequest.java @@ -0,0 +1,1068 @@ +/* + * 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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +/** + * + * + *
+ * Request message for the UpdateConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest} + */ +public final class UpdateConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + UpdateConversionSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateConversionSourceRequest.newBuilder() to construct. + private UpdateConversionSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateConversionSourceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateConversionSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.Builder + .class); + } + + private int bitField0_; + public static final int CONVERSION_SOURCE_FIELD_NUMBER = 1; + private com.google.shopping.merchant.conversions.v1beta.ConversionSource conversionSource_; + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + @java.lang.Override + public boolean hasConversionSource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getConversionSource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getConversionSource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) obj; + + if (hasConversionSource() != other.hasConversionSource()) return false; + if (hasConversionSource()) { + if (!getConversionSource().equals(other.getConversionSource())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasConversionSource()) { + hash = (37 * hash) + CONVERSION_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getConversionSource().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest 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 the UpdateConversionSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConversionSourceFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + conversionSource_ = null; + if (conversionSourceBuilder_ != null) { + conversionSourceBuilder_.dispose(); + conversionSourceBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.conversions.v1beta.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1beta_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.conversionSource_ = + conversionSourceBuilder_ == null ? conversionSource_ : conversionSourceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + .getDefaultInstance()) return this; + if (other.hasConversionSource()) { + mergeConversionSource(other.getConversionSource()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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: + { + input.readMessage( + getConversionSourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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 com.google.shopping.merchant.conversions.v1beta.ConversionSource conversionSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + conversionSourceBuilder_; + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + public boolean hasConversionSource() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource() { + if (conversionSourceBuilder_ == null) { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } else { + return conversionSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + conversionSource_ = value; + } else { + conversionSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder builderForValue) { + if (conversionSourceBuilder_ == null) { + conversionSource_ = builderForValue.build(); + } else { + conversionSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversionSource( + com.google.shopping.merchant.conversions.v1beta.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && conversionSource_ != null + && conversionSource_ + != com.google.shopping.merchant.conversions.v1beta.ConversionSource + .getDefaultInstance()) { + getConversionSourceBuilder().mergeFrom(value); + } else { + conversionSource_ = value; + } + } else { + conversionSourceBuilder_.mergeFrom(value); + } + if (conversionSource_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConversionSource() { + bitField0_ = (bitField0_ & ~0x00000001); + conversionSource_ = null; + if (conversionSourceBuilder_ != null) { + conversionSourceBuilder_.dispose(); + conversionSourceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder + getConversionSourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getConversionSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + if (conversionSourceBuilder_ != null) { + return conversionSourceBuilder_.getMessageOrBuilder(); + } else { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1beta.ConversionSource.getDefaultInstance() + : conversionSource_; + } + } + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * Format: accounts/{account}/conversionSources/{conversion_source}
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder> + getConversionSourceFieldBuilder() { + if (conversionSourceBuilder_ == null) { + conversionSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1beta.ConversionSource, + com.google.shopping.merchant.conversions.v1beta.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder>( + getConversionSource(), getParentForChildren(), isClean()); + conversionSource_ = null; + } + return conversionSourceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateConversionSourceRequest 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.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..5a9832bc6a15 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/java/com/google/shopping/merchant/conversions/v1beta/UpdateConversionSourceRequestOrBuilder.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/shopping/merchant/conversions/v1beta/conversionsources.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.merchant.conversions.v1beta; + +public interface UpdateConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the conversionSource field is set. + */ + boolean hasConversionSource(); + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSource getConversionSource(); + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * Format: accounts/{account}/conversionSources/{conversion_source}
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1beta.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1beta.ConversionSourceOrBuilder + getConversionSourceOrBuilder(); + + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/proto/google/shopping/merchant/conversions/v1beta/conversionsources.proto b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/proto/google/shopping/merchant/conversions/v1beta/conversionsources.proto new file mode 100644 index 000000000000..912fafcbb325 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1beta/src/main/proto/google/shopping/merchant/conversions/v1beta/conversionsources.proto @@ -0,0 +1,377 @@ +// Copyright 2023 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.shopping.merchant.conversions.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/conversions/apiv1beta/conversionspb;conversionspb"; +option java_multiple_files = true; +option java_outer_classname = "ConversionSourcesProto"; +option java_package = "com.google.shopping.merchant.conversions.v1beta"; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" +}; + +// Service for managing conversion sources for a merchant account. +service ConversionSourcesService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Creates a new conversion source. + rpc CreateConversionSource(CreateConversionSourceRequest) + returns (ConversionSource) { + option (google.api.http) = { + post: "/conversions/v1beta/{parent=accounts/*}/conversionSources" + body: "conversion_source" + }; + option (google.api.method_signature) = "parent,conversion_source"; + } + + // Updates information of an existing conversion source. Available only for + // Merchant Center Destination conversion sources. + rpc UpdateConversionSource(UpdateConversionSourceRequest) + returns (ConversionSource) { + option (google.api.http) = { + patch: "/conversions/v1beta/{conversion_source.name=accounts/*/conversionSources/*}" + body: "conversion_source" + }; + option (google.api.method_signature) = "conversion_source,update_mask"; + } + + // Archives an existing conversion source. If the conversion source is a + // Merchant Center Destination, it will be recoverable for 30 days. If the + // conversion source is a Google Analytics Link, it will be deleted + // immediately and can be restored by creating a new one. + rpc DeleteConversionSource(DeleteConversionSourceRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/conversions/v1beta/{name=accounts/*/conversionSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Re-enables an archived conversion source. Only Available for Merchant + // Center Destination conversion sources. + rpc UndeleteConversionSource(UndeleteConversionSourceRequest) + returns (ConversionSource) { + option (google.api.http) = { + post: "/conversions/v1beta/{name=accounts/*/conversionSources/*}:undelete" + body: "*" + }; + } + + // Fetches a conversion source. + rpc GetConversionSource(GetConversionSourceRequest) + returns (ConversionSource) { + option (google.api.http) = { + get: "/conversions/v1beta/{name=accounts/*/conversionSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the list of conversion sources the caller has access to. + rpc ListConversionSources(ListConversionSourcesRequest) + returns (ListConversionSourcesResponse) { + option (google.api.http) = { + get: "/conversions/v1beta/{parent=accounts/*}/conversionSources" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Represents a conversion source owned by a Merchant account. A merchant +// account can have up to 200 conversion sources. +message ConversionSource { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/ConversionSource" + pattern: "accounts/{account}/conversionSources/{conversion_source}" + plural: "conversionSources" + singular: "conversionSource" + }; + + // Represents state of the conversion source. + enum State { + // Conversion source has unspecified state. + STATE_UNSPECIFIED = 0; + + // Conversion source is fully functional. + ACTIVE = 1; + + // Conversion source has been archived in the last 30 days and not + // currently functional. Can be restored using the undelete method. + ARCHIVED = 2; + + // Conversion source creation has started but not fully finished yet. + PENDING = 3; + } + + // Entity controlling the conversion source. + enum Controller { + // Default value. This value is unused. + CONTROLLER_UNSPECIFIED = 0; + + // Controlled by the Merchant who owns the Conversion Source. + MERCHANT = 1; + + // Controlled by the YT Affiliates program. + YOUTUBE_AFFILIATES = 2; + } + + // Required. + // Conversion source data specific to each different type of source. + oneof source_data { + // Immutable. Conversion Source of type "Link to Google Analytics Property". + GoogleAnalyticsLink google_analytics_link = 3 + [(google.api.field_behavior) = IMMUTABLE]; + + // Conversion Source of type "Merchant Center Tag Destination". + MerchantCenterDestination merchant_center_destination = 4; + } + + // Output only. Identifier. Generated by the Content API upon creation of a + // new `ConversionSource`. Format: [a-z]{4}:.+ The four characters before the + // colon represent the type of conversio source. Content after the colon + // represents the ID of the conversion source within that type. The ID of two + // different conversion sources might be the same across different types. The + // following type prefixes are supported: + // - galk: For GoogleAnalyticsLink sources. + // - mcdn: For MerchantCenterDestination sources. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. Current state of this conversion source. Can't be edited + // through the API. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when an archived conversion source becomes + // permanently deleted and is no longer available to undelete. + google.protobuf.Timestamp expire_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Controller of the conversion source. + Controller controller = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents attribution settings for conversion sources receiving +// pre-attribution data. +message AttributionSettings { + // Message representing a types of conversion events + message ConversionType { + // Output only. Conversion event name, as it'll be reported by the client. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Option indicating if the type should be included in Merchant + // Center reporting. + bool report = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The attribution model used for this source. We support the same set of + // models offered by Google Analytics 4, as described in: + // https://support.google.com/analytics/answer/10596866. + enum AttributionModel { + // Unspecified model. + ATTRIBUTION_MODEL_UNSPECIFIED = 0; + + // Cross-channel Last Click model. + CROSS_CHANNEL_LAST_CLICK = 1; + + // Ads-preferred Last Click model. + ADS_PREFERRED_LAST_CLICK = 2; + + // Cross-channel Data Driven model. + CROSS_CHANNEL_DATA_DRIVEN = 5; + + // Cross-channel First Click model. + CROSS_CHANNEL_FIRST_CLICK = 6; + + // Cross-channel Linear model. + CROSS_CHANNEL_LINEAR = 7; + + // Cross-channel Position Based model. + CROSS_CHANNEL_POSITION_BASED = 8; + + // Cross-channel Time Decay model. + CROSS_CHANNEL_TIME_DECAY = 9; + } + + // Required. Lookback windows (in days) used for attribution in this source. + // Supported values are 7, 30, 40. + int32 attribution_lookback_window_days = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Attribution model. + AttributionModel attribution_model = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Immutable. Unordered list. List of different conversion types a conversion + // event can be classified as. A standard "purchase" type will be + // automatically created if this list is empty at creation time. + repeated ConversionType conversion_type = 3 [ + (google.api.field_behavior) = UNORDERED_LIST, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// "Google Analytics Link" sources can be used to get conversion data from an +// existing Google Analytics property into the linked Merchant Center account. +message GoogleAnalyticsLink { + // Required. Immutable. ID of the Google Analytics property the merchant is + // linked to. + int64 property_id = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Attribution settings for the linked Google Analytics property. + AttributionSettings attribution_settings = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the Google Analytics property the merchant is linked + // to. + string property = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// "Merchant Center Destination" sources can be used to send conversion events +// from a website using a Google tag directly to a Merchant Center account +// where the source is created. +message MerchantCenterDestination { + // Output only. Merchant Center Destination ID. + string destination = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Attribution settings being used for the Merchant Center + // Destination. + AttributionSettings attribution_settings = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Merchant-specified display name for the destination. This is the + // name that identifies the conversion source within the Merchant Center UI. + // Limited to 64 characters. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Three-letter currency code (ISO 4217). The currency code defines + // in which currency the conversions sent to this destination will be reported + // in Merchant Center. + string currency_code = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the CreateConversionSource method. +message CreateConversionSourceRequest { + // Required. The merchant account that will own the new conversion source. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/ConversionSource" + } + ]; + + // Required. The conversion source description. A new ID will be automatically + // assigned to it upon creation. + ConversionSource conversion_source = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the UpdateConversionSource method. +message UpdateConversionSourceRequest { + // Required. The new version of the conversion source data. + // Format: accounts/{account}/conversionSources/{conversion_source} + ConversionSource conversion_source = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the DeleteConversionSource method. +message DeleteConversionSourceRequest { + // Required. The name of the conversion source to be deleted. + // Format: accounts/{account}/conversionSources/{conversion_source} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/ConversionSource" + } + ]; +} + +// Request message for the UndeleteConversionSource method. +message UndeleteConversionSourceRequest { + // Required. The name of the conversion source to be undeleted. + // Format: accounts/{account}/conversionSources/{conversion_source} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/ConversionSource" + } + ]; +} + +// Request message for the GetConversionSource method. +message GetConversionSourceRequest { + // Required. The name of the conversion source to be fetched. + // Format: accounts/{account}/conversionsources/{conversion_source} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/ConversionSource" + } + ]; +} + +// Request message for the ListConversionSources method. +message ListConversionSourcesRequest { + // Required. The merchant account who owns the collection of conversion + // sources. Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/ConversionSource" + } + ]; + + // Optional. The maximum number of conversion sources to return in a page. + // If no `page_size` is specified, `100` is used as the default value. The + // maximum value is `200`. Values above `200` will be coerced to `200`. + // Regardless of pagination, at most `200` conversion sources are returned + // in total. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Show deleted (archived) option. + bool show_deleted = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListConversionSources method. +message ListConversionSourcesResponse { + // List of conversion sources. + repeated ConversionSource conversion_sources = 1; + + // Token to be used to fetch the next results page. + string next_page_token = 2; +} diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..cd3310df088b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceSettings; +import com.google.shopping.merchant.conversions.v1beta.myCredentials; + +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 + ConversionSourcesServiceSettings conversionSourcesServiceSettings = + ConversionSourcesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create(conversionSourcesServiceSettings); + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..0536f420de5d --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceSettings; + +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 + ConversionSourcesServiceSettings conversionSourcesServiceSettings = + ConversionSourcesServiceSettings.newHttpJsonBuilder().build(); + ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create(conversionSourcesServiceSettings); + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b6f4008ea8e3 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceSettings; +import com.google.shopping.merchant.conversions.v1beta.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 + ConversionSourcesServiceSettings conversionSourcesServiceSettings = + ConversionSourcesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create(conversionSourcesServiceSettings); + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.java new file mode 100644 index 000000000000..aeebf5222cba --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; + +public class AsyncCreateConversionSource { + + public static void main(String[] args) throws Exception { + asyncCreateConversionSource(); + } + + public static void asyncCreateConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + CreateConversionSourceRequest request = + CreateConversionSourceRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setConversionSource(ConversionSource.newBuilder().build()) + .build(); + ApiFuture future = + conversionSourcesServiceClient.createConversionSourceCallable().futureCall(request); + // Do something. + ConversionSource response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..3478f3ed354b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,48 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.CreateConversionSourceRequest; + +public class SyncCreateConversionSource { + + public static void main(String[] args) throws Exception { + syncCreateConversionSource(); + } + + public static void syncCreateConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + CreateConversionSourceRequest request = + CreateConversionSourceRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setConversionSource(ConversionSource.newBuilder().build()) + .build(); + ConversionSource response = conversionSourcesServiceClient.createConversionSource(request); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.java new file mode 100644 index 000000000000..a7e12ba49946 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_AccountnameConversionsource_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncCreateConversionSourceAccountnameConversionsource { + + public static void main(String[] args) throws Exception { + syncCreateConversionSourceAccountnameConversionsource(); + } + + public static void syncCreateConversionSourceAccountnameConversionsource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + ConversionSource response = + conversionSourcesServiceClient.createConversionSource(parent, conversionSource); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_AccountnameConversionsource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.java new file mode 100644 index 000000000000..1b0717bfcc85 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_StringConversionsource_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncCreateConversionSourceStringConversionsource { + + public static void main(String[] args) throws Exception { + syncCreateConversionSourceStringConversionsource(); + } + + public static void syncCreateConversionSourceStringConversionsource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + ConversionSource response = + conversionSourcesServiceClient.createConversionSource(parent, conversionSource); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_CreateConversionSource_StringConversionsource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.java new file mode 100644 index 000000000000..aca9e196b6cb --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; + +public class AsyncDeleteConversionSource { + + public static void main(String[] args) throws Exception { + asyncDeleteConversionSource(); + } + + public static void asyncDeleteConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + DeleteConversionSourceRequest request = + DeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + ApiFuture future = + conversionSourcesServiceClient.deleteConversionSourceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.java new file mode 100644 index 000000000000..5f59055d721c --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.DeleteConversionSourceRequest; + +public class SyncDeleteConversionSource { + + public static void main(String[] args) throws Exception { + syncDeleteConversionSource(); + } + + public static void syncDeleteConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + DeleteConversionSourceRequest request = + DeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + conversionSourcesServiceClient.deleteConversionSource(request); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.java new file mode 100644 index 000000000000..94022af418ff --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_Conversionsourcename_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncDeleteConversionSourceConversionsourcename { + + public static void main(String[] args) throws Exception { + syncDeleteConversionSourceConversionsourcename(); + } + + public static void syncDeleteConversionSourceConversionsourcename() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + conversionSourcesServiceClient.deleteConversionSource(name); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_Conversionsourcename_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.java new file mode 100644 index 000000000000..5a4935416f60 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncDeleteConversionSourceString { + + public static void main(String[] args) throws Exception { + syncDeleteConversionSourceString(); + } + + public static void syncDeleteConversionSourceString() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString(); + conversionSourcesServiceClient.deleteConversionSource(name); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_DeleteConversionSource_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.java new file mode 100644 index 000000000000..622aa1194be9 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; + +public class AsyncGetConversionSource { + + public static void main(String[] args) throws Exception { + asyncGetConversionSource(); + } + + public static void asyncGetConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + GetConversionSourceRequest request = + GetConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + ApiFuture future = + conversionSourcesServiceClient.getConversionSourceCallable().futureCall(request); + // Do something. + ConversionSource response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSource.java new file mode 100644 index 000000000000..fbd40dfb000f --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.GetConversionSourceRequest; + +public class SyncGetConversionSource { + + public static void main(String[] args) throws Exception { + syncGetConversionSource(); + } + + public static void syncGetConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + GetConversionSourceRequest request = + GetConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + ConversionSource response = conversionSourcesServiceClient.getConversionSource(request); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.java new file mode 100644 index 000000000000..e00be1304e91 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_Conversionsourcename_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncGetConversionSourceConversionsourcename { + + public static void main(String[] args) throws Exception { + syncGetConversionSourceConversionsourcename(); + } + + public static void syncGetConversionSourceConversionsourcename() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ConversionSourceName name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]"); + ConversionSource response = conversionSourcesServiceClient.getConversionSource(name); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_Conversionsourcename_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.java new file mode 100644 index 000000000000..dba9e5a9ffa0 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_String_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncGetConversionSourceString { + + public static void main(String[] args) throws Exception { + syncGetConversionSourceString(); + } + + public static void syncGetConversionSourceString() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + String name = ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString(); + ConversionSource response = conversionSourcesServiceClient.getConversionSource(name); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_GetConversionSource_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java new file mode 100644 index 000000000000..d660c352873e --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java @@ -0,0 +1,56 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; + +public class AsyncListConversionSources { + + public static void main(String[] args) throws Exception { + asyncListConversionSources(); + } + + public static void asyncListConversionSources() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ListConversionSourcesRequest request = + ListConversionSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setShowDeleted(true) + .build(); + ApiFuture future = + conversionSourcesServiceClient.listConversionSourcesPagedCallable().futureCall(request); + // Do something. + for (ConversionSource element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java new file mode 100644 index 000000000000..7fa9eccbe6ee --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java @@ -0,0 +1,64 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesResponse; + +public class AsyncListConversionSourcesPaged { + + public static void main(String[] args) throws Exception { + asyncListConversionSourcesPaged(); + } + + public static void asyncListConversionSourcesPaged() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ListConversionSourcesRequest request = + ListConversionSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setShowDeleted(true) + .build(); + while (true) { + ListConversionSourcesResponse response = + conversionSourcesServiceClient.listConversionSourcesCallable().call(request); + for (ConversionSource element : response.getConversionSourcesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_Paged_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSources.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSources.java new file mode 100644 index 000000000000..7cd79d7dfc7b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSources.java @@ -0,0 +1,53 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.ListConversionSourcesRequest; + +public class SyncListConversionSources { + + public static void main(String[] args) throws Exception { + syncListConversionSources(); + } + + public static void syncListConversionSources() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ListConversionSourcesRequest request = + ListConversionSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setShowDeleted(true) + .build(); + for (ConversionSource element : + conversionSourcesServiceClient.listConversionSources(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.java new file mode 100644 index 000000000000..49dcc4158c5e --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_Accountname_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncListConversionSourcesAccountname { + + public static void main(String[] args) throws Exception { + syncListConversionSourcesAccountname(); + } + + public static void syncListConversionSourcesAccountname() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (ConversionSource element : + conversionSourcesServiceClient.listConversionSources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_Accountname_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.java new file mode 100644 index 000000000000..5a07b8d3004b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_String_sync] +import com.google.shopping.merchant.conversions.v1beta.AccountName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncListConversionSourcesString { + + public static void main(String[] args) throws Exception { + syncListConversionSourcesString(); + } + + public static void syncListConversionSourcesString() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (ConversionSource element : + conversionSourcesServiceClient.listConversionSources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_ListConversionSources_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.java new file mode 100644 index 000000000000..65862a1d1942 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_UndeleteConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; + +public class AsyncUndeleteConversionSource { + + public static void main(String[] args) throws Exception { + asyncUndeleteConversionSource(); + } + + public static void asyncUndeleteConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + ApiFuture future = + conversionSourcesServiceClient.undeleteConversionSourceCallable().futureCall(request); + // Do something. + ConversionSource response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_UndeleteConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.java new file mode 100644 index 000000000000..37c364800b1e --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_UndeleteConversionSource_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.UndeleteConversionSourceRequest; + +public class SyncUndeleteConversionSource { + + public static void main(String[] args) throws Exception { + syncUndeleteConversionSource(); + } + + public static void syncUndeleteConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + UndeleteConversionSourceRequest request = + UndeleteConversionSourceRequest.newBuilder() + .setName(ConversionSourceName.of("[ACCOUNT]", "[CONVERSION_SOURCE]").toString()) + .build(); + ConversionSource response = conversionSourcesServiceClient.undeleteConversionSource(request); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_UndeleteConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.java new file mode 100644 index 000000000000..622eb85ed529 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; + +public class AsyncUpdateConversionSource { + + public static void main(String[] args) throws Exception { + asyncUpdateConversionSource(); + } + + public static void asyncUpdateConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + UpdateConversionSourceRequest request = + UpdateConversionSourceRequest.newBuilder() + .setConversionSource(ConversionSource.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + conversionSourcesServiceClient.updateConversionSourceCallable().futureCall(request); + // Do something. + ConversionSource response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java new file mode 100644 index 000000000000..d3c2795f4c8d --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java @@ -0,0 +1,48 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1beta.UpdateConversionSourceRequest; + +public class SyncUpdateConversionSource { + + public static void main(String[] args) throws Exception { + syncUpdateConversionSource(); + } + + public static void syncUpdateConversionSource() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + UpdateConversionSourceRequest request = + UpdateConversionSourceRequest.newBuilder() + .setConversionSource(ConversionSource.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ConversionSource response = conversionSourcesServiceClient.updateConversionSource(request); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.java new file mode 100644 index 000000000000..03739661366b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_ConversionsourceFieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1beta.ConversionSource; +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceClient; + +public class SyncUpdateConversionSourceConversionsourceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateConversionSourceConversionsourceFieldmask(); + } + + public static void syncUpdateConversionSourceConversionsourceFieldmask() 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 (ConversionSourcesServiceClient conversionSourcesServiceClient = + ConversionSourcesServiceClient.create()) { + ConversionSource conversionSource = ConversionSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + ConversionSource response = + conversionSourcesServiceClient.updateConversionSource(conversionSource, updateMask); + } + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesService_UpdateConversionSource_ConversionsourceFieldmask_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..da7910e9bd63 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,50 @@ +/* + * 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.shopping.merchant.conversions.v1beta.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesServiceSettings_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1beta.ConversionSourcesServiceSettings; +import java.time.Duration; + +public class SyncCreateConversionSource { + + public static void main(String[] args) throws Exception { + syncCreateConversionSource(); + } + + public static void syncCreateConversionSource() 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 + ConversionSourcesServiceSettings.Builder conversionSourcesServiceSettingsBuilder = + ConversionSourcesServiceSettings.newBuilder(); + conversionSourcesServiceSettingsBuilder + .createConversionSourceSettings() + .setRetrySettings( + conversionSourcesServiceSettingsBuilder + .createConversionSourceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversionSourcesServiceSettings conversionSourcesServiceSettings = + conversionSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesServiceSettings_CreateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..255eaad15e25 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1beta/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,50 @@ +/* + * 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.shopping.merchant.conversions.v1beta.stub.samples; + +// [START merchantapi_v1beta_generated_ConversionSourcesServiceStubSettings_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1beta.stub.ConversionSourcesServiceStubSettings; +import java.time.Duration; + +public class SyncCreateConversionSource { + + public static void main(String[] args) throws Exception { + syncCreateConversionSource(); + } + + public static void syncCreateConversionSource() 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 + ConversionSourcesServiceStubSettings.Builder conversionSourcesServiceSettingsBuilder = + ConversionSourcesServiceStubSettings.newBuilder(); + conversionSourcesServiceSettingsBuilder + .createConversionSourceSettings() + .setRetrySettings( + conversionSourcesServiceSettingsBuilder + .createConversionSourceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConversionSourcesServiceStubSettings conversionSourcesServiceSettings = + conversionSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_ConversionSourcesServiceStubSettings_CreateConversionSource_sync] diff --git a/pom.xml b/pom.xml index 6c70f7551d8e..1140e5106b89 100644 --- a/pom.xml +++ b/pom.xml @@ -166,6 +166,7 @@ java-servicehealth java-shell java-shopping-css + java-shopping-merchant-conversions java-shopping-merchant-inventories java-shopping-merchant-lfp java-shopping-merchant-notifications diff --git a/versions.txt b/versions.txt index b481a966eea6..8c51d954c4d4 100644 --- a/versions.txt +++ b/versions.txt @@ -753,6 +753,9 @@ grpc-google-cloud-parallelstore-v1beta:0.4.0:0.5.0-SNAPSHOT google-cloud-backupdr:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-backupdr-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-backupdr-v1:0.0.0:0.0.1-SNAPSHOT +google-shopping-merchant-conversions:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-merchant-conversions-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-shopping-merchant-conversions-v1beta:0.0.0:0.0.1-SNAPSHOT google-shopping-merchant-lfp:0.0.0:0.0.1-SNAPSHOT proto-google-shopping-merchant-lfp-v1beta:0.0.0:0.0.1-SNAPSHOT grpc-google-shopping-merchant-lfp-v1beta:0.0.0:0.0.1-SNAPSHOT