diff --git a/generation_config.yaml b/generation_config.yaml index 2bb46842094a..d693e5806cd7 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -2248,6 +2248,7 @@ libraries: group_id: com.google.shopping cloud_api: false GAPICs: + - proto_path: google/shopping/merchant/conversions/v1 - proto_path: google/shopping/merchant/conversions/v1beta requires_billing: true 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 index 88111516e267..baea51ca7c2b 100644 --- a/java-shopping-merchant-conversions/google-shopping-merchant-conversions-bom/pom.xml +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions-bom/pom.xml @@ -33,11 +33,21 @@ grpc-google-shopping-merchant-conversions-v1beta 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1 + 0.30.0-SNAPSHOT + com.google.shopping.api.grpc proto-google-shopping-merchant-conversions-v1beta 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1 + 0.30.0-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 index c711fd37cb93..acc881080dea 100644 --- a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/pom.xml +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1 + com.google.shopping.api.grpc proto-google-shopping-merchant-conversions-v1beta @@ -66,6 +70,11 @@ grpc-google-common-protos test + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1 + test + com.google.api.grpc proto-google-iam-v1 diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClient.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClient.java new file mode 100644 index 000000000000..f821dc6588e0 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClient.java @@ -0,0 +1,1122 @@ +/* + * Copyright 2025 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.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +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.v1.stub.ConversionSourcesServiceStub; +import com.google.shopping.merchant.conversions.v1.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. + */ +@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. + * @param updateMask Optional. 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/v1/ConversionSourcesServiceSettings.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceSettings.java new file mode 100644 index 000000000000..f6b95980d8c3 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceSettings.java @@ -0,0 +1,294 @@ +/* + * Copyright 2025 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.v1; + +import static com.google.shopping.merchant.conversions.v1.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.v1.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createConversionSource: + * + *

{@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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ConversionSourcesServiceSettings conversionSourcesServiceSettings =
+ *     conversionSourcesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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/v1/gapic_metadata.json b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/gapic_metadata.json new file mode 100644 index 000000000000..b637b2aeb187 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/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.v1", + "libraryPackage": "com.google.shopping.merchant.conversions.v1", + "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/v1/package-info.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/package-info.java new file mode 100644 index 000000000000..9fd7500aef0d --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 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.v1; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/ConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/ConversionSourcesServiceStub.java new file mode 100644 index 000000000000..488241b936b9 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/ConversionSourcesServiceStub.java @@ -0,0 +1,79 @@ +/* + * Copyright 2025 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.v1.stub; + +import static com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.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. + */ +@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/v1/stub/ConversionSourcesServiceStubSettings.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/ConversionSourcesServiceStubSettings.java new file mode 100644 index 000000000000..929e4c4c8aaa --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/ConversionSourcesServiceStubSettings.java @@ -0,0 +1,572 @@ +/* + * Copyright 2025 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.v1.stub; + +import static com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createConversionSource: + * + *

{@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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ConversionSourcesServiceStubSettings conversionSourcesServiceSettings =
+ *     conversionSourcesServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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(); + } + }; + + 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(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/v1/stub/GrpcConversionSourcesServiceCallableFactory.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/GrpcConversionSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..854067c8b767 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/GrpcConversionSourcesServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 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.v1.stub; + +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. + */ +@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/v1/stub/GrpcConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/GrpcConversionSourcesServiceStub.java new file mode 100644 index 000000000000..46b6b9485e5c --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/GrpcConversionSourcesServiceStub.java @@ -0,0 +1,366 @@ +/* + * Copyright 2025 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.v1.stub; + +import static com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.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. + */ +@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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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/v1/stub/HttpJsonConversionSourcesServiceCallableFactory.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/HttpJsonConversionSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..1b2f911b4883 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/HttpJsonConversionSourcesServiceCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2025 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.v1.stub; + +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. + */ +@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/v1/stub/HttpJsonConversionSourcesServiceStub.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/HttpJsonConversionSourcesServiceStub.java new file mode 100644 index 000000000000..3ee5428a457a --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/java/com/google/shopping/merchant/conversions/v1/stub/HttpJsonConversionSourcesServiceStub.java @@ -0,0 +1,552 @@ +/* + * Copyright 2025 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.v1.stub; + +import static com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient.ListConversionSourcesPagedResponse; + +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.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse; +import com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest; +import com.google.shopping.merchant.conversions.v1.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. + */ +@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.v1.ConversionSourcesService/CreateConversionSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1.ConversionSourcesService/UpdateConversionSource") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1.ConversionSourcesService/DeleteConversionSource") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1.ConversionSourcesService/UndeleteConversionSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1.ConversionSourcesService/GetConversionSource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1.ConversionSourcesService/ListConversionSources") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/conversions/v1/{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.v1/reflect-config.json b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/resources/META-INF/native-image/com.google.shopping.merchant.conversions.v1/reflect-config.json new file mode 100644 index 000000000000..e9f6e24bb515 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/main/resources/META-INF/native-image/com.google.shopping.merchant.conversions.v1/reflect-config.json @@ -0,0 +1,1460 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$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.v1.AttributionSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.AttributionSettings$AttributionModel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.AttributionSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.AttributionSettings$ConversionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.AttributionSettings$ConversionType$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ConversionSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ConversionSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ConversionSource$Controller", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ConversionSource$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.MerchantCenterDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.MerchantCenterDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.conversions.v1.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/v1/ConversionSourcesServiceClientHttpJsonTest.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..3aaf29a8359f --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClientHttpJsonTest.java @@ -0,0 +1,550 @@ +/* + * Copyright 2025 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.v1; + +import static com.google.shopping.merchant.conversions.v1.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.v1.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/v1/ConversionSourcesServiceClientTest.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClientTest.java new file mode 100644 index 000000000000..4b16f753c226 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceClientTest.java @@ -0,0 +1,497 @@ +/* + * Copyright 2025 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.v1; + +import static com.google.shopping.merchant.conversions.v1.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/v1/MockConversionSourcesService.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/MockConversionSourcesService.java new file mode 100644 index 000000000000..d6291a8280fb --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/MockConversionSourcesService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 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.v1; + +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/v1/MockConversionSourcesServiceImpl.java b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/MockConversionSourcesServiceImpl.java new file mode 100644 index 000000000000..663b8d857fc1 --- /dev/null +++ b/java-shopping-merchant-conversions/google-shopping-merchant-conversions/src/test/java/com/google/shopping/merchant/conversions/v1/MockConversionSourcesServiceImpl.java @@ -0,0 +1,193 @@ +/* + * Copyright 2025 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.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.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-v1/pom.xml b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1/pom.xml new file mode 100644 index 000000000000..93adb87fbe8b --- /dev/null +++ b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1 + 0.30.0-SNAPSHOT + grpc-google-shopping-merchant-conversions-v1 + GRPC library for google-shopping-merchant-conversions + + com.google.shopping + google-shopping-merchant-conversions-parent + 0.30.0-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-v1 + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceGrpc.java b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceGrpc.java new file mode 100644 index 000000000000..dcf13a2e2c5c --- /dev/null +++ b/java-shopping-merchant-conversions/grpc-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesServiceGrpc.java @@ -0,0 +1,1172 @@ +/* + * Copyright 2025 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.v1; + +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/v1/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.v1.ConversionSourcesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getCreateConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateConversionSource", + requestType = com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getCreateConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.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.v1 + .CreateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "CreateConversionSource")) + .build(); + } + } + } + return getCreateConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getUpdateConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateConversionSource", + requestType = com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getUpdateConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.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.v1 + .UpdateConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "UpdateConversionSource")) + .build(); + } + } + } + return getUpdateConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest, + com.google.protobuf.Empty> + getDeleteConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConversionSource", + requestType = com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest, + com.google.protobuf.Empty> + getDeleteConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.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.v1 + .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.v1.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getUndeleteConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteConversionSource", + requestType = + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getUndeleteConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.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.v1 + .UndeleteConversionSourceRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "UndeleteConversionSource")) + .build(); + } + } + } + return getUndeleteConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getGetConversionSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConversionSource", + requestType = com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest.class, + responseType = com.google.shopping.merchant.conversions.v1.ConversionSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource> + getGetConversionSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1.ConversionSource + .getDefaultInstance())) + .setSchemaDescriptor( + new ConversionSourcesServiceMethodDescriptorSupplier( + "GetConversionSource")) + .build(); + } + } + } + return getGetConversionSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse> + getListConversionSourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListConversionSources", + requestType = com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest.class, + responseType = + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse> + getListConversionSourcesMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1.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.v1 + .ListConversionSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.conversions.v1 + .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 all types of calls on the service */ + public static ConversionSourcesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConversionSourcesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceBlockingV2Stub(channel, callOptions); + } + }; + return ConversionSourcesServiceBlockingV2Stub.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.v1.CreateConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.UpdateConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.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.v1.UndeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteConversionSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + default void getConversionSource( + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.ListConversionSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.UpdateConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.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.v1.UndeleteConversionSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteConversionSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public void getConversionSource( + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest request, + io.grpc.stub.StreamObserver + 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.v1.ListConversionSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.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 ConversionSourcesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ConversionSourcesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConversionSourcesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConversionSourcesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new conversion source.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1.ConversionSource createConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource updateConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource undeleteConversionSource( + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse + listConversionSources( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListConversionSourcesMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited 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.v1.ConversionSource createConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource updateConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource undeleteConversionSource( + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteConversionSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Fetches a conversion source.
+     * 
+ */ + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse + listConversionSources( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource> + createConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource> + updateConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource> + undeleteConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource> + getConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse> + listConversionSources( + com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.ConversionSource>) + responseObserver); + break; + case METHODID_UPDATE_CONVERSION_SOURCE: + serviceImpl.updateConversionSource( + (com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.ConversionSource>) + responseObserver); + break; + case METHODID_DELETE_CONVERSION_SOURCE: + serviceImpl.deleteConversionSource( + (com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_CONVERSION_SOURCE: + serviceImpl.undeleteConversionSource( + (com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.ConversionSource>) + responseObserver); + break; + case METHODID_GET_CONVERSION_SOURCE: + serviceImpl.getConversionSource( + (com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.ConversionSource>) + responseObserver); + break; + case METHODID_LIST_CONVERSION_SOURCES: + serviceImpl.listConversionSources( + (com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource>( + service, METHODID_CREATE_CONVERSION_SOURCE))) + .addMethod( + getUpdateConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource>( + service, METHODID_UPDATE_CONVERSION_SOURCE))) + .addMethod( + getDeleteConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_CONVERSION_SOURCE))) + .addMethod( + getUndeleteConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource>( + service, METHODID_UNDELETE_CONVERSION_SOURCE))) + .addMethod( + getGetConversionSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest, + com.google.shopping.merchant.conversions.v1.ConversionSource>( + service, METHODID_GET_CONVERSION_SOURCE))) + .addMethod( + getListConversionSourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest, + com.google.shopping.merchant.conversions.v1.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.v1.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/pom.xml b/java-shopping-merchant-conversions/pom.xml index 668a21b52e4b..4638a90b4e53 100644 --- a/java-shopping-merchant-conversions/pom.xml +++ b/java-shopping-merchant-conversions/pom.xml @@ -31,6 +31,16 @@ google-shopping-merchant-conversions 0.30.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1 + 0.30.0-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-conversions-v1 + 0.30.0-SNAPSHOT + com.google.shopping.api.grpc grpc-google-shopping-merchant-conversions-v1beta @@ -48,7 +58,9 @@ google-shopping-merchant-conversions grpc-google-shopping-merchant-conversions-v1beta + grpc-google-shopping-merchant-conversions-v1 proto-google-shopping-merchant-conversions-v1beta + proto-google-shopping-merchant-conversions-v1 google-shopping-merchant-conversions-bom diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/clirr-ignored-differences.xml b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..a96335b5eadf --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/shopping/merchant/conversions/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/conversions/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/conversions/v1/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * clear() + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * clearField(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * clone() + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * setField(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/conversions/v1/** + * setUnknownFields(*) + ** + + diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/pom.xml b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/pom.xml new file mode 100644 index 000000000000..43e849ccd2d4 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-conversions-v1 + 0.30.0-SNAPSHOT + proto-google-shopping-merchant-conversions-v1 + Proto library for google-shopping-merchant-conversions + + com.google.shopping + google-shopping-merchant-conversions-parent + 0.30.0-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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AccountName.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AccountName.java new file mode 100644 index 000000000000..95d3d09dea4c --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 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.v1; + +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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettings.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettings.java new file mode 100644 index 000000000000..a937aac7fc69 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettings.java @@ -0,0 +1,2486 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Represents attribution settings for conversion sources receiving
+ * pre-attribution data.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.AttributionSettings} + */ +public final class AttributionSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.AttributionSettings.class, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder.class); + } + + /** + * + * + *
+   * The attribution model used for this source. We support the same set of
+   * [models offered by Google Analytics
+   * 4](https://support.google.com/analytics/answer/10596866).
+   * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings.AttributionModel) + } + + public interface ConversionTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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 the type of a conversion event.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType} + */ + public static final class ConversionType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType.class, + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType other = + (com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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 the type of a conversion event.
+     * 
+ * + * Protobuf type {@code + * google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType) + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + .class, + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + build() { + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + buildPartial() { + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType result = + new com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType) + private static final com.google.shopping.merchant.conversions.v1.AttributionSettings + .ConversionType + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ATTRIBUTION_LOOKBACK_WINDOW_DAYS_FIELD_NUMBER = 1; + private int attributionLookbackWindowDays_ = 0; + + /** + * + * + *
+   * Required. Lookback window (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.v1.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.v1.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel + getAttributionModel() { + com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel result = + com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel.forNumber( + attributionModel_); + return result == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel + .UNRECOGNIZED + : result; + } + + public static final int CONVERSION_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List< + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.AttributionSettings other = + (com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.AttributionSettings) + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.AttributionSettings.class, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder.class); + } + + // Construct using com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings build() { + com.google.shopping.merchant.conversions.v1.AttributionSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings buildPartial() { + com.google.shopping.merchant.conversions.v1.AttributionSettings result = + new com.google.shopping.merchant.conversions.v1.AttributionSettings(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings) { + return mergeFrom((com.google.shopping.merchant.conversions.v1.AttributionSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.AttributionSettings other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType m = + input.readMessage( + com.google.shopping.merchant.conversions.v1.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 window (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 window (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 window (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.v1.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.v1.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.v1.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel + getAttributionModel() { + com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel result = + com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel + .forNumber(attributionModel_); + return result == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.AttributionModel + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.AttributionModel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + attributionModel_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Attribution model.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType> + conversionType_ = java.util.Collections.emptyList(); + + private void ensureConversionTypeIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + conversionType_ = + new java.util.ArrayList< + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType>( + conversionType_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType.Builder, + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addConversionType( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType.Builder + addConversionTypeBuilder() { + return getConversionTypeFieldBuilder() + .addBuilder( + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType.Builder + addConversionTypeBuilder(int index) { + return getConversionTypeFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings.ConversionType.Builder> + getConversionTypeBuilderList() { + return getConversionTypeFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType.Builder, + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionTypeOrBuilder> + getConversionTypeFieldBuilder() { + if (conversionTypeBuilder_ == null) { + conversionTypeBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType, + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionType + .Builder, + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.AttributionSettings) + private static final com.google.shopping.merchant.conversions.v1.AttributionSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1.AttributionSettings(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettingsOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettingsOrBuilder.java new file mode 100644 index 000000000000..308bcf24cb43 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/AttributionSettingsOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface AttributionSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.AttributionSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Lookback window (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.v1.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.v1.AttributionSettings.AttributionModel attribution_model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionModel. + */ + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.AttributionSettings.ConversionType conversion_type = 3 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1.AttributionSettings.ConversionTypeOrBuilder + getConversionTypeOrBuilder(int index); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSource.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSource.java new file mode 100644 index 000000000000..100fddf6a34b --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSource.java @@ -0,0 +1,2517 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * 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.v1.ConversionSource} + */ +public final class ConversionSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ConversionSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ConversionSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ConversionSource.class, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder.class); + } + + /** + * + * + *
+   * Represents the state of a conversion source.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.conversions.v1.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 is currently
+     * not 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 is currently
+     * not 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.v1.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.v1.ConversionSource.State) + } + + /** + * + * + *
+   * Entity controlling the conversion source.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.conversions.v1.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 Youtube 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 Youtube 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.v1.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.v1.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.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink getGoogleAnalyticsLink() { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder() { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + + public static final int MERCHANT_CENTER_DESTINATION_FIELD_NUMBER = 4; + + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + getMerchantCenterDestination() { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } + + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder + getMerchantCenterDestinationOrBuilder() { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.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 conversion 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 conversion 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.v1.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.v1.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource.State getState() { + com.google.shopping.merchant.conversions.v1.ConversionSource.State result = + com.google.shopping.merchant.conversions.v1.ConversionSource.State.forNumber(state_); + return result == null + ? com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource.Controller getController() { + com.google.shopping.merchant.conversions.v1.ConversionSource.Controller result = + com.google.shopping.merchant.conversions.v1.ConversionSource.Controller.forNumber( + controller_); + return result == null + ? com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink) sourceData_); + } + if (sourceDataCase_ == 4) { + output.writeMessage( + 4, (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) sourceData_); + } + if (state_ + != com.google.shopping.merchant.conversions.v1.ConversionSource.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, state_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getExpireTime()); + } + if (controller_ + != com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink) sourceData_); + } + if (sourceDataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) sourceData_); + } + if (state_ + != com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.ConversionSource other = + (com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ConversionSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.ConversionSource) + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ConversionSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ConversionSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ConversionSource.class, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder.class); + } + + // Construct using com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ConversionSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource build() { + com.google.shopping.merchant.conversions.v1.ConversionSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource buildPartial() { + com.google.shopping.merchant.conversions.v1.ConversionSource result = + new com.google.shopping.merchant.conversions.v1.ConversionSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource) { + return mergeFrom((com.google.shopping.merchant.conversions.v1.ConversionSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.conversions.v1.ConversionSource other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder> + googleAnalyticsLinkBuilder_; + + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink + getGoogleAnalyticsLink() { + if (googleAnalyticsLinkBuilder_ == null) { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } else { + if (sourceDataCase_ == 3) { + return googleAnalyticsLinkBuilder_.getMessage(); + } + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeGoogleAnalyticsLink( + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink value) { + if (googleAnalyticsLinkBuilder_ == null) { + if (sourceDataCase_ == 3 + && sourceData_ + != com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink + .getDefaultInstance()) { + sourceData_ = + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.newBuilder( + (com.google.shopping.merchant.conversions.v1.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.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.Builder + getGoogleAnalyticsLinkBuilder() { + return getGoogleAnalyticsLinkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder() { + if ((sourceDataCase_ == 3) && (googleAnalyticsLinkBuilder_ != null)) { + return googleAnalyticsLinkBuilder_.getMessageOrBuilder(); + } else { + if (sourceDataCase_ == 3) { + return (com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) sourceData_; + } + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Immutable. Conversion Source of type "Link to Google Analytics Property".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder> + getGoogleAnalyticsLinkFieldBuilder() { + if (googleAnalyticsLinkBuilder_ == null) { + if (!(sourceDataCase_ == 3)) { + sourceData_ = + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + googleAnalyticsLinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.Builder, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder>( + (com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) sourceData_, + getParentForChildren(), + isClean()); + sourceData_ = null; + } + sourceDataCase_ = 3; + onChanged(); + return googleAnalyticsLinkBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder> + merchantCenterDestinationBuilder_; + + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + getMerchantCenterDestination() { + if (merchantCenterDestinationBuilder_ == null) { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } else { + if (sourceDataCase_ == 4) { + return merchantCenterDestinationBuilder_.getMessage(); + } + return com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder setMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder setMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public Builder mergeMerchantCenterDestination( + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination value) { + if (merchantCenterDestinationBuilder_ == null) { + if (sourceDataCase_ == 4 + && sourceData_ + != com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance()) { + sourceData_ = + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.newBuilder( + (com.google.shopping.merchant.conversions.v1.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.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.Builder + getMerchantCenterDestinationBuilder() { + return getMerchantCenterDestinationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder + getMerchantCenterDestinationOrBuilder() { + if ((sourceDataCase_ == 4) && (merchantCenterDestinationBuilder_ != null)) { + return merchantCenterDestinationBuilder_.getMessageOrBuilder(); + } else { + if (sourceDataCase_ == 4) { + return (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) + sourceData_; + } + return com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * Conversion Source of type "Merchant Center Tag Destination".
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder> + getMerchantCenterDestinationFieldBuilder() { + if (merchantCenterDestinationBuilder_ == null) { + if (!(sourceDataCase_ == 4)) { + sourceData_ = + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } + merchantCenterDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.Builder, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder>( + (com.google.shopping.merchant.conversions.v1.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 conversion 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 conversion 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 conversion 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 conversion 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 conversion 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.v1.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.v1.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.v1.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource.State getState() { + com.google.shopping.merchant.conversions.v1.ConversionSource.State result = + com.google.shopping.merchant.conversions.v1.ConversionSource.State.forNumber(state_); + return result == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.State.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. Current state of this conversion source. Can't be edited
+     * through the API.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource.Controller getController() { + com.google.shopping.merchant.conversions.v1.ConversionSource.Controller result = + com.google.shopping.merchant.conversions.v1.ConversionSource.Controller.forNumber( + controller_); + return result == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.Controller.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. Controller of the conversion source.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.ConversionSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.ConversionSource) + private static final com.google.shopping.merchant.conversions.v1.ConversionSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1.ConversionSource(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceName.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceName.java new file mode 100644 index 000000000000..9c07eb2c1559 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceName.java @@ -0,0 +1,198 @@ +/* + * Copyright 2025 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.v1; + +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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceOrBuilder.java new file mode 100644 index 000000000000..931a4d47b0b3 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourceOrBuilder.java @@ -0,0 +1,266 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface ConversionSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.ConversionSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The googleAnalyticsLink. + */ + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink getGoogleAnalyticsLink(); + + /** + * + * + *
+   * Immutable. Conversion Source of type "Link to Google Analytics Property".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.GoogleAnalyticsLink google_analytics_link = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder + getGoogleAnalyticsLinkOrBuilder(); + + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination merchant_center_destination = 4; + * + * + * @return The merchantCenterDestination. + */ + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + getMerchantCenterDestination(); + + /** + * + * + *
+   * Conversion Source of type "Merchant Center Tag Destination".
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.MerchantCenterDestination merchant_center_destination = 4; + * + */ + com.google.shopping.merchant.conversions.v1.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 conversion 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 conversion 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.v1.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.v1.ConversionSource.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource.Controller controller = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The controller. + */ + com.google.shopping.merchant.conversions.v1.ConversionSource.Controller getController(); + + com.google.shopping.merchant.conversions.v1.ConversionSource.SourceDataCase getSourceDataCase(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesProto.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesProto.java new file mode 100644 index 000000000000..83efdfda5231 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ConversionSourcesProto.java @@ -0,0 +1,349 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +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_v1_ConversionSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_ConversionSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_conversions_v1_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 = { + "\n" + + "?google/shopping/merchant/conversions/v1/conversionsources.proto\022\'google.shoppi" + + "ng.merchant.conversions.v1\032\034google/api/a" + + "nnotations.proto\032\027google/api/client.prot" + + "o\032\037google/api/field_behavior.proto\032\031goog" + + "le/api/resource.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\232\006\n" + + "\020ConversionSource\022b\n" + + "\025google_analytics_link\030\003 \001(\0132<.google.shopping.merchant.con" + + "versions.v1.GoogleAnalyticsLinkB\003\340A\005H\000\022i\n" + + "\033merchant_center_destination\030\004 \001(\0132B.go" + + "ogle.shopping.merchant.conversions.v1.MerchantCenterDestinationH\000\022\024\n" + + "\004name\030\001 \001(\tB\006\340A\003\340A\010\022S\n" + + "\005state\030\005 \001(\0162?.google.shopping" + + ".merchant.conversions.v1.ConversionSource.StateB\003\340A\003\0224\n" + + "\013expire_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022]\n\n" + + "controller\030\007 \001(\0162D.google.shopping.merchant.conver" + + "sions.v1.ConversionSource.ControllerB\003\340A\003\"E\n" + + "\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\n\n" + + "\006ACTIVE\020\001\022\014\n" + + "\010ARCHIVED\020\002\022\013\n" + + "\007PENDING\020\003\"N\n\n" + + "Controller\022\032\n" + + "\026CONTROLLER_UNSPECIFIED\020\000\022\014\n" + + "\010MERCHANT\020\001\022\026\n" + + "\022YOUTUBE_AFFILIATES\020\002:\220\001\352A\214\001\n" + + "+merchantapi.googleapis.com/ConversionSource\0228accounts/{account}/conversionSourc" + + "es/{conversion_source}*\021conversionSources2\020conversionSourceB\r\n" + + "\013source_data\"\347\004\n" + + "\023AttributionSettings\022-\n" + + " attribution_lookback_window_days\030\001 \001(\005B\003\340A\002\022m\n" + + "\021attribution_model\030\002 \001(\0162M.google.shopping.merchant." + + "conversions.v1.AttributionSettings.AttributionModelB\003\340A\002\022l\n" + + "\017conversion_type\030\003 \003(\0132K.google.shopping.merchant.conversions" + + ".v1.AttributionSettings.ConversionTypeB\006\340A\006\340A\005\0328\n" + + "\016ConversionType\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\023\n" + + "\006report\030\002 \001(\010B\003\340A\003\"\211\002\n" + + "\020AttributionModel\022!\n" + + "\035ATTRIBUTION_MODEL_UNSPECIFIED\020\000\022\034\n" + + "\030CROSS_CHANNEL_LAST_CLICK\020\001\022\034\n" + + "\030ADS_PREFERRED_LAST_CLICK\020\002\022\035\n" + + "\031CROSS_CHANNEL_DATA_DRIVEN\020\005\022\035\n" + + "\031CROSS_CHANNEL_FIRST_CLICK\020\006\022\030\n" + + "\024CROSS_CHANNEL_LINEAR\020\007\022 \n" + + "\034CROSS_CHANNEL_POSITION_BASED\020\010\022\034\n" + + "\030CROSS_CHANNEL_TIME_DECAY\020\t\"\252\001\n" + + "\023GoogleAnalyticsLink\022\033\n" + + "\013property_id\030\001 \001(\003B\006\340A\002\340A\005\022_\n" + + "\024attribution_settings\030\002 \001(\0132<.google.shopping.mercha" + + "nt.conversions.v1.AttributionSettingsB\003\340A\003\022\025\n" + + "\010property\030\003 \001(\tB\003\340A\003\"\315\001\n" + + "\031MerchantCenterDestination\022\030\n" + + "\013destination\030\001 \001(\tB\003\340A\003\022_\n" + + "\024attribution_settings\030\002 \001(\0132<.google" + + ".shopping.merchant.conversions.v1.AttributionSettingsB\003\340A\002\022\031\n" + + "\014display_name\030\003 \001(\tB\003\340A\002\022\032\n\r" + + "currency_code\030\004 \001(\tB\003\340A\002\"\277\001\n" + + "\035CreateConversionSourceRequest\022C\n" + + "\006parent\030\001 \001(" + + "\tB3\340A\002\372A-\022+merchantapi.googleapis.com/ConversionSource\022Y\n" + + "\021conversion_source\030\002 " + + "\001(\01329.google.shopping.merchant.conversions.v1.ConversionSourceB\003\340A\002\"\260\001\n" + + "\035UpdateConversionSourceRequest\022Y\n" + + "\021conversion_source\030\001" + + " \001(\01329.google.shopping.merchant.conversions.v1.ConversionSourceB\003\340A\002\0224\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"b\n" + + "\035DeleteConversionSourceRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n" + + "+merchantapi.googleapis.com/ConversionSource\"d\n" + + "\037UndeleteConversionSourceRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n" + + "+merchantapi.googleapis.com/ConversionSource\"_\n" + + "\032GetConversionSourceRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n" + + "+merchantapi.googleapis.com/ConversionSource\"\257\001\n" + + "\034ListConversionSourcesRequest\022C\n" + + "\006parent\030\001 \001(\tB3\340A\002\372" + + "A-\022+merchantapi.googleapis.com/ConversionSource\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\022\031\n" + + "\014show_deleted\030\004 \001(\010B\003\340A\001\"\217\001\n" + + "\035ListConversionSourcesResponse\022U\n" + + "\022conversion_sources\030\001 \003(\01329.google.shopp" + + "ing.merchant.conversions.v1.ConversionSource\022\027\n" + + "\017next_page_token\030\002 \001(\t2\216\014\n" + + "\030ConversionSourcesService\022\210\002\n" + + "\026CreateConversionSource\022F.google.shopping.merchant.convers" + + "ions.v1.CreateConversionSourceRequest\0329.google.shopping.merchant.conversions.v1." + + "ConversionSource\"k\332A\030parent,conversion_s" + + "ource\202\323\344\223\002J\"5/conversions/v1/{parent=acc" + + "ounts/*}/conversionSources:\021conversion_source\022\240\002\n" + + "\026UpdateConversionSource\022F.google.shopping.merchant.conversions.v1.Updat" + + "eConversionSourceRequest\0329.google.shopping.merchant.conversions.v1.ConversionSou" + + "rce\"\202\001\332A\035conversion_source,update_mask\202\323" + + "\344\223\002\\2G/conversions/v1/{conversion_source" + + ".name=accounts/*/conversionSources/*}:\021conversion_source\022\276\001\n" + + "\026DeleteConversionSource\022F.google.shopping.merchant.conversio" + + "ns.v1.DeleteConversionSourceRequest\032\026.go" + + "ogle.protobuf.Empty\"D\332A\004name\202\323\344\223\0027*5/con" + + "versions/v1/{name=accounts/*/conversionSources/*}\022\352\001\n" + + "\030UndeleteConversionSource\022H.google.shopping.merchant.conversions.v1" + + ".UndeleteConversionSourceRequest\0329.google.shopping.merchant.conversions.v1.Conve" + + "rsionSource\"I\202\323\344\223\002C\">/conversions/v1/{na" + + "me=accounts/*/conversionSources/*}:undelete:\001*\022\333\001\n" + + "\023GetConversionSource\022C.google.shopping.merchant.conversions.v1.GetConv" + + "ersionSourceRequest\0329.google.shopping.merchant.conversions.v1.ConversionSource\"D" + + "\332A\004name\202\323\344\223\0027\0225/conversions/v1/{name=accounts/*/conversionSources/*}\022\356\001\n" + + "\025ListConversionSources\022E.google.shopping.merchan" + + "t.conversions.v1.ListConversionSourcesRequest\032F.google.shopping.merchant.convers" + + "ions.v1.ListConversionSourcesResponse\"F\332" + + "A\006parent\202\323\344\223\0027\0225/conversions/v1/{parent=" + + "accounts/*}/conversionSources\032G\312A\032mercha" + + "ntapi.googleapis.com\322A\'https://www.googleapis.com/auth/contentB\331\002\n" + + "+com.google.shopping.merchant.conversions.v1B\026Conversi" + + "onSourcesProtoP\001ZScloud.google.com/go/shopping/merchant/conversions/apiv1/conver" + + "sionspb;conversionspb\252\002\'Google.Shopping." + + "Merchant.Conversions.V1\312\002\'Google\\Shoppin" + + "g\\Merchant\\Conversions\\V1\352\002+Google::Shopping::Merchant::Conversions::V1\352A8\n" + + "\"merchantapi.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_v1_ConversionSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_conversions_v1_ConversionSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_ConversionSource_descriptor, + new java.lang.String[] { + "GoogleAnalyticsLink", + "MerchantCenterDestination", + "Name", + "State", + "ExpireTime", + "Controller", + "SourceData", + }); + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor, + new java.lang.String[] { + "AttributionLookbackWindowDays", "AttributionModel", "ConversionType", + }); + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor = + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_descriptor + .getNestedTypes() + .get(0); + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_AttributionSettings_ConversionType_descriptor, + new java.lang.String[] { + "Name", "Report", + }); + internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor, + new java.lang.String[] { + "PropertyId", "AttributionSettings", "Property", + }); + internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor, + new java.lang.String[] { + "Destination", "AttributionSettings", "DisplayName", "CurrencyCode", + }); + internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor, + new java.lang.String[] { + "Parent", "ConversionSource", + }); + internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor, + new java.lang.String[] { + "ConversionSource", "UpdateMask", + }); + internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "ShowDeleted", + }); + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_conversions_v1_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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequest.java new file mode 100644 index 000000000000..10dad344924c --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequest.java @@ -0,0 +1,1011 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the CreateConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.CreateConversionSourceRequest} + */ +public final class CreateConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversionSource_; + + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } + + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.CreateConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.CreateConversionSourceRequest) + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_CreateConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversionSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + conversionSourceBuilder_; + + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource() { + if (conversionSourceBuilder_ == null) { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversionSource( + com.google.shopping.merchant.conversions.v1.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && conversionSource_ != null + && conversionSource_ + != com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + if (conversionSourceBuilder_ != null) { + return conversionSourceBuilder_.getMessageOrBuilder(); + } else { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } + } + + /** + * + * + *
+     * Required. The conversion source description. A new ID will be automatically
+     * assigned to it upon creation.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + getConversionSourceFieldBuilder() { + if (conversionSourceBuilder_ == null) { + conversionSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.CreateConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.CreateConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.CreateConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..b5b21af53c48 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/CreateConversionSourceRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface CreateConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource(); + + /** + * + * + *
+   * Required. The conversion source description. A new ID will be automatically
+   * assigned to it upon creation.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequest.java new file mode 100644 index 000000000000..d726227461ee --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequest.java @@ -0,0 +1,674 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the DeleteConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest} + */ +public final class DeleteConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.DeleteConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest) + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_DeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.DeleteConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.DeleteConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..c79c0abbd5fd --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/DeleteConversionSourceRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface DeleteConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequest.java new file mode 100644 index 000000000000..f504411500e6 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequest.java @@ -0,0 +1,668 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the GetConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.GetConversionSourceRequest} + */ +public final class GetConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.GetConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.GetConversionSourceRequest) + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GetConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest buildPartial() { + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.GetConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1.GetConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GetConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..3b0ff6a1d5d0 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GetConversionSourceRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface GetConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLink.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLink.java new file mode 100644 index 000000000000..730ea4853c12 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLink.java @@ -0,0 +1,1088 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * "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.v1.GoogleAnalyticsLink} + */ +public final class GoogleAnalyticsLink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.class, + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attributionSettings_; + + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings getAttributionSettings() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink other = + (com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.GoogleAnalyticsLink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.class, + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.Builder.class); + } + + // Construct using com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_GoogleAnalyticsLink_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink build() { + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink buildPartial() { + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink result = + new com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink) { + return mergeFrom((com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attributionSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder> + attributionSettingsBuilder_; + + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings + getAttributionSettings() { + if (attributionSettingsBuilder_ == null) { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } else { + return attributionSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAttributionSettings( + com.google.shopping.merchant.conversions.v1.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attributionSettings_ != null + && attributionSettings_ + != com.google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder + getAttributionSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttributionSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + if (attributionSettingsBuilder_ != null) { + return attributionSettingsBuilder_.getMessageOrBuilder(); + } else { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + } + + /** + * + * + *
+     * Output only. Attribution settings for the linked Google Analytics property.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder> + getAttributionSettingsFieldBuilder() { + if (attributionSettingsBuilder_ == null) { + attributionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.GoogleAnalyticsLink) + private static final com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1.GoogleAnalyticsLink(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.GoogleAnalyticsLink + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLinkOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLinkOrBuilder.java new file mode 100644 index 000000000000..aa89b891a678 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/GoogleAnalyticsLinkOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface GoogleAnalyticsLinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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.v1.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.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributionSettings. + */ + com.google.shopping.merchant.conversions.v1.AttributionSettings getAttributionSettings(); + + /** + * + * + *
+   * Output only. Attribution settings for the linked Google Analytics property.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.conversions.v1.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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequest.java new file mode 100644 index 000000000000..d26484a256f7 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequest.java @@ -0,0 +1,1075 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the ListConversionSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.ListConversionSourcesRequest} + */ +public final class ListConversionSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest.class, + com.google.shopping.merchant.conversions.v1.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) conversion sources. By default, deleted
+   * conversion sources are not returned.
+   * 
+ * + * 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.v1.ListConversionSourcesRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListConversionSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.ListConversionSourcesRequest) + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest.class, + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest build() { + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest buildPartial() { + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest result = + new com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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) conversion sources. By default, deleted
+     * conversion sources are not returned.
+     * 
+ * + * bool show_deleted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The showDeleted. + */ + @java.lang.Override + public boolean getShowDeleted() { + return showDeleted_; + } + + /** + * + * + *
+     * Optional. Show deleted (archived) conversion sources. By default, deleted
+     * conversion sources are not returned.
+     * 
+ * + * 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) conversion sources. By default, deleted
+     * conversion sources are not returned.
+     * 
+ * + * 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.v1.ListConversionSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.ListConversionSourcesRequest) + private static final com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..2702140b3c56 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesRequestOrBuilder.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface ListConversionSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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) conversion sources. By default, deleted
+   * conversion sources are not returned.
+   * 
+ * + * 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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponse.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponse.java new file mode 100644 index 000000000000..581c13bba4a8 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponse.java @@ -0,0 +1,1243 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Response message for the ListConversionSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.ListConversionSourcesResponse} + */ +public final class ListConversionSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse.class, + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public java.util.List + getConversionSourcesList() { + return conversionSources_; + } + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + getConversionSourcesOrBuilderList() { + return conversionSources_; + } + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public int getConversionSourcesCount() { + return conversionSources_.size(); + } + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSources( + int index) { + return conversionSources_.get(index); + } + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse other = + (com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListConversionSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.ListConversionSourcesResponse) + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse.class, + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_ListConversionSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse build() { + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse + buildPartial() { + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse result = + new com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.conversions.v1.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.v1.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.v1.ListConversionSourcesResponse) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource m = + input.readMessage( + com.google.shopping.merchant.conversions.v1.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( + conversionSources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + conversionSourcesBuilder_; + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.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.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder setConversionSources( + int index, com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder setConversionSources( + int index, + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + int index, com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder addConversionSources( + int index, + com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public Builder addAllConversionSources( + java.lang.Iterable + 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.v1.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.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource.Builder + getConversionSourcesBuilder(int index) { + return getConversionSourcesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversion_sources = 1; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + getConversionSourcesOrBuilderList() { + if (conversionSourcesBuilder_ != null) { + return conversionSourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(conversionSources_); + } + } + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource.Builder + addConversionSourcesBuilder() { + return getConversionSourcesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance()); + } + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource.Builder + addConversionSourcesBuilder(int index) { + return getConversionSourcesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance()); + } + + /** + * + * + *
+     * List of conversion sources.
+     * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + public java.util.List + getConversionSourcesBuilderList() { + return getConversionSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + getConversionSourcesFieldBuilder() { + if (conversionSourcesBuilder_ == null) { + conversionSourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.ListConversionSourcesResponse) + private static final com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.ListConversionSourcesResponse(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.ListConversionSourcesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponseOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..0f685c864183 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/ListConversionSourcesResponseOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface ListConversionSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.ListConversionSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + java.util.List + getConversionSourcesList(); + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSources(int index); + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + int getConversionSourcesCount(); + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + java.util.List + getConversionSourcesOrBuilderList(); + + /** + * + * + *
+   * List of conversion sources.
+   * 
+ * + * + * repeated .google.shopping.merchant.conversions.v1.ConversionSource conversion_sources = 1; + * + */ + com.google.shopping.merchant.conversions.v1.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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestination.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestination.java new file mode 100644 index 000000000000..345f48bd9b4a --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestination.java @@ -0,0 +1,1384 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * "Merchant Center Destination" sources can be used to send conversion events
+ * from an online store using a Google tag directly to a Merchant Center account
+ * where the source is created.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.MerchantCenterDestination} + */ +public final class MerchantCenterDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.class, + com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attributionSettings_; + + /** + * + * + *
+   * Required. Attribution settings used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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 used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettings getAttributionSettings() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + + /** + * + * + *
+   * Required. Attribution settings used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.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.
+   * The maximum length is 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.
+   * The maximum length is 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.v1.MerchantCenterDestination)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination other = + (com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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 an online store using a Google tag directly to a Merchant Center account
+   * where the source is created.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.MerchantCenterDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.MerchantCenterDestination) + com.google.shopping.merchant.conversions.v1.MerchantCenterDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.class, + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_MerchantCenterDestination_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination build() { + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.MerchantCenterDestination buildPartial() { + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination result = + new com.google.shopping.merchant.conversions.v1.MerchantCenterDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.MerchantCenterDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.MerchantCenterDestination other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.AttributionSettings attributionSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder> + attributionSettingsBuilder_; + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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 used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings + getAttributionSettings() { + if (attributionSettingsBuilder_ == null) { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } else { + return attributionSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1.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 used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAttributionSettings( + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder builderForValue) { + if (attributionSettingsBuilder_ == null) { + attributionSettings_ = builderForValue.build(); + } else { + attributionSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAttributionSettings( + com.google.shopping.merchant.conversions.v1.AttributionSettings value) { + if (attributionSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && attributionSettings_ != null + && attributionSettings_ + != com.google.shopping.merchant.conversions.v1.AttributionSettings + .getDefaultInstance()) { + getAttributionSettingsBuilder().mergeFrom(value); + } else { + attributionSettings_ = value; + } + } else { + attributionSettingsBuilder_.mergeFrom(value); + } + if (attributionSettings_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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 used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder + getAttributionSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAttributionSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder() { + if (attributionSettingsBuilder_ != null) { + return attributionSettingsBuilder_.getMessageOrBuilder(); + } else { + return attributionSettings_ == null + ? com.google.shopping.merchant.conversions.v1.AttributionSettings.getDefaultInstance() + : attributionSettings_; + } + } + + /** + * + * + *
+     * Required. Attribution settings used for the Merchant Center Destination.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder> + getAttributionSettingsFieldBuilder() { + if (attributionSettingsBuilder_ == null) { + attributionSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.AttributionSettings, + com.google.shopping.merchant.conversions.v1.AttributionSettings.Builder, + com.google.shopping.merchant.conversions.v1.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.
+     * The maximum length is 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.
+     * The maximum length is 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.
+     * The maximum length is 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.
+     * The maximum length is 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.
+     * The maximum length is 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.v1.MerchantCenterDestination) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.MerchantCenterDestination) + private static final com.google.shopping.merchant.conversions.v1.MerchantCenterDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.conversions.v1.MerchantCenterDestination(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.MerchantCenterDestination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestinationOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestinationOrBuilder.java new file mode 100644 index 000000000000..a975659c3af1 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/MerchantCenterDestinationOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface MerchantCenterDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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 used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the attributionSettings field is set. + */ + boolean hasAttributionSettings(); + + /** + * + * + *
+   * Required. Attribution settings used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The attributionSettings. + */ + com.google.shopping.merchant.conversions.v1.AttributionSettings getAttributionSettings(); + + /** + * + * + *
+   * Required. Attribution settings used for the Merchant Center Destination.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.AttributionSettings attribution_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1.AttributionSettingsOrBuilder + getAttributionSettingsOrBuilder(); + + /** + * + * + *
+   * Required. Merchant-specified display name for the destination. This is the
+   * name that identifies the conversion source within the Merchant Center UI.
+   * The maximum length is 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.
+   * The maximum length is 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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequest.java new file mode 100644 index 000000000000..6faf4f5f00e2 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequest.java @@ -0,0 +1,680 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the UndeleteConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest} + */ +public final class UndeleteConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.UndeleteConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest) + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UndeleteConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.UndeleteConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UndeleteConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..2c20420c0a3f --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UndeleteConversionSourceRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface UndeleteConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.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-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequest.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequest.java new file mode 100644 index 000000000000..efa2463d58a0 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequest.java @@ -0,0 +1,1076 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +/** + * + * + *
+ * Request message for the UpdateConversionSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest} + */ +public final class UpdateConversionSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest.Builder + .class); + } + + private int bitField0_; + public static final int CONVERSION_SOURCE_FIELD_NUMBER = 1; + private com.google.shopping.merchant.conversions.v1.ConversionSource conversionSource_; + + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } + + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @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.v1.UpdateConversionSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest other = + (com.google.shopping.merchant.conversions.v1.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.v1.UpdateConversionSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UpdateConversionSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UpdateConversionSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.UpdateConversionSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest) + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.conversions.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest.class, + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.conversions.v1.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.v1.ConversionSourcesProto + .internal_static_google_shopping_merchant_conversions_v1_UpdateConversionSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest build() { + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest + buildPartial() { + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest result = + new com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.conversions.v1.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.v1.UpdateConversionSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest other) { + if (other + == com.google.shopping.merchant.conversions.v1.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.v1.ConversionSource conversionSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + conversionSourceBuilder_; + + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource() { + if (conversionSourceBuilder_ == null) { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } else { + return conversionSourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1.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.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConversionSource( + com.google.shopping.merchant.conversions.v1.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.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConversionSource( + com.google.shopping.merchant.conversions.v1.ConversionSource value) { + if (conversionSourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && conversionSource_ != null + && conversionSource_ + != com.google.shopping.merchant.conversions.v1.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.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSource.Builder + getConversionSourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getConversionSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder() { + if (conversionSourceBuilder_ != null) { + return conversionSourceBuilder_.getMessageOrBuilder(); + } else { + return conversionSource_ == null + ? com.google.shopping.merchant.conversions.v1.ConversionSource.getDefaultInstance() + : conversionSource_; + } + } + + /** + * + * + *
+     * Required. The new version of the conversion source data.
+     * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder> + getConversionSourceFieldBuilder() { + if (conversionSourceBuilder_ == null) { + conversionSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.conversions.v1.ConversionSource, + com.google.shopping.merchant.conversions.v1.ConversionSource.Builder, + com.google.shopping.merchant.conversions.v1.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_; + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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; + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. List of fields being updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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.v1.UpdateConversionSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest) + private static final com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest(); + } + + public static com.google.shopping.merchant.conversions.v1.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.v1.UpdateConversionSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequestOrBuilder.java b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequestOrBuilder.java new file mode 100644 index 000000000000..bee0e27b86f7 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/java/com/google/shopping/merchant/conversions/v1/UpdateConversionSourceRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2025 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/v1/conversionsources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.conversions.v1; + +public interface UpdateConversionSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.conversions.v1.UpdateConversionSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.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.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The conversionSource. + */ + com.google.shopping.merchant.conversions.v1.ConversionSource getConversionSource(); + + /** + * + * + *
+   * Required. The new version of the conversion source data.
+   * 
+ * + * + * .google.shopping.merchant.conversions.v1.ConversionSource conversion_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.conversions.v1.ConversionSourceOrBuilder + getConversionSourceOrBuilder(); + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. List of fields being updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/proto/google/shopping/merchant/conversions/v1/conversionsources.proto b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/proto/google/shopping/merchant/conversions/v1/conversionsources.proto new file mode 100644 index 000000000000..5ba31ba08dd1 --- /dev/null +++ b/java-shopping-merchant-conversions/proto-google-shopping-merchant-conversions-v1/src/main/proto/google/shopping/merchant/conversions/v1/conversionsources.proto @@ -0,0 +1,379 @@ +// Copyright 2025 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.v1; + +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 csharp_namespace = "Google.Shopping.Merchant.Conversions.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/conversions/apiv1/conversionspb;conversionspb"; +option java_multiple_files = true; +option java_outer_classname = "ConversionSourcesProto"; +option java_package = "com.google.shopping.merchant.conversions.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\Conversions\\V1"; +option ruby_package = "Google::Shopping::Merchant::Conversions::V1"; +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/v1/{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/v1/{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/v1/{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/v1/{name=accounts/*/conversionSources/*}:undelete" + body: "*" + }; + } + + // Fetches a conversion source. + rpc GetConversionSource(GetConversionSourceRequest) + returns (ConversionSource) { + option (google.api.http) = { + get: "/conversions/v1/{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/v1/{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 the state of a 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 is currently + // not 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 Youtube 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 conversion 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 the type of a conversion event. + 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](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 window (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 an online store 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 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. + // The maximum length is 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. + ConversionSource conversion_source = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// 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) conversion sources. By default, deleted + // conversion sources are not returned. + 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/v1/conversionsourcesservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e189dfb0e531 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceSettings; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a4ddfd6814b2 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceSettings; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateUseHttpJsonTransport.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..314d117ad0e7 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/create/SyncCreateUseHttpJsonTransport.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_Create_UseHttpJsonTransport_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceSettings; + +public class SyncCreateUseHttpJsonTransport { + + public static void main(String[] args) throws Exception { + syncCreateUseHttpJsonTransport(); + } + + public static void syncCreateUseHttpJsonTransport() 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_v1_generated_ConversionSourcesService_Create_UseHttpJsonTransport_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.java new file mode 100644 index 000000000000..746ba563c9f4 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/AsyncCreateConversionSource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_CreateConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_CreateConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..67dabce5504c --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_CreateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.java new file mode 100644 index 000000000000..7b679ccb692f --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceAccountnameConversionsource.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_CreateConversionSource_AccountnameConversionsource_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_CreateConversionSource_AccountnameConversionsource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.java new file mode 100644 index 000000000000..c8dd56363abd --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/createconversionsource/SyncCreateConversionSourceStringConversionsource.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_CreateConversionSource_StringConversionsource_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_CreateConversionSource_StringConversionsource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.java new file mode 100644 index 000000000000..ee3dcb69c82e --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/AsyncDeleteConversionSource.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_DeleteConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_DeleteConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.java new file mode 100644 index 000000000000..fc6a680eadb5 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSource.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_DeleteConversionSource_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_DeleteConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.java new file mode 100644 index 000000000000..9989b3f52d10 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceConversionsourcename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_DeleteConversionSource_Conversionsourcename_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_DeleteConversionSource_Conversionsourcename_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.java new file mode 100644 index 000000000000..1d34c15a3fbf --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/deleteconversionsource/SyncDeleteConversionSourceString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_DeleteConversionSource_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_DeleteConversionSource_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.java new file mode 100644 index 000000000000..5b0ce943b075 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/AsyncGetConversionSource.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_GetConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_GetConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSource.java new file mode 100644 index 000000000000..692afb64175c --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSource.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_GetConversionSource_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_GetConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.java new file mode 100644 index 000000000000..a92e73baf9f5 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceConversionsourcename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_GetConversionSource_Conversionsourcename_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_GetConversionSource_Conversionsourcename_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.java new file mode 100644 index 000000000000..e683d401ae0b --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/getconversionsource/SyncGetConversionSourceString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_GetConversionSource_String_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_GetConversionSource_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java new file mode 100644 index 000000000000..14623b8b4f52 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSources.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_ListConversionSources_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_ListConversionSources_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java new file mode 100644 index 000000000000..77efe55ce289 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/AsyncListConversionSourcesPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_ListConversionSources_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.ListConversionSourcesRequest; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_ListConversionSources_Paged_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSources.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSources.java new file mode 100644 index 000000000000..08d335b0f832 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSources.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_ListConversionSources_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_ListConversionSources_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.java new file mode 100644 index 000000000000..48a3dd8cd462 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesAccountname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_ListConversionSources_Accountname_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_ListConversionSources_Accountname_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.java new file mode 100644 index 000000000000..3215d83c5ef9 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/listconversionsources/SyncListConversionSourcesString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_ListConversionSources_String_sync] +import com.google.shopping.merchant.conversions.v1.AccountName; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_ListConversionSources_String_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.java new file mode 100644 index 000000000000..c9f6ae24385f --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/AsyncUndeleteConversionSource.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_UndeleteConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_UndeleteConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.java new file mode 100644 index 000000000000..afa77e890377 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/undeleteconversionsource/SyncUndeleteConversionSource.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_UndeleteConversionSource_sync] +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourceName; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_UndeleteConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.java new file mode 100644 index 000000000000..769119246912 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/AsyncUpdateConversionSource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_UpdateConversionSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_UpdateConversionSource_async] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java new file mode 100644 index 000000000000..6a9604107001 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSource.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_UpdateConversionSource_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.ConversionSourcesServiceClient; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_UpdateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.java new file mode 100644 index 000000000000..986f2aa7bcb6 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservice/updateconversionsource/SyncUpdateConversionSourceConversionsourceFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesService_UpdateConversionSource_ConversionsourceFieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.conversions.v1.ConversionSource; +import com.google.shopping.merchant.conversions.v1.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_v1_generated_ConversionSourcesService_UpdateConversionSource_ConversionsourceFieldmask_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..41f9fc7f11c6 --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/conversionsourcesservicesettings/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 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.v1.samples; + +// [START merchantapi_v1_generated_ConversionSourcesServiceSettings_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1.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() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + ConversionSourcesServiceSettings conversionSourcesServiceSettings = + conversionSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_ConversionSourcesServiceSettings_CreateConversionSource_sync] diff --git a/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java new file mode 100644 index 000000000000..0bb86b91493f --- /dev/null +++ b/java-shopping-merchant-conversions/samples/snippets/generated/com/google/shopping/merchant/conversions/v1/stub/conversionsourcesservicestubsettings/createconversionsource/SyncCreateConversionSource.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 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.v1.stub.samples; + +// [START merchantapi_v1_generated_ConversionSourcesServiceStubSettings_CreateConversionSource_sync] +import com.google.shopping.merchant.conversions.v1.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() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + ConversionSourcesServiceStubSettings conversionSourcesServiceSettings = + conversionSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_ConversionSourcesServiceStubSettings_CreateConversionSource_sync] diff --git a/versions.txt b/versions.txt index d8ea2fc035de..f69e283a4c68 100644 --- a/versions.txt +++ b/versions.txt @@ -878,3 +878,5 @@ proto-google-cloud-bigquerydatapolicy-v2:0.67.0:0.68.0-SNAPSHOT grpc-google-cloud-bigquerydatapolicy-v2:0.67.0:0.68.0-SNAPSHOT proto-google-cloud-configdelivery-v1:0.4.0:0.5.0-SNAPSHOT grpc-google-cloud-configdelivery-v1:0.4.0:0.5.0-SNAPSHOT +proto-google-shopping-merchant-conversions-v1:0.29.0:0.30.0-SNAPSHOT +grpc-google-shopping-merchant-conversions-v1:0.29.0:0.30.0-SNAPSHOT