diff --git a/generation_config.yaml b/generation_config.yaml index 4ef4c9784e9f..9857d70f0964 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -2265,6 +2265,7 @@ libraries: group_id: com.google.shopping cloud_api: false GAPICs: + - proto_path: google/shopping/merchant/datasources/v1 - proto_path: google/shopping/merchant/datasources/v1beta library_name: shopping-merchant-datasources requires_billing: true diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources-bom/pom.xml b/java-shopping-merchant-datasources/google-shopping-merchant-datasources-bom/pom.xml index 000846f96995..2fe07b906e00 100644 --- a/java-shopping-merchant-datasources/google-shopping-merchant-datasources-bom/pom.xml +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources-bom/pom.xml @@ -33,11 +33,21 @@ grpc-google-shopping-merchant-datasources-v1beta 0.27.0-SNAPSHOT + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + com.google.shopping.api.grpc proto-google-shopping-merchant-datasources-v1beta 0.27.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/pom.xml b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/pom.xml index fea0c39f693f..78bc415e94e7 100644 --- a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/pom.xml +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/pom.xml @@ -41,6 +41,10 @@ proto-google-common-protos + + com.google.shopping.api.grpc + proto-google-shopping-merchant-datasources-v1 + com.google.shopping.api.grpc proto-google-shopping-merchant-datasources-v1beta @@ -66,6 +70,11 @@ grpc-google-common-protos test + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-datasources-v1 + test + com.google.api.grpc proto-google-iam-v1 diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClient.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClient.java new file mode 100644 index 000000000000..408551f9d60b --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClient.java @@ -0,0 +1,1063 @@ +/* + * 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.datasources.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.datasources.v1.stub.DataSourcesServiceStub; +import com.google.shopping.merchant.datasources.v1.stub.DataSourcesServiceStubSettings; +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 to manage primary, supplemental, inventory and other data sources. + * See more in the [Merchant Center](https://support.google.com/merchants/answer/7439058) help + * article. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+ *   DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]");
+ *   DataSource response = dataSourcesServiceClient.getDataSource(name);
+ * }
+ * }
+ * + *

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

GetDataSource

Retrieves the data source configuration for the given account.

+ *

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

+ *
    + *
  • getDataSource(GetDataSourceRequest request) + *

+ *

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

+ *
    + *
  • getDataSource(DataSourceName name) + *

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

+ *
    + *
  • getDataSourceCallable() + *

+ *

ListDataSources

Lists the configurations for data sources for the given account.

+ *

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

+ *
    + *
  • listDataSources(ListDataSourcesRequest request) + *

+ *

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

+ *
    + *
  • listDataSources(AccountName parent) + *

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

+ *
    + *
  • listDataSourcesPagedCallable() + *

  • listDataSourcesCallable() + *

+ *

CreateDataSource

Creates the new data source configuration for the given account. This method always creates a new data source.

+ *

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

+ *
    + *
  • createDataSource(CreateDataSourceRequest request) + *

+ *

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

+ *
    + *
  • createDataSource(AccountName parent, DataSource dataSource) + *

  • createDataSource(String parent, DataSource dataSource) + *

+ *

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

+ *
    + *
  • createDataSourceCallable() + *

+ *

UpdateDataSource

Updates the existing data source configuration. The fields that are set in the update mask but not provided in the resource will be deleted.

+ *

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

+ *
    + *
  • updateDataSource(UpdateDataSourceRequest request) + *

+ *

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

+ *
    + *
  • updateDataSource(DataSource dataSource, 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.

+ *
    + *
  • updateDataSourceCallable() + *

+ *

DeleteDataSource

Deletes a data source from your Merchant Center account.

+ *

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

+ *
    + *
  • deleteDataSource(DeleteDataSourceRequest request) + *

+ *

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

+ *
    + *
  • deleteDataSource(DataSourceName name) + *

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

+ *
    + *
  • deleteDataSourceCallable() + *

+ *

FetchDataSource

Performs the data fetch immediately (even outside fetch schedule) on a data source from your Merchant Center Account. If you need to call this method more than once per day, you should use the Products service to update your product data instead. This method only works on data sources with a file input set.

+ *

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

+ *
    + *
  • fetchDataSource(FetchDataSourceRequest request) + *

+ *

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

+ *
    + *
  • fetchDataSourceCallable() + *

+ *
+ * + *

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 DataSourcesServiceSettings 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
+ * DataSourcesServiceSettings dataSourcesServiceSettings =
+ *     DataSourcesServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * DataSourcesServiceClient dataSourcesServiceClient =
+ *     DataSourcesServiceClient.create(dataSourcesServiceSettings);
+ * }
+ * + *

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
+ * DataSourcesServiceSettings dataSourcesServiceSettings =
+ *     DataSourcesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DataSourcesServiceClient dataSourcesServiceClient =
+ *     DataSourcesServiceClient.create(dataSourcesServiceSettings);
+ * }
+ * + *

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
+ * DataSourcesServiceSettings dataSourcesServiceSettings =
+ *     DataSourcesServiceSettings.newHttpJsonBuilder().build();
+ * DataSourcesServiceClient dataSourcesServiceClient =
+ *     DataSourcesServiceClient.create(dataSourcesServiceSettings);
+ * }
+ * + *

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

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]");
+   *   DataSource response = dataSourcesServiceClient.getDataSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source to retrieve. Format: + * `accounts/{account}/dataSources/{datasource}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataSource getDataSource(DataSourceName name) { + GetDataSourceRequest request = + GetDataSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the data source configuration for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   String name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString();
+   *   DataSource response = dataSourcesServiceClient.getDataSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source to retrieve. Format: + * `accounts/{account}/dataSources/{datasource}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataSource getDataSource(String name) { + GetDataSourceRequest request = GetDataSourceRequest.newBuilder().setName(name).build(); + return getDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the data source configuration for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   GetDataSourceRequest request =
+   *       GetDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   DataSource response = dataSourcesServiceClient.getDataSource(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 DataSource getDataSource(GetDataSourceRequest request) { + return getDataSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the data source configuration for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   GetDataSourceRequest request =
+   *       GetDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.getDataSourceCallable().futureCall(request);
+   *   // Do something.
+   *   DataSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getDataSourceCallable() { + return stub.getDataSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the configurations for data sources for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (DataSource element : dataSourcesServiceClient.listDataSources(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account to list data sources for. Format: `accounts/{account}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataSourcesPagedResponse listDataSources(AccountName parent) { + ListDataSourcesRequest request = + ListDataSourcesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDataSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the configurations for data sources for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (DataSource element : dataSourcesServiceClient.listDataSources(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account to list data sources for. Format: `accounts/{account}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDataSourcesPagedResponse listDataSources(String parent) { + ListDataSourcesRequest request = ListDataSourcesRequest.newBuilder().setParent(parent).build(); + return listDataSources(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the configurations for data sources for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   ListDataSourcesRequest request =
+   *       ListDataSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (DataSource element : dataSourcesServiceClient.listDataSources(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 ListDataSourcesPagedResponse listDataSources(ListDataSourcesRequest request) { + return listDataSourcesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the configurations for data sources for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   ListDataSourcesRequest request =
+   *       ListDataSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.listDataSourcesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DataSource element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDataSourcesPagedCallable() { + return stub.listDataSourcesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the configurations for data sources for the given account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   ListDataSourcesRequest request =
+   *       ListDataSourcesRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListDataSourcesResponse response =
+   *         dataSourcesServiceClient.listDataSourcesCallable().call(request);
+   *     for (DataSource element : response.getDataSourcesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listDataSourcesCallable() { + return stub.listDataSourcesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the new data source configuration for the given account. This method always creates a + * new data 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   DataSource dataSource = DataSource.newBuilder().build();
+   *   DataSource response = dataSourcesServiceClient.createDataSource(parent, dataSource);
+   * }
+   * }
+ * + * @param parent Required. The account where this data source will be created. Format: + * `accounts/{account}` + * @param dataSource Required. The data source to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataSource createDataSource(AccountName parent, DataSource dataSource) { + CreateDataSourceRequest request = + CreateDataSourceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setDataSource(dataSource) + .build(); + return createDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the new data source configuration for the given account. This method always creates a + * new data 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   DataSource dataSource = DataSource.newBuilder().build();
+   *   DataSource response = dataSourcesServiceClient.createDataSource(parent, dataSource);
+   * }
+   * }
+ * + * @param parent Required. The account where this data source will be created. Format: + * `accounts/{account}` + * @param dataSource Required. The data source to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataSource createDataSource(String parent, DataSource dataSource) { + CreateDataSourceRequest request = + CreateDataSourceRequest.newBuilder().setParent(parent).setDataSource(dataSource).build(); + return createDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the new data source configuration for the given account. This method always creates a + * new data 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   CreateDataSourceRequest request =
+   *       CreateDataSourceRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setDataSource(DataSource.newBuilder().build())
+   *           .build();
+   *   DataSource response = dataSourcesServiceClient.createDataSource(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 DataSource createDataSource(CreateDataSourceRequest request) { + return createDataSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates the new data source configuration for the given account. This method always creates a + * new data 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   CreateDataSourceRequest request =
+   *       CreateDataSourceRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setDataSource(DataSource.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.createDataSourceCallable().futureCall(request);
+   *   // Do something.
+   *   DataSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createDataSourceCallable() { + return stub.createDataSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the existing data source configuration. The fields that are set in the update mask but + * not provided in the resource will be deleted. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   DataSource dataSource = DataSource.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   DataSource response = dataSourcesServiceClient.updateDataSource(dataSource, updateMask);
+   * }
+   * }
+ * + * @param dataSource Required. The data source resource to update. + * @param updateMask Required. The list of data source fields to be updated. + *

Fields specified in the update mask without a value specified in the body will be + * deleted from the data source. + *

Providing special "*" value for full data source replacement is not supported. + *

For example, If you insert `updateMask=displayName` in the request, it will only update + * the `displayName` leaving all other fields untouched. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DataSource updateDataSource(DataSource dataSource, FieldMask updateMask) { + UpdateDataSourceRequest request = + UpdateDataSourceRequest.newBuilder() + .setDataSource(dataSource) + .setUpdateMask(updateMask) + .build(); + return updateDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the existing data source configuration. The fields that are set in the update mask but + * not provided in the resource will be deleted. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   UpdateDataSourceRequest request =
+   *       UpdateDataSourceRequest.newBuilder()
+   *           .setDataSource(DataSource.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   DataSource response = dataSourcesServiceClient.updateDataSource(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 DataSource updateDataSource(UpdateDataSourceRequest request) { + return updateDataSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the existing data source configuration. The fields that are set in the update mask but + * not provided in the resource will be deleted. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   UpdateDataSourceRequest request =
+   *       UpdateDataSourceRequest.newBuilder()
+   *           .setDataSource(DataSource.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.updateDataSourceCallable().futureCall(request);
+   *   // Do something.
+   *   DataSource response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateDataSourceCallable() { + return stub.updateDataSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a data source from your Merchant Center account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]");
+   *   dataSourcesServiceClient.deleteDataSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source to delete. Format: + * `accounts/{account}/dataSources/{datasource}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataSource(DataSourceName name) { + DeleteDataSourceRequest request = + DeleteDataSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a data source from your Merchant Center account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   String name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString();
+   *   dataSourcesServiceClient.deleteDataSource(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source to delete. Format: + * `accounts/{account}/dataSources/{datasource}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteDataSource(String name) { + DeleteDataSourceRequest request = DeleteDataSourceRequest.newBuilder().setName(name).build(); + deleteDataSource(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a data source from your Merchant Center account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   DeleteDataSourceRequest request =
+   *       DeleteDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   dataSourcesServiceClient.deleteDataSource(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 deleteDataSource(DeleteDataSourceRequest request) { + deleteDataSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a data source from your Merchant Center account. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   DeleteDataSourceRequest request =
+   *       DeleteDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.deleteDataSourceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDataSourceCallable() { + return stub.deleteDataSourceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs the data fetch immediately (even outside fetch schedule) on a data source from your + * Merchant Center Account. If you need to call this method more than once per day, you should use + * the Products service to update your product data instead. This method only works on data + * sources with a file input set. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   FetchDataSourceRequest request =
+   *       FetchDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   dataSourcesServiceClient.fetchDataSource(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 fetchDataSource(FetchDataSourceRequest request) { + fetchDataSourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs the data fetch immediately (even outside fetch schedule) on a data source from your + * Merchant Center Account. If you need to call this method more than once per day, you should use + * the Products service to update your product data instead. This method only works on data + * sources with a file input set. + * + *

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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+   *   FetchDataSourceRequest request =
+   *       FetchDataSourceRequest.newBuilder()
+   *           .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataSourcesServiceClient.fetchDataSourceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable fetchDataSourceCallable() { + return stub.fetchDataSourceCallable(); + } + + @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 ListDataSourcesPagedResponse + extends AbstractPagedListResponse< + ListDataSourcesRequest, + ListDataSourcesResponse, + DataSource, + ListDataSourcesPage, + ListDataSourcesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListDataSourcesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListDataSourcesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListDataSourcesPagedResponse(ListDataSourcesPage page) { + super(page, ListDataSourcesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListDataSourcesPage + extends AbstractPage< + ListDataSourcesRequest, ListDataSourcesResponse, DataSource, ListDataSourcesPage> { + + private ListDataSourcesPage( + PageContext context, + ListDataSourcesResponse response) { + super(context, response); + } + + private static ListDataSourcesPage createEmptyPage() { + return new ListDataSourcesPage(null, null); + } + + @Override + protected ListDataSourcesPage createPage( + PageContext context, + ListDataSourcesResponse response) { + return new ListDataSourcesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListDataSourcesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListDataSourcesRequest, + ListDataSourcesResponse, + DataSource, + ListDataSourcesPage, + ListDataSourcesFixedSizeCollection> { + + private ListDataSourcesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListDataSourcesFixedSizeCollection createEmptyCollection() { + return new ListDataSourcesFixedSizeCollection(null, 0); + } + + @Override + protected ListDataSourcesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListDataSourcesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceSettings.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceSettings.java new file mode 100644 index 000000000000..b158d1ff9739 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceSettings.java @@ -0,0 +1,276 @@ +/* + * 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.datasources.v1; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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.datasources.v1.stub.DataSourcesServiceStubSettings; +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 DataSourcesServiceClient}. + * + *

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 getDataSource: + * + *

{@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
+ * DataSourcesServiceSettings.Builder dataSourcesServiceSettingsBuilder =
+ *     DataSourcesServiceSettings.newBuilder();
+ * dataSourcesServiceSettingsBuilder
+ *     .getDataSourceSettings()
+ *     .setRetrySettings(
+ *         dataSourcesServiceSettingsBuilder
+ *             .getDataSourceSettings()
+ *             .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());
+ * DataSourcesServiceSettings dataSourcesServiceSettings =
+ *     dataSourcesServiceSettingsBuilder.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 DataSourcesServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getDataSource. */ + public UnaryCallSettings getDataSourceSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).getDataSourceSettings(); + } + + /** Returns the object with the settings used for calls to listDataSources. */ + public PagedCallSettings< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).listDataSourcesSettings(); + } + + /** Returns the object with the settings used for calls to createDataSource. */ + public UnaryCallSettings createDataSourceSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).createDataSourceSettings(); + } + + /** Returns the object with the settings used for calls to updateDataSource. */ + public UnaryCallSettings updateDataSourceSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).updateDataSourceSettings(); + } + + /** Returns the object with the settings used for calls to deleteDataSource. */ + public UnaryCallSettings deleteDataSourceSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).deleteDataSourceSettings(); + } + + /** Returns the object with the settings used for calls to fetchDataSource. */ + public UnaryCallSettings fetchDataSourceSettings() { + return ((DataSourcesServiceStubSettings) getStubSettings()).fetchDataSourceSettings(); + } + + public static final DataSourcesServiceSettings create(DataSourcesServiceStubSettings stub) + throws IOException { + return new DataSourcesServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return DataSourcesServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return DataSourcesServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DataSourcesServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return DataSourcesServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return DataSourcesServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return DataSourcesServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return DataSourcesServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DataSourcesServiceStubSettings.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 DataSourcesServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for DataSourcesServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(DataSourcesServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(DataSourcesServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(DataSourcesServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(DataSourcesServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(DataSourcesServiceStubSettings.newHttpJsonBuilder()); + } + + public DataSourcesServiceStubSettings.Builder getStubSettingsBuilder() { + return ((DataSourcesServiceStubSettings.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 getDataSource. */ + public UnaryCallSettings.Builder getDataSourceSettings() { + return getStubSettingsBuilder().getDataSourceSettings(); + } + + /** Returns the builder for the settings used for calls to listDataSources. */ + public PagedCallSettings.Builder< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings() { + return getStubSettingsBuilder().listDataSourcesSettings(); + } + + /** Returns the builder for the settings used for calls to createDataSource. */ + public UnaryCallSettings.Builder + createDataSourceSettings() { + return getStubSettingsBuilder().createDataSourceSettings(); + } + + /** Returns the builder for the settings used for calls to updateDataSource. */ + public UnaryCallSettings.Builder + updateDataSourceSettings() { + return getStubSettingsBuilder().updateDataSourceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDataSource. */ + public UnaryCallSettings.Builder deleteDataSourceSettings() { + return getStubSettingsBuilder().deleteDataSourceSettings(); + } + + /** Returns the builder for the settings used for calls to fetchDataSource. */ + public UnaryCallSettings.Builder fetchDataSourceSettings() { + return getStubSettingsBuilder().fetchDataSourceSettings(); + } + + @Override + public DataSourcesServiceSettings build() throws IOException { + return new DataSourcesServiceSettings(this); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClient.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClient.java new file mode 100644 index 000000000000..ac53775056b3 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClient.java @@ -0,0 +1,324 @@ +/* + * 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.datasources.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.shopping.merchant.datasources.v1.stub.FileUploadsServiceStub; +import com.google.shopping.merchant.datasources.v1.stub.FileUploadsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage data source file uploads. + * + *

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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+ *   FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]");
+ *   FileUpload response = fileUploadsServiceClient.getFileUpload(name);
+ * }
+ * }
+ * + *

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

GetFileUpload

Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload.

+ *

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

+ *
    + *
  • getFileUpload(GetFileUploadRequest request) + *

+ *

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

+ *
    + *
  • getFileUpload(FileUploadName name) + *

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

+ *
    + *
  • getFileUploadCallable() + *

+ *
+ * + *

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 FileUploadsServiceSettings 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
+ * FileUploadsServiceSettings fileUploadsServiceSettings =
+ *     FileUploadsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FileUploadsServiceClient fileUploadsServiceClient =
+ *     FileUploadsServiceClient.create(fileUploadsServiceSettings);
+ * }
+ * + *

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
+ * FileUploadsServiceSettings fileUploadsServiceSettings =
+ *     FileUploadsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FileUploadsServiceClient fileUploadsServiceClient =
+ *     FileUploadsServiceClient.create(fileUploadsServiceSettings);
+ * }
+ * + *

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
+ * FileUploadsServiceSettings fileUploadsServiceSettings =
+ *     FileUploadsServiceSettings.newHttpJsonBuilder().build();
+ * FileUploadsServiceClient fileUploadsServiceClient =
+ *     FileUploadsServiceClient.create(fileUploadsServiceSettings);
+ * }
+ * + *

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

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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+   *   FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]");
+   *   FileUpload response = fileUploadsServiceClient.getFileUpload(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source file upload to retrieve. Format: + * `accounts/{account}/dataSources/{datasource}/fileUploads/latest` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FileUpload getFileUpload(FileUploadName name) { + GetFileUploadRequest request = + GetFileUploadRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFileUpload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload. + * + *

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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+   *   String name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString();
+   *   FileUpload response = fileUploadsServiceClient.getFileUpload(name);
+   * }
+   * }
+ * + * @param name Required. The name of the data source file upload to retrieve. Format: + * `accounts/{account}/dataSources/{datasource}/fileUploads/latest` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final FileUpload getFileUpload(String name) { + GetFileUploadRequest request = GetFileUploadRequest.newBuilder().setName(name).build(); + return getFileUpload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload. + * + *

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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+   *   GetFileUploadRequest request =
+   *       GetFileUploadRequest.newBuilder()
+   *           .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString())
+   *           .build();
+   *   FileUpload response = fileUploadsServiceClient.getFileUpload(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 FileUpload getFileUpload(GetFileUploadRequest request) { + return getFileUploadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the latest data source file upload. Only the `latest` alias is accepted for a file upload. + * + *

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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+   *   GetFileUploadRequest request =
+   *       GetFileUploadRequest.newBuilder()
+   *           .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       fileUploadsServiceClient.getFileUploadCallable().futureCall(request);
+   *   // Do something.
+   *   FileUpload response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getFileUploadCallable() { + return stub.getFileUploadCallable(); + } + + @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); + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceSettings.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceSettings.java new file mode 100644 index 000000000000..f58aff1ebc8f --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceSettings.java @@ -0,0 +1,216 @@ +/* + * 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.datasources.v1; + +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.shopping.merchant.datasources.v1.stub.FileUploadsServiceStubSettings; +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 FileUploadsServiceClient}. + * + *

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 getFileUpload: + * + *

{@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
+ * FileUploadsServiceSettings.Builder fileUploadsServiceSettingsBuilder =
+ *     FileUploadsServiceSettings.newBuilder();
+ * fileUploadsServiceSettingsBuilder
+ *     .getFileUploadSettings()
+ *     .setRetrySettings(
+ *         fileUploadsServiceSettingsBuilder
+ *             .getFileUploadSettings()
+ *             .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());
+ * FileUploadsServiceSettings fileUploadsServiceSettings =
+ *     fileUploadsServiceSettingsBuilder.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 FileUploadsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getFileUpload. */ + public UnaryCallSettings getFileUploadSettings() { + return ((FileUploadsServiceStubSettings) getStubSettings()).getFileUploadSettings(); + } + + public static final FileUploadsServiceSettings create(FileUploadsServiceStubSettings stub) + throws IOException { + return new FileUploadsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FileUploadsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FileUploadsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FileUploadsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FileUploadsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FileUploadsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return FileUploadsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FileUploadsServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FileUploadsServiceStubSettings.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 FileUploadsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FileUploadsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(FileUploadsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(FileUploadsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FileUploadsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(FileUploadsServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(FileUploadsServiceStubSettings.newHttpJsonBuilder()); + } + + public FileUploadsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((FileUploadsServiceStubSettings.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 getFileUpload. */ + public UnaryCallSettings.Builder getFileUploadSettings() { + return getStubSettingsBuilder().getFileUploadSettings(); + } + + @Override + public FileUploadsServiceSettings build() throws IOException { + return new FileUploadsServiceSettings(this); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/gapic_metadata.json b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/gapic_metadata.json new file mode 100644 index 000000000000..4c410fa2082a --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.datasources.v1", + "libraryPackage": "com.google.shopping.merchant.datasources.v1", + "services": { + "DataSourcesService": { + "clients": { + "grpc": { + "libraryClient": "DataSourcesServiceClient", + "rpcs": { + "CreateDataSource": { + "methods": ["createDataSource", "createDataSource", "createDataSource", "createDataSourceCallable"] + }, + "DeleteDataSource": { + "methods": ["deleteDataSource", "deleteDataSource", "deleteDataSource", "deleteDataSourceCallable"] + }, + "FetchDataSource": { + "methods": ["fetchDataSource", "fetchDataSourceCallable"] + }, + "GetDataSource": { + "methods": ["getDataSource", "getDataSource", "getDataSource", "getDataSourceCallable"] + }, + "ListDataSources": { + "methods": ["listDataSources", "listDataSources", "listDataSources", "listDataSourcesPagedCallable", "listDataSourcesCallable"] + }, + "UpdateDataSource": { + "methods": ["updateDataSource", "updateDataSource", "updateDataSourceCallable"] + } + } + } + } + }, + "FileUploadsService": { + "clients": { + "grpc": { + "libraryClient": "FileUploadsServiceClient", + "rpcs": { + "GetFileUpload": { + "methods": ["getFileUpload", "getFileUpload", "getFileUpload", "getFileUploadCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/package-info.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/package-info.java new file mode 100644 index 000000000000..efd415e39e8e --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/package-info.java @@ -0,0 +1,63 @@ +/* + * 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. + * + *

======================= DataSourcesServiceClient ======================= + * + *

Service Description: Service to manage primary, supplemental, inventory and other data + * sources. See more in the [Merchant Center](https://support.google.com/merchants/answer/7439058) + * help article. + * + *

Sample for DataSourcesServiceClient: + * + *

{@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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) {
+ *   DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]");
+ *   DataSource response = dataSourcesServiceClient.getDataSource(name);
+ * }
+ * }
+ * + *

======================= FileUploadsServiceClient ======================= + * + *

Service Description: Service to manage data source file uploads. + * + *

Sample for FileUploadsServiceClient: + * + *

{@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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) {
+ *   FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]");
+ *   FileUpload response = fileUploadsServiceClient.getFileUpload(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.merchant.datasources.v1; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStub.java new file mode 100644 index 000000000000..f9c87be100ed --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStub.java @@ -0,0 +1,74 @@ +/* + * 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.datasources.v1.stub; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the DataSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class DataSourcesServiceStub implements BackgroundResource { + + public UnaryCallable getDataSourceCallable() { + throw new UnsupportedOperationException("Not implemented: getDataSourceCallable()"); + } + + public UnaryCallable + listDataSourcesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listDataSourcesPagedCallable()"); + } + + public UnaryCallable listDataSourcesCallable() { + throw new UnsupportedOperationException("Not implemented: listDataSourcesCallable()"); + } + + public UnaryCallable createDataSourceCallable() { + throw new UnsupportedOperationException("Not implemented: createDataSourceCallable()"); + } + + public UnaryCallable updateDataSourceCallable() { + throw new UnsupportedOperationException("Not implemented: updateDataSourceCallable()"); + } + + public UnaryCallable deleteDataSourceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDataSourceCallable()"); + } + + public UnaryCallable fetchDataSourceCallable() { + throw new UnsupportedOperationException("Not implemented: fetchDataSourceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStubSettings.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStubSettings.java new file mode 100644 index 000000000000..d23802a83e80 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/DataSourcesServiceStubSettings.java @@ -0,0 +1,539 @@ +/* + * 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.datasources.v1.stub; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; +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 DataSourcesServiceStub}. + * + *

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 getDataSource: + * + *

{@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
+ * DataSourcesServiceStubSettings.Builder dataSourcesServiceSettingsBuilder =
+ *     DataSourcesServiceStubSettings.newBuilder();
+ * dataSourcesServiceSettingsBuilder
+ *     .getDataSourceSettings()
+ *     .setRetrySettings(
+ *         dataSourcesServiceSettingsBuilder
+ *             .getDataSourceSettings()
+ *             .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());
+ * DataSourcesServiceStubSettings dataSourcesServiceSettings =
+ *     dataSourcesServiceSettingsBuilder.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 DataSourcesServiceStubSettings 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 getDataSourceSettings; + private final PagedCallSettings< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings; + private final UnaryCallSettings createDataSourceSettings; + private final UnaryCallSettings updateDataSourceSettings; + private final UnaryCallSettings deleteDataSourceSettings; + private final UnaryCallSettings fetchDataSourceSettings; + + private static final PagedListDescriptor< + ListDataSourcesRequest, ListDataSourcesResponse, DataSource> + LIST_DATA_SOURCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListDataSourcesRequest injectToken( + ListDataSourcesRequest payload, String token) { + return ListDataSourcesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListDataSourcesRequest injectPageSize( + ListDataSourcesRequest payload, int pageSize) { + return ListDataSourcesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListDataSourcesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListDataSourcesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListDataSourcesResponse payload) { + return payload.getDataSourcesList(); + } + }; + + private static final PagedListResponseFactory< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + LIST_DATA_SOURCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListDataSourcesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_DATA_SOURCES_PAGE_STR_DESC, request, context); + return ListDataSourcesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getDataSource. */ + public UnaryCallSettings getDataSourceSettings() { + return getDataSourceSettings; + } + + /** Returns the object with the settings used for calls to listDataSources. */ + public PagedCallSettings< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings() { + return listDataSourcesSettings; + } + + /** Returns the object with the settings used for calls to createDataSource. */ + public UnaryCallSettings createDataSourceSettings() { + return createDataSourceSettings; + } + + /** Returns the object with the settings used for calls to updateDataSource. */ + public UnaryCallSettings updateDataSourceSettings() { + return updateDataSourceSettings; + } + + /** Returns the object with the settings used for calls to deleteDataSource. */ + public UnaryCallSettings deleteDataSourceSettings() { + return deleteDataSourceSettings; + } + + /** Returns the object with the settings used for calls to fetchDataSource. */ + public UnaryCallSettings fetchDataSourceSettings() { + return fetchDataSourceSettings; + } + + public DataSourcesServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcDataSourcesServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonDataSourcesServiceStub.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(DataSourcesServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(DataSourcesServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return DataSourcesServiceStubSettings.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 DataSourcesServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getDataSourceSettings = settingsBuilder.getDataSourceSettings().build(); + listDataSourcesSettings = settingsBuilder.listDataSourcesSettings().build(); + createDataSourceSettings = settingsBuilder.createDataSourceSettings().build(); + updateDataSourceSettings = settingsBuilder.updateDataSourceSettings().build(); + deleteDataSourceSettings = settingsBuilder.deleteDataSourceSettings().build(); + fetchDataSourceSettings = settingsBuilder.fetchDataSourceSettings().build(); + } + + /** Builder for DataSourcesServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getDataSourceSettings; + private final PagedCallSettings.Builder< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings; + private final UnaryCallSettings.Builder + createDataSourceSettings; + private final UnaryCallSettings.Builder + updateDataSourceSettings; + private final UnaryCallSettings.Builder + deleteDataSourceSettings; + private final UnaryCallSettings.Builder fetchDataSourceSettings; + 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); + + getDataSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listDataSourcesSettings = PagedCallSettings.newBuilder(LIST_DATA_SOURCES_PAGE_STR_FACT); + createDataSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateDataSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDataSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + fetchDataSourceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDataSourceSettings, + listDataSourcesSettings, + createDataSourceSettings, + updateDataSourceSettings, + deleteDataSourceSettings, + fetchDataSourceSettings); + initDefaults(this); + } + + protected Builder(DataSourcesServiceStubSettings settings) { + super(settings); + + getDataSourceSettings = settings.getDataSourceSettings.toBuilder(); + listDataSourcesSettings = settings.listDataSourcesSettings.toBuilder(); + createDataSourceSettings = settings.createDataSourceSettings.toBuilder(); + updateDataSourceSettings = settings.updateDataSourceSettings.toBuilder(); + deleteDataSourceSettings = settings.deleteDataSourceSettings.toBuilder(); + fetchDataSourceSettings = settings.fetchDataSourceSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getDataSourceSettings, + listDataSourcesSettings, + createDataSourceSettings, + updateDataSourceSettings, + deleteDataSourceSettings, + fetchDataSourceSettings); + } + + 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 + .getDataSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listDataSourcesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createDataSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateDataSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteDataSourceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .fetchDataSourceSettings() + .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 getDataSource. */ + public UnaryCallSettings.Builder getDataSourceSettings() { + return getDataSourceSettings; + } + + /** Returns the builder for the settings used for calls to listDataSources. */ + public PagedCallSettings.Builder< + ListDataSourcesRequest, ListDataSourcesResponse, ListDataSourcesPagedResponse> + listDataSourcesSettings() { + return listDataSourcesSettings; + } + + /** Returns the builder for the settings used for calls to createDataSource. */ + public UnaryCallSettings.Builder + createDataSourceSettings() { + return createDataSourceSettings; + } + + /** Returns the builder for the settings used for calls to updateDataSource. */ + public UnaryCallSettings.Builder + updateDataSourceSettings() { + return updateDataSourceSettings; + } + + /** Returns the builder for the settings used for calls to deleteDataSource. */ + public UnaryCallSettings.Builder deleteDataSourceSettings() { + return deleteDataSourceSettings; + } + + /** Returns the builder for the settings used for calls to fetchDataSource. */ + public UnaryCallSettings.Builder fetchDataSourceSettings() { + return fetchDataSourceSettings; + } + + @Override + public DataSourcesServiceStubSettings build() throws IOException { + return new DataSourcesServiceStubSettings(this); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStub.java new file mode 100644 index 000000000000..c4c6f7b1779a --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStub.java @@ -0,0 +1,40 @@ +/* + * 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.datasources.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the FileUploadsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class FileUploadsServiceStub implements BackgroundResource { + + public UnaryCallable getFileUploadCallable() { + throw new UnsupportedOperationException("Not implemented: getFileUploadCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStubSettings.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStubSettings.java new file mode 100644 index 000000000000..9a06da80f7ed --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/FileUploadsServiceStubSettings.java @@ -0,0 +1,344 @@ +/* + * 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.datasources.v1.stub; + +import com.google.api.core.ApiFunction; +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.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +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.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; +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 FileUploadsServiceStub}. + * + *

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 getFileUpload: + * + *

{@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
+ * FileUploadsServiceStubSettings.Builder fileUploadsServiceSettingsBuilder =
+ *     FileUploadsServiceStubSettings.newBuilder();
+ * fileUploadsServiceSettingsBuilder
+ *     .getFileUploadSettings()
+ *     .setRetrySettings(
+ *         fileUploadsServiceSettingsBuilder
+ *             .getFileUploadSettings()
+ *             .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());
+ * FileUploadsServiceStubSettings fileUploadsServiceSettings =
+ *     fileUploadsServiceSettingsBuilder.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 FileUploadsServiceStubSettings 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 getFileUploadSettings; + + /** Returns the object with the settings used for calls to getFileUpload. */ + public UnaryCallSettings getFileUploadSettings() { + return getFileUploadSettings; + } + + public FileUploadsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFileUploadsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonFileUploadsServiceStub.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(FileUploadsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FileUploadsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FileUploadsServiceStubSettings.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 FileUploadsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getFileUploadSettings = settingsBuilder.getFileUploadSettings().build(); + } + + /** Builder for FileUploadsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getFileUploadSettings; + 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); + + getFileUploadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(getFileUploadSettings); + initDefaults(this); + } + + protected Builder(FileUploadsServiceStubSettings settings) { + super(settings); + + getFileUploadSettings = settings.getFileUploadSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(getFileUploadSettings); + } + + 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 + .getFileUploadSettings() + .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 getFileUpload. */ + public UnaryCallSettings.Builder getFileUploadSettings() { + return getFileUploadSettings; + } + + @Override + public FileUploadsServiceStubSettings build() throws IOException { + return new FileUploadsServiceStubSettings(this); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceCallableFactory.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..6fd4316eb722 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceCallableFactory.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.datasources.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 DataSourcesService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcDataSourcesServiceCallableFactory 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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceStub.java new file mode 100644 index 000000000000..9b3ca67ed032 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcDataSourcesServiceStub.java @@ -0,0 +1,337 @@ +/* + * 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.datasources.v1.stub; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; +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 DataSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcDataSourcesServiceStub extends DataSourcesServiceStub { + private static final MethodDescriptor + getDataSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/GetDataSource") + .setRequestMarshaller( + ProtoUtils.marshaller(GetDataSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listDataSourcesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/ListDataSources") + .setRequestMarshaller( + ProtoUtils.marshaller(ListDataSourcesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListDataSourcesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createDataSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/CreateDataSource") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateDataSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateDataSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/UpdateDataSource") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateDataSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(DataSource.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteDataSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/DeleteDataSource") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDataSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + fetchDataSourceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/FetchDataSource") + .setRequestMarshaller( + ProtoUtils.marshaller(FetchDataSourceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable getDataSourceCallable; + private final UnaryCallable + listDataSourcesCallable; + private final UnaryCallable + listDataSourcesPagedCallable; + private final UnaryCallable createDataSourceCallable; + private final UnaryCallable updateDataSourceCallable; + private final UnaryCallable deleteDataSourceCallable; + private final UnaryCallable fetchDataSourceCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcDataSourcesServiceStub create(DataSourcesServiceStubSettings settings) + throws IOException { + return new GrpcDataSourcesServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcDataSourcesServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcDataSourcesServiceStub( + DataSourcesServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcDataSourcesServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcDataSourcesServiceStub( + DataSourcesServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcDataSourcesServiceStub, 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 GrpcDataSourcesServiceStub( + DataSourcesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcDataSourcesServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcDataSourcesServiceStub, 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 GrpcDataSourcesServiceStub( + DataSourcesServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getDataSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getDataSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listDataSourcesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listDataSourcesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings createDataSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createDataSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateDataSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateDataSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "data_source.name", String.valueOf(request.getDataSource().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteDataSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDataSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings fetchDataSourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(fetchDataSourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getDataSourceCallable = + callableFactory.createUnaryCallable( + getDataSourceTransportSettings, settings.getDataSourceSettings(), clientContext); + this.listDataSourcesCallable = + callableFactory.createUnaryCallable( + listDataSourcesTransportSettings, settings.listDataSourcesSettings(), clientContext); + this.listDataSourcesPagedCallable = + callableFactory.createPagedCallable( + listDataSourcesTransportSettings, settings.listDataSourcesSettings(), clientContext); + this.createDataSourceCallable = + callableFactory.createUnaryCallable( + createDataSourceTransportSettings, settings.createDataSourceSettings(), clientContext); + this.updateDataSourceCallable = + callableFactory.createUnaryCallable( + updateDataSourceTransportSettings, settings.updateDataSourceSettings(), clientContext); + this.deleteDataSourceCallable = + callableFactory.createUnaryCallable( + deleteDataSourceTransportSettings, settings.deleteDataSourceSettings(), clientContext); + this.fetchDataSourceCallable = + callableFactory.createUnaryCallable( + fetchDataSourceTransportSettings, settings.fetchDataSourceSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getDataSourceCallable() { + return getDataSourceCallable; + } + + @Override + public UnaryCallable listDataSourcesCallable() { + return listDataSourcesCallable; + } + + @Override + public UnaryCallable + listDataSourcesPagedCallable() { + return listDataSourcesPagedCallable; + } + + @Override + public UnaryCallable createDataSourceCallable() { + return createDataSourceCallable; + } + + @Override + public UnaryCallable updateDataSourceCallable() { + return updateDataSourceCallable; + } + + @Override + public UnaryCallable deleteDataSourceCallable() { + return deleteDataSourceCallable; + } + + @Override + public UnaryCallable fetchDataSourceCallable() { + return fetchDataSourceCallable; + } + + @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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceCallableFactory.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceCallableFactory.java new file mode 100644 index 000000000000..722c45a3bf6a --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceCallableFactory.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.datasources.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 FileUploadsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcFileUploadsServiceCallableFactory 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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceStub.java new file mode 100644 index 000000000000..337c774453dc --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/GrpcFileUploadsServiceStub.java @@ -0,0 +1,163 @@ +/* + * 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.datasources.v1.stub; + +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.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; +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 FileUploadsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcFileUploadsServiceStub extends FileUploadsServiceStub { + private static final MethodDescriptor + getFileUploadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.datasources.v1.FileUploadsService/GetFileUpload") + .setRequestMarshaller( + ProtoUtils.marshaller(GetFileUploadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(FileUpload.getDefaultInstance())) + .build(); + + private final UnaryCallable getFileUploadCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFileUploadsServiceStub create(FileUploadsServiceStubSettings settings) + throws IOException { + return new GrpcFileUploadsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFileUploadsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcFileUploadsServiceStub( + FileUploadsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFileUploadsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFileUploadsServiceStub( + FileUploadsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFileUploadsServiceStub, 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 GrpcFileUploadsServiceStub( + FileUploadsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcFileUploadsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcFileUploadsServiceStub, 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 GrpcFileUploadsServiceStub( + FileUploadsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFileUploadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFileUploadMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getFileUploadCallable = + callableFactory.createUnaryCallable( + getFileUploadTransportSettings, settings.getFileUploadSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFileUploadCallable() { + return getFileUploadCallable; + } + + @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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceCallableFactory.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceCallableFactory.java new file mode 100644 index 000000000000..13f2107fd91d --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceCallableFactory.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.datasources.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 DataSourcesService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonDataSourcesServiceCallableFactory + 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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceStub.java new file mode 100644 index 000000000000..f57b8d98fccc --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonDataSourcesServiceStub.java @@ -0,0 +1,516 @@ +/* + * 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.datasources.v1.stub; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; +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 DataSourcesService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonDataSourcesServiceStub extends DataSourcesServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getDataSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/GetDataSource") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{name=accounts/*/dataSources/*}", + 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(DataSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listDataSourcesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/ListDataSources") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{parent=accounts/*}/dataSources", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListDataSourcesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createDataSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/CreateDataSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{parent=accounts/*}/dataSources", + 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("dataSource", request.getDataSource(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DataSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateDataSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/UpdateDataSource") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{dataSource.name=accounts/*/dataSources/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "dataSource.name", request.getDataSource().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("dataSource", request.getDataSource(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(DataSource.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteDataSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/DeleteDataSource") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{name=accounts/*/dataSources/*}", + 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 + fetchDataSourceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.DataSourcesService/FetchDataSource") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{name=accounts/*/dataSources/*}:fetch", + 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(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getDataSourceCallable; + private final UnaryCallable + listDataSourcesCallable; + private final UnaryCallable + listDataSourcesPagedCallable; + private final UnaryCallable createDataSourceCallable; + private final UnaryCallable updateDataSourceCallable; + private final UnaryCallable deleteDataSourceCallable; + private final UnaryCallable fetchDataSourceCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonDataSourcesServiceStub create(DataSourcesServiceStubSettings settings) + throws IOException { + return new HttpJsonDataSourcesServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonDataSourcesServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonDataSourcesServiceStub( + DataSourcesServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonDataSourcesServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonDataSourcesServiceStub( + DataSourcesServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonDataSourcesServiceStub, 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 HttpJsonDataSourcesServiceStub( + DataSourcesServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonDataSourcesServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonDataSourcesServiceStub, 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 HttpJsonDataSourcesServiceStub( + DataSourcesServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getDataSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getDataSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listDataSourcesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listDataSourcesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createDataSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createDataSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateDataSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateDataSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "data_source.name", String.valueOf(request.getDataSource().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteDataSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDataSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings fetchDataSourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(fetchDataSourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getDataSourceCallable = + callableFactory.createUnaryCallable( + getDataSourceTransportSettings, settings.getDataSourceSettings(), clientContext); + this.listDataSourcesCallable = + callableFactory.createUnaryCallable( + listDataSourcesTransportSettings, settings.listDataSourcesSettings(), clientContext); + this.listDataSourcesPagedCallable = + callableFactory.createPagedCallable( + listDataSourcesTransportSettings, settings.listDataSourcesSettings(), clientContext); + this.createDataSourceCallable = + callableFactory.createUnaryCallable( + createDataSourceTransportSettings, settings.createDataSourceSettings(), clientContext); + this.updateDataSourceCallable = + callableFactory.createUnaryCallable( + updateDataSourceTransportSettings, settings.updateDataSourceSettings(), clientContext); + this.deleteDataSourceCallable = + callableFactory.createUnaryCallable( + deleteDataSourceTransportSettings, settings.deleteDataSourceSettings(), clientContext); + this.fetchDataSourceCallable = + callableFactory.createUnaryCallable( + fetchDataSourceTransportSettings, settings.fetchDataSourceSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getDataSourceMethodDescriptor); + methodDescriptors.add(listDataSourcesMethodDescriptor); + methodDescriptors.add(createDataSourceMethodDescriptor); + methodDescriptors.add(updateDataSourceMethodDescriptor); + methodDescriptors.add(deleteDataSourceMethodDescriptor); + methodDescriptors.add(fetchDataSourceMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getDataSourceCallable() { + return getDataSourceCallable; + } + + @Override + public UnaryCallable listDataSourcesCallable() { + return listDataSourcesCallable; + } + + @Override + public UnaryCallable + listDataSourcesPagedCallable() { + return listDataSourcesPagedCallable; + } + + @Override + public UnaryCallable createDataSourceCallable() { + return createDataSourceCallable; + } + + @Override + public UnaryCallable updateDataSourceCallable() { + return updateDataSourceCallable; + } + + @Override + public UnaryCallable deleteDataSourceCallable() { + return deleteDataSourceCallable; + } + + @Override + public UnaryCallable fetchDataSourceCallable() { + return fetchDataSourceCallable; + } + + @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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceCallableFactory.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceCallableFactory.java new file mode 100644 index 000000000000..b00243b6fdbe --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceCallableFactory.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.datasources.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 FileUploadsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonFileUploadsServiceCallableFactory + 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-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceStub.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceStub.java new file mode 100644 index 000000000000..2f860044716b --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/java/com/google/shopping/merchant/datasources/v1/stub/HttpJsonFileUploadsServiceStub.java @@ -0,0 +1,200 @@ +/* + * 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.datasources.v1.stub; + +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.TypeRegistry; +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; +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 FileUploadsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonFileUploadsServiceStub extends FileUploadsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getFileUploadMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.datasources.v1.FileUploadsService/GetFileUpload") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/datasources/v1/{name=accounts/*/dataSources/*/fileUploads/*}", + 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(FileUpload.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getFileUploadCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonFileUploadsServiceStub create(FileUploadsServiceStubSettings settings) + throws IOException { + return new HttpJsonFileUploadsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonFileUploadsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonFileUploadsServiceStub( + FileUploadsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonFileUploadsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFileUploadsServiceStub( + FileUploadsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonFileUploadsServiceStub, 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 HttpJsonFileUploadsServiceStub( + FileUploadsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonFileUploadsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonFileUploadsServiceStub, 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 HttpJsonFileUploadsServiceStub( + FileUploadsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getFileUploadTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFileUploadMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getFileUploadCallable = + callableFactory.createUnaryCallable( + getFileUploadTransportSettings, settings.getFileUploadSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getFileUploadMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getFileUploadCallable() { + return getFileUploadCallable; + } + + @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-datasources/google-shopping-merchant-datasources/src/main/resources/META-INF/native-image/com.google.shopping.merchant.datasources.v1/reflect-config.json b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/resources/META-INF/native-image/com.google.shopping.merchant.datasources.v1/reflect-config.json new file mode 100644 index 000000000000..f677a2f57da7 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/main/resources/META-INF/native-image/com.google.shopping.merchant.datasources.v1/reflect-config.json @@ -0,0 +1,1856 @@ +[ + { + "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.datasources.v1.CreateDataSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DataSource$Input", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DataSourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DataSourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput$FetchSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput$FetchSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput$FetchSettings$Frequency", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileInput$FileInputType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload$Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload$Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload$Issue$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.FileUpload$ProcessingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.GetDataSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.GetDataSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.GetFileUploadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.GetFileUploadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$DefaultRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$DefaultRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$Destination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$Destination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource$Destination$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ProductReviewDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.ProductReviewDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PromotionDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.PromotionDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Channel$ChannelEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination$DestinationEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.ReportingContext$ReportingContextEnum", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Weight", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Weight$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Weight$WeightUnit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.DayOfWeek", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.TimeOfDay", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.TimeOfDay$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-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientHttpJsonTest.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..1da64773f7de --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientHttpJsonTest.java @@ -0,0 +1,558 @@ +/* + * 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.datasources.v1; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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.shopping.merchant.datasources.v1.stub.HttpJsonDataSourcesServiceStub; +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 DataSourcesServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static DataSourcesServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonDataSourcesServiceStub.getMethodDescriptors(), + DataSourcesServiceSettings.getDefaultEndpoint()); + DataSourcesServiceSettings settings = + DataSourcesServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + DataSourcesServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DataSourcesServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + + DataSource actualResponse = client.getDataSource(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 getDataSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + client.getDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataSourceTest2() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-3574/dataSources/dataSource-3574"; + + DataSource actualResponse = client.getDataSource(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 getDataSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-3574/dataSources/dataSource-3574"; + client.getDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataSourcesTest() throws Exception { + DataSource responsesElement = DataSource.newBuilder().build(); + ListDataSourcesResponse expectedResponse = + ListDataSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDataSources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListDataSourcesPagedResponse pagedListResponse = client.listDataSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataSourcesList().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 listDataSourcesExceptionTest() 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.listDataSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataSourcesTest2() throws Exception { + DataSource responsesElement = DataSource.newBuilder().build(); + ListDataSourcesResponse expectedResponse = + ListDataSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDataSources(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListDataSourcesPagedResponse pagedListResponse = client.listDataSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataSourcesList().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 listDataSourcesExceptionTest2() 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.listDataSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + DataSource dataSource = DataSource.newBuilder().build(); + + DataSource actualResponse = client.createDataSource(parent, dataSource); + 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 createDataSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + DataSource dataSource = DataSource.newBuilder().build(); + client.createDataSource(parent, dataSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataSourceTest2() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + DataSource dataSource = DataSource.newBuilder().build(); + + DataSource actualResponse = client.createDataSource(parent, dataSource); + 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 createDataSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + DataSource dataSource = DataSource.newBuilder().build(); + client.createDataSource(parent, dataSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + DataSource dataSource = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + DataSource actualResponse = client.updateDataSource(dataSource, 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 updateDataSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataSource dataSource = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDataSource(dataSource, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + + client.deleteDataSource(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 deleteDataSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + client.deleteDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataSourceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-3574/dataSources/dataSource-3574"; + + client.deleteDataSource(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 deleteDataSourceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-3574/dataSources/dataSource-3574"; + client.deleteDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchDataSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + + client.fetchDataSource(request); + + 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 fetchDataSourceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + client.fetchDataSource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientTest.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientTest.java new file mode 100644 index 000000000000..d5c37fd2aa9e --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceClientTest.java @@ -0,0 +1,492 @@ +/* + * 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.datasources.v1; + +import static com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient.ListDataSourcesPagedResponse; + +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 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 DataSourcesServiceClientTest { + private static MockDataSourcesService mockDataSourcesService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private DataSourcesServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockDataSourcesService = new MockDataSourcesService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockDataSourcesService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + DataSourcesServiceSettings settings = + DataSourcesServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = DataSourcesServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + + DataSource actualResponse = client.getDataSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDataSourceRequest actualRequest = ((GetDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDataSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + client.getDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getDataSourceTest2() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + String name = "name3373707"; + + DataSource actualResponse = client.getDataSource(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetDataSourceRequest actualRequest = ((GetDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getDataSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + String name = "name3373707"; + client.getDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataSourcesTest() throws Exception { + DataSource responsesElement = DataSource.newBuilder().build(); + ListDataSourcesResponse expectedResponse = + ListDataSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDataSources(Arrays.asList(responsesElement)) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListDataSourcesPagedResponse pagedListResponse = client.listDataSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataSourcesList().get(0), resources.get(0)); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDataSourcesRequest actualRequest = ((ListDataSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDataSourcesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listDataSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listDataSourcesTest2() throws Exception { + DataSource responsesElement = DataSource.newBuilder().build(); + ListDataSourcesResponse expectedResponse = + ListDataSourcesResponse.newBuilder() + .setNextPageToken("") + .addAllDataSources(Arrays.asList(responsesElement)) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListDataSourcesPagedResponse pagedListResponse = client.listDataSources(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getDataSourcesList().get(0), resources.get(0)); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListDataSourcesRequest actualRequest = ((ListDataSourcesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listDataSourcesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listDataSources(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + DataSource dataSource = DataSource.newBuilder().build(); + + DataSource actualResponse = client.createDataSource(parent, dataSource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDataSourceRequest actualRequest = ((CreateDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(dataSource, actualRequest.getDataSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDataSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + DataSource dataSource = DataSource.newBuilder().build(); + client.createDataSource(parent, dataSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createDataSourceTest2() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + DataSource dataSource = DataSource.newBuilder().build(); + + DataSource actualResponse = client.createDataSource(parent, dataSource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateDataSourceRequest actualRequest = ((CreateDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(dataSource, actualRequest.getDataSource()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createDataSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + String parent = "parent-995424086"; + DataSource dataSource = DataSource.newBuilder().build(); + client.createDataSource(parent, dataSource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateDataSourceTest() throws Exception { + DataSource expectedResponse = + DataSource.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .setDataSourceId(-1015796374) + .setDisplayName("displayName1714148973") + .setFileInput(FileInput.newBuilder().build()) + .build(); + mockDataSourcesService.addResponse(expectedResponse); + + DataSource dataSource = DataSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + DataSource actualResponse = client.updateDataSource(dataSource, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateDataSourceRequest actualRequest = ((UpdateDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(dataSource, actualRequest.getDataSource()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateDataSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + DataSource dataSource = DataSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateDataSource(dataSource, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDataSourcesService.addResponse(expectedResponse); + + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + + client.deleteDataSource(name); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDataSourceRequest actualRequest = ((DeleteDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDataSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + client.deleteDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteDataSourceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDataSourcesService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteDataSource(name); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDataSourceRequest actualRequest = ((DeleteDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDataSourceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + String name = "name3373707"; + client.deleteDataSource(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void fetchDataSourceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockDataSourcesService.addResponse(expectedResponse); + + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + + client.fetchDataSource(request); + + List actualRequests = mockDataSourcesService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FetchDataSourceRequest actualRequest = ((FetchDataSourceRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void fetchDataSourceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockDataSourcesService.addException(exception); + + try { + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + client.fetchDataSource(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientHttpJsonTest.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..bd25e3cf43a8 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientHttpJsonTest.java @@ -0,0 +1,175 @@ +/* + * 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.datasources.v1; + +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.protobuf.Timestamp; +import com.google.shopping.merchant.datasources.v1.stub.HttpJsonFileUploadsServiceStub; +import java.io.IOException; +import java.util.ArrayList; +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 FileUploadsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static FileUploadsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonFileUploadsServiceStub.getMethodDescriptors(), + FileUploadsServiceSettings.getDefaultEndpoint()); + FileUploadsServiceSettings settings = + FileUploadsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + FileUploadsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FileUploadsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getFileUploadTest() throws Exception { + FileUpload expectedResponse = + FileUpload.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .setDataSourceId(-1015796374) + .addAllIssues(new ArrayList()) + .setItemsTotal(-384543227) + .setItemsCreated(1985498473) + .setItemsUpdated(722513724) + .setUploadTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]"); + + FileUpload actualResponse = client.getFileUpload(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 getFileUploadExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]"); + client.getFileUpload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFileUploadTest2() throws Exception { + FileUpload expectedResponse = + FileUpload.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .setDataSourceId(-1015796374) + .addAllIssues(new ArrayList()) + .setItemsTotal(-384543227) + .setItemsCreated(1985498473) + .setItemsUpdated(722513724) + .setUploadTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-7624/dataSources/dataSource-7624/fileUploads/fileUpload-7624"; + + FileUpload actualResponse = client.getFileUpload(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 getFileUploadExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-7624/dataSources/dataSource-7624/fileUploads/fileUpload-7624"; + client.getFileUpload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientTest.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientTest.java new file mode 100644 index 000000000000..e93ff06dc8a4 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceClientTest.java @@ -0,0 +1,167 @@ +/* + * 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.datasources.v1; + +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.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +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 FileUploadsServiceClientTest { + private static MockFileUploadsService mockFileUploadsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private FileUploadsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockFileUploadsService = new MockFileUploadsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockFileUploadsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + FileUploadsServiceSettings settings = + FileUploadsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FileUploadsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getFileUploadTest() throws Exception { + FileUpload expectedResponse = + FileUpload.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .setDataSourceId(-1015796374) + .addAllIssues(new ArrayList()) + .setItemsTotal(-384543227) + .setItemsCreated(1985498473) + .setItemsUpdated(722513724) + .setUploadTime(Timestamp.newBuilder().build()) + .build(); + mockFileUploadsService.addResponse(expectedResponse); + + FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]"); + + FileUpload actualResponse = client.getFileUpload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFileUploadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFileUploadRequest actualRequest = ((GetFileUploadRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFileUploadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFileUploadsService.addException(exception); + + try { + FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]"); + client.getFileUpload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFileUploadTest2() throws Exception { + FileUpload expectedResponse = + FileUpload.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .setDataSourceId(-1015796374) + .addAllIssues(new ArrayList()) + .setItemsTotal(-384543227) + .setItemsCreated(1985498473) + .setItemsUpdated(722513724) + .setUploadTime(Timestamp.newBuilder().build()) + .build(); + mockFileUploadsService.addResponse(expectedResponse); + + String name = "name3373707"; + + FileUpload actualResponse = client.getFileUpload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFileUploadsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFileUploadRequest actualRequest = ((GetFileUploadRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFileUploadExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFileUploadsService.addException(exception); + + try { + String name = "name3373707"; + client.getFileUpload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesService.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesService.java new file mode 100644 index 000000000000..049c81fb6b3a --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesService.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.datasources.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 MockDataSourcesService implements MockGrpcService { + private final MockDataSourcesServiceImpl serviceImpl; + + public MockDataSourcesService() { + serviceImpl = new MockDataSourcesServiceImpl(); + } + + @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-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesServiceImpl.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesServiceImpl.java new file mode 100644 index 000000000000..cc4a375c8c58 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockDataSourcesServiceImpl.java @@ -0,0 +1,187 @@ +/* + * 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.datasources.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceGrpc.DataSourcesServiceImplBase; +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 MockDataSourcesServiceImpl extends DataSourcesServiceImplBase { + private List requests; + private Queue responses; + + public MockDataSourcesServiceImpl() { + 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 getDataSource( + GetDataSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataSource) { + requests.add(request); + responseObserver.onNext(((DataSource) 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 GetDataSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listDataSources( + ListDataSourcesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListDataSourcesResponse) { + requests.add(request); + responseObserver.onNext(((ListDataSourcesResponse) 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 ListDataSources, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListDataSourcesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createDataSource( + CreateDataSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataSource) { + requests.add(request); + responseObserver.onNext(((DataSource) 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 CreateDataSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateDataSource( + UpdateDataSourceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof DataSource) { + requests.add(request); + responseObserver.onNext(((DataSource) 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 UpdateDataSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + DataSource.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteDataSource( + DeleteDataSourceRequest 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 DeleteDataSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void fetchDataSource( + FetchDataSourceRequest 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 FetchDataSource, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsService.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsService.java new file mode 100644 index 000000000000..9339977c1c8d --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsService.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.datasources.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 MockFileUploadsService implements MockGrpcService { + private final MockFileUploadsServiceImpl serviceImpl; + + public MockFileUploadsService() { + serviceImpl = new MockFileUploadsServiceImpl(); + } + + @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-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsServiceImpl.java b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsServiceImpl.java new file mode 100644 index 000000000000..ee9bdb773748 --- /dev/null +++ b/java-shopping-merchant-datasources/google-shopping-merchant-datasources/src/test/java/com/google/shopping/merchant/datasources/v1/MockFileUploadsServiceImpl.java @@ -0,0 +1,81 @@ +/* + * 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.datasources.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceGrpc.FileUploadsServiceImplBase; +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 MockFileUploadsServiceImpl extends FileUploadsServiceImplBase { + private List requests; + private Queue responses; + + public MockFileUploadsServiceImpl() { + 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 getFileUpload( + GetFileUploadRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FileUpload) { + requests.add(request); + responseObserver.onNext(((FileUpload) 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 GetFileUpload, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FileUpload.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/pom.xml b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/pom.xml new file mode 100644 index 000000000000..7aa1751ad806 --- /dev/null +++ b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + grpc-google-shopping-merchant-datasources-v1 + GRPC library for google-shopping-merchant-datasources + + com.google.shopping + google-shopping-merchant-datasources-parent + 0.27.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-datasources-v1 + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceGrpc.java b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceGrpc.java new file mode 100644 index 000000000000..7cacd475ae92 --- /dev/null +++ b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesServiceGrpc.java @@ -0,0 +1,1141 @@ +/* + * 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.datasources.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage primary, supplemental, inventory and other data sources.
+ * See more in the [Merchant
+ * Center](https://support.google.com/merchants/answer/7439058) help article.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/datasources/v1/datasources.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class DataSourcesServiceGrpc { + + private DataSourcesServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.datasources.v1.DataSourcesService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getGetDataSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetDataSource", + requestType = com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.class, + responseType = com.google.shopping.merchant.datasources.v1.DataSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getGetDataSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getGetDataSourceMethod; + if ((getGetDataSourceMethod = DataSourcesServiceGrpc.getGetDataSourceMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getGetDataSourceMethod = DataSourcesServiceGrpc.getGetDataSourceMethod) == null) { + DataSourcesServiceGrpc.getGetDataSourceMethod = + getGetDataSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDataSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.DataSource + .getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("GetDataSource")) + .build(); + } + } + } + return getGetDataSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + getListDataSourcesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListDataSources", + requestType = com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.class, + responseType = com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + getListDataSourcesMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + getListDataSourcesMethod; + if ((getListDataSourcesMethod = DataSourcesServiceGrpc.getListDataSourcesMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getListDataSourcesMethod = DataSourcesServiceGrpc.getListDataSourcesMethod) == null) { + DataSourcesServiceGrpc.getListDataSourcesMethod = + getListDataSourcesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDataSources")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("ListDataSources")) + .build(); + } + } + } + return getListDataSourcesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getCreateDataSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateDataSource", + requestType = com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.class, + responseType = com.google.shopping.merchant.datasources.v1.DataSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getCreateDataSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getCreateDataSourceMethod; + if ((getCreateDataSourceMethod = DataSourcesServiceGrpc.getCreateDataSourceMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getCreateDataSourceMethod = DataSourcesServiceGrpc.getCreateDataSourceMethod) + == null) { + DataSourcesServiceGrpc.getCreateDataSourceMethod = + getCreateDataSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDataSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.DataSource + .getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("CreateDataSource")) + .build(); + } + } + } + return getCreateDataSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getUpdateDataSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateDataSource", + requestType = com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.class, + responseType = com.google.shopping.merchant.datasources.v1.DataSource.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getUpdateDataSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource> + getUpdateDataSourceMethod; + if ((getUpdateDataSourceMethod = DataSourcesServiceGrpc.getUpdateDataSourceMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getUpdateDataSourceMethod = DataSourcesServiceGrpc.getUpdateDataSourceMethod) + == null) { + DataSourcesServiceGrpc.getUpdateDataSourceMethod = + getUpdateDataSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDataSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.DataSource + .getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("UpdateDataSource")) + .build(); + } + } + } + return getUpdateDataSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest, + com.google.protobuf.Empty> + getDeleteDataSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDataSource", + requestType = com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest, + com.google.protobuf.Empty> + getDeleteDataSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest, + com.google.protobuf.Empty> + getDeleteDataSourceMethod; + if ((getDeleteDataSourceMethod = DataSourcesServiceGrpc.getDeleteDataSourceMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getDeleteDataSourceMethod = DataSourcesServiceGrpc.getDeleteDataSourceMethod) + == null) { + DataSourcesServiceGrpc.getDeleteDataSourceMethod = + getDeleteDataSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDataSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("DeleteDataSource")) + .build(); + } + } + } + return getDeleteDataSourceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest, + com.google.protobuf.Empty> + getFetchDataSourceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FetchDataSource", + requestType = com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest, + com.google.protobuf.Empty> + getFetchDataSourceMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest, + com.google.protobuf.Empty> + getFetchDataSourceMethod; + if ((getFetchDataSourceMethod = DataSourcesServiceGrpc.getFetchDataSourceMethod) == null) { + synchronized (DataSourcesServiceGrpc.class) { + if ((getFetchDataSourceMethod = DataSourcesServiceGrpc.getFetchDataSourceMethod) == null) { + DataSourcesServiceGrpc.getFetchDataSourceMethod = + getFetchDataSourceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "FetchDataSource")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new DataSourcesServiceMethodDescriptorSupplier("FetchDataSource")) + .build(); + } + } + } + return getFetchDataSourceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static DataSourcesServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataSourcesServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceStub(channel, callOptions); + } + }; + return DataSourcesServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static DataSourcesServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataSourcesServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceBlockingV2Stub(channel, callOptions); + } + }; + return DataSourcesServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static DataSourcesServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataSourcesServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceBlockingStub(channel, callOptions); + } + }; + return DataSourcesServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static DataSourcesServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public DataSourcesServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceFutureStub(channel, callOptions); + } + }; + return DataSourcesServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves the data source configuration for the given account.
+     * 
+ */ + default void getDataSource( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetDataSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the configurations for data sources for the given account.
+     * 
+ */ + default void listDataSources( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListDataSourcesMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates the new data source configuration for the given account.
+     * This method always creates a new data source.
+     * 
+ */ + default void createDataSource( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateDataSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the existing data source configuration. The fields that are
+     * set in the update mask but not provided in the resource will be deleted.
+     * 
+ */ + default void updateDataSource( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateDataSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a data source from your Merchant Center account.
+     * 
+ */ + default void deleteDataSource( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDataSourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Performs the data fetch immediately (even outside fetch schedule) on a
+     * data source from your Merchant Center Account. If you need to call
+     * this method more than once per day, you should use the Products service to
+     * update your product data instead.
+     * This method only works on data sources with a file input set.
+     * 
+ */ + default void fetchDataSource( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFetchDataSourceMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service DataSourcesService. + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public abstract static class DataSourcesServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return DataSourcesServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service DataSourcesService. + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public static final class DataSourcesServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private DataSourcesServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataSourcesServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the data source configuration for the given account.
+     * 
+ */ + public void getDataSource( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDataSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the configurations for data sources for the given account.
+     * 
+ */ + public void listDataSources( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListDataSourcesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates the new data source configuration for the given account.
+     * This method always creates a new data source.
+     * 
+ */ + public void createDataSource( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateDataSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the existing data source configuration. The fields that are
+     * set in the update mask but not provided in the resource will be deleted.
+     * 
+ */ + public void updateDataSource( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateDataSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a data source from your Merchant Center account.
+     * 
+ */ + public void deleteDataSource( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDataSourceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Performs the data fetch immediately (even outside fetch schedule) on a
+     * data source from your Merchant Center Account. If you need to call
+     * this method more than once per day, you should use the Products service to
+     * update your product data instead.
+     * This method only works on data sources with a file input set.
+     * 
+ */ + public void fetchDataSource( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFetchDataSourceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service DataSourcesService. + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public static final class DataSourcesServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private DataSourcesServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataSourcesServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the data source configuration for the given account.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the configurations for data sources for the given account.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse listDataSources( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDataSourcesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates the new data source configuration for the given account.
+     * This method always creates a new data source.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource createDataSource( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the existing data source configuration. The fields that are
+     * set in the update mask but not provided in the resource will be deleted.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource updateDataSource( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a data source from your Merchant Center account.
+     * 
+ */ + public com.google.protobuf.Empty deleteDataSource( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Performs the data fetch immediately (even outside fetch schedule) on a
+     * data source from your Merchant Center Account. If you need to call
+     * this method more than once per day, you should use the Products service to
+     * update your product data instead.
+     * This method only works on data sources with a file input set.
+     * 
+ */ + public com.google.protobuf.Empty fetchDataSource( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchDataSourceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service DataSourcesService. + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public static final class DataSourcesServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private DataSourcesServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataSourcesServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the data source configuration for the given account.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the configurations for data sources for the given account.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse listDataSources( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListDataSourcesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates the new data source configuration for the given account.
+     * This method always creates a new data source.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource createDataSource( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the existing data source configuration. The fields that are
+     * set in the update mask but not provided in the resource will be deleted.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.DataSource updateDataSource( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a data source from your Merchant Center account.
+     * 
+ */ + public com.google.protobuf.Empty deleteDataSource( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDataSourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Performs the data fetch immediately (even outside fetch schedule) on a
+     * data source from your Merchant Center Account. If you need to call
+     * this method more than once per day, you should use the Products service to
+     * update your product data instead.
+     * This method only works on data sources with a file input set.
+     * 
+ */ + public com.google.protobuf.Empty fetchDataSource( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFetchDataSourceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service DataSourcesService. + * + *
+   * Service to manage primary, supplemental, inventory and other data sources.
+   * See more in the [Merchant
+   * Center](https://support.google.com/merchants/answer/7439058) help article.
+   * 
+ */ + public static final class DataSourcesServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private DataSourcesServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected DataSourcesServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new DataSourcesServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the data source configuration for the given account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.datasources.v1.DataSource> + getDataSource(com.google.shopping.merchant.datasources.v1.GetDataSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDataSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the configurations for data sources for the given account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse> + listDataSources( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListDataSourcesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates the new data source configuration for the given account.
+     * This method always creates a new data source.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.datasources.v1.DataSource> + createDataSource( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateDataSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the existing data source configuration. The fields that are
+     * set in the update mask but not provided in the resource will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.datasources.v1.DataSource> + updateDataSource( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateDataSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a data source from your Merchant Center account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDataSource( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDataSourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Performs the data fetch immediately (even outside fetch schedule) on a
+     * data source from your Merchant Center Account. If you need to call
+     * this method more than once per day, you should use the Products service to
+     * update your product data instead.
+     * This method only works on data sources with a file input set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + fetchDataSource( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFetchDataSourceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_DATA_SOURCE = 0; + private static final int METHODID_LIST_DATA_SOURCES = 1; + private static final int METHODID_CREATE_DATA_SOURCE = 2; + private static final int METHODID_UPDATE_DATA_SOURCE = 3; + private static final int METHODID_DELETE_DATA_SOURCE = 4; + private static final int METHODID_FETCH_DATA_SOURCE = 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_GET_DATA_SOURCE: + serviceImpl.getDataSource( + (com.google.shopping.merchant.datasources.v1.GetDataSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_DATA_SOURCES: + serviceImpl.listDataSources( + (com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse>) + responseObserver); + break; + case METHODID_CREATE_DATA_SOURCE: + serviceImpl.createDataSource( + (com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_DATA_SOURCE: + serviceImpl.updateDataSource( + (com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_DATA_SOURCE: + serviceImpl.deleteDataSource( + (com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_FETCH_DATA_SOURCE: + serviceImpl.fetchDataSource( + (com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest) request, + (io.grpc.stub.StreamObserver) 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( + getGetDataSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource>( + service, METHODID_GET_DATA_SOURCE))) + .addMethod( + getListDataSourcesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse>( + service, METHODID_LIST_DATA_SOURCES))) + .addMethod( + getCreateDataSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource>( + service, METHODID_CREATE_DATA_SOURCE))) + .addMethod( + getUpdateDataSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest, + com.google.shopping.merchant.datasources.v1.DataSource>( + service, METHODID_UPDATE_DATA_SOURCE))) + .addMethod( + getDeleteDataSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_DATA_SOURCE))) + .addMethod( + getFetchDataSourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest, + com.google.protobuf.Empty>(service, METHODID_FETCH_DATA_SOURCE))) + .build(); + } + + private abstract static class DataSourcesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + DataSourcesServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("DataSourcesService"); + } + } + + private static final class DataSourcesServiceFileDescriptorSupplier + extends DataSourcesServiceBaseDescriptorSupplier { + DataSourcesServiceFileDescriptorSupplier() {} + } + + private static final class DataSourcesServiceMethodDescriptorSupplier + extends DataSourcesServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + DataSourcesServiceMethodDescriptorSupplier(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 (DataSourcesServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new DataSourcesServiceFileDescriptorSupplier()) + .addMethod(getGetDataSourceMethod()) + .addMethod(getListDataSourcesMethod()) + .addMethod(getCreateDataSourceMethod()) + .addMethod(getUpdateDataSourceMethod()) + .addMethod(getDeleteDataSourceMethod()) + .addMethod(getFetchDataSourceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceGrpc.java b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceGrpc.java new file mode 100644 index 000000000000..5113f4b7928d --- /dev/null +++ b/java-shopping-merchant-datasources/grpc-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsServiceGrpc.java @@ -0,0 +1,433 @@ +/* + * 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.datasources.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage data source file uploads.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/datasources/v1/fileuploads.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class FileUploadsServiceGrpc { + + private FileUploadsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.datasources.v1.FileUploadsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest, + com.google.shopping.merchant.datasources.v1.FileUpload> + getGetFileUploadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFileUpload", + requestType = com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.class, + responseType = com.google.shopping.merchant.datasources.v1.FileUpload.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest, + com.google.shopping.merchant.datasources.v1.FileUpload> + getGetFileUploadMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest, + com.google.shopping.merchant.datasources.v1.FileUpload> + getGetFileUploadMethod; + if ((getGetFileUploadMethod = FileUploadsServiceGrpc.getGetFileUploadMethod) == null) { + synchronized (FileUploadsServiceGrpc.class) { + if ((getGetFileUploadMethod = FileUploadsServiceGrpc.getGetFileUploadMethod) == null) { + FileUploadsServiceGrpc.getGetFileUploadMethod = + getGetFileUploadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFileUpload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.datasources.v1.FileUpload + .getDefaultInstance())) + .setSchemaDescriptor( + new FileUploadsServiceMethodDescriptorSupplier("GetFileUpload")) + .build(); + } + } + } + return getGetFileUploadMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FileUploadsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FileUploadsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceStub(channel, callOptions); + } + }; + return FileUploadsServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static FileUploadsServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FileUploadsServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceBlockingV2Stub(channel, callOptions); + } + }; + return FileUploadsServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FileUploadsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FileUploadsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceBlockingStub(channel, callOptions); + } + }; + return FileUploadsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FileUploadsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FileUploadsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceFutureStub(channel, callOptions); + } + }; + return FileUploadsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets the latest data source file upload. Only the `latest` alias is
+     * accepted for a file upload.
+     * 
+ */ + default void getFileUpload( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetFileUploadMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service FileUploadsService. + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public abstract static class FileUploadsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return FileUploadsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service FileUploadsService. + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public static final class FileUploadsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private FileUploadsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FileUploadsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets the latest data source file upload. Only the `latest` alias is
+     * accepted for a file upload.
+     * 
+ */ + public void getFileUpload( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFileUploadMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service FileUploadsService. + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public static final class FileUploadsServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private FileUploadsServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FileUploadsServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Gets the latest data source file upload. Only the `latest` alias is
+     * accepted for a file upload.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.FileUpload getFileUpload( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFileUploadMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service FileUploadsService. + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public static final class FileUploadsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FileUploadsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FileUploadsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets the latest data source file upload. Only the `latest` alias is
+     * accepted for a file upload.
+     * 
+ */ + public com.google.shopping.merchant.datasources.v1.FileUpload getFileUpload( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFileUploadMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service FileUploadsService. + * + *
+   * Service to manage data source file uploads.
+   * 
+ */ + public static final class FileUploadsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FileUploadsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FileUploadsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FileUploadsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets the latest data source file upload. Only the `latest` alias is
+     * accepted for a file upload.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.datasources.v1.FileUpload> + getFileUpload(com.google.shopping.merchant.datasources.v1.GetFileUploadRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFileUploadMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_FILE_UPLOAD = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_FILE_UPLOAD: + serviceImpl.getFileUpload( + (com.google.shopping.merchant.datasources.v1.GetFileUploadRequest) request, + (io.grpc.stub.StreamObserver) + 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( + getGetFileUploadMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest, + com.google.shopping.merchant.datasources.v1.FileUpload>( + service, METHODID_GET_FILE_UPLOAD))) + .build(); + } + + private abstract static class FileUploadsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FileUploadsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("FileUploadsService"); + } + } + + private static final class FileUploadsServiceFileDescriptorSupplier + extends FileUploadsServiceBaseDescriptorSupplier { + FileUploadsServiceFileDescriptorSupplier() {} + } + + private static final class FileUploadsServiceMethodDescriptorSupplier + extends FileUploadsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + FileUploadsServiceMethodDescriptorSupplier(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 (FileUploadsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FileUploadsServiceFileDescriptorSupplier()) + .addMethod(getGetFileUploadMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-datasources/pom.xml b/java-shopping-merchant-datasources/pom.xml index aadd9bb2018a..324c978a12f7 100644 --- a/java-shopping-merchant-datasources/pom.xml +++ b/java-shopping-merchant-datasources/pom.xml @@ -31,6 +31,16 @@ google-shopping-merchant-datasources 0.27.0-SNAPSHOT + + com.google.shopping.api.grpc + proto-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + com.google.shopping.api.grpc grpc-google-shopping-merchant-datasources-v1beta @@ -48,7 +58,9 @@ google-shopping-merchant-datasources grpc-google-shopping-merchant-datasources-v1beta + grpc-google-shopping-merchant-datasources-v1 proto-google-shopping-merchant-datasources-v1beta + proto-google-shopping-merchant-datasources-v1 google-shopping-merchant-datasources-bom diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/clirr-ignored-differences.xml b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..29a9b7416f9f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/clirr-ignored-differences.xml @@ -0,0 +1,80 @@ + + + + + 7012 + com/google/shopping/merchant/datasources/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/datasources/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/datasources/v1/*OrBuilder + boolean has*(*) + + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * addRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * clear() + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * clearField(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * clearOneof(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * clone() + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * setField(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * setRepeatedField(*) + ** + + + 7006 + com/google/shopping/merchant/datasources/v1/** + * setUnknownFields(*) + ** + + diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/pom.xml b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/pom.xml new file mode 100644 index 000000000000..30d873061492 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-datasources-v1 + 0.27.0-SNAPSHOT + proto-google-shopping-merchant-datasources-v1 + Proto library for google-shopping-merchant-datasources + + com.google.shopping + google-shopping-merchant-datasources-parent + 0.27.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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/AccountName.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/AccountName.java new file mode 100644 index 000000000000..e54f8da0650c --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/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.datasources.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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequest.java new file mode 100644 index 000000000000..2a1f5547ff49 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequest.java @@ -0,0 +1,985 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the CreateDataSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.CreateDataSourceRequest} + */ +public final class CreateDataSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.CreateDataSourceRequest) + CreateDataSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateDataSourceRequest.newBuilder() to construct. + private CreateDataSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateDataSourceRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateDataSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The account where this data source will be created.
+   * 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 account where this data source will be created.
+   * 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 DATA_SOURCE_FIELD_NUMBER = 2; + private com.google.shopping.merchant.datasources.v1.DataSource dataSource_; + + /** + * + * + *
+   * Required. The data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + @java.lang.Override + public boolean hasDataSource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource() { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + + /** + * + * + *
+   * Required. The data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourceOrBuilder() { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + + 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, getDataSource()); + } + 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, getDataSource()); + } + 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.datasources.v1.CreateDataSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest other = + (com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasDataSource() != other.hasDataSource()) return false; + if (hasDataSource()) { + if (!getDataSource().equals(other.getDataSource())) 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 (hasDataSource()) { + hash = (37 * hash) + DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getDataSource().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest 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.datasources.v1.CreateDataSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest 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.datasources.v1.CreateDataSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest 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.datasources.v1.CreateDataSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + 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.datasources.v1.CreateDataSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest 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.datasources.v1.CreateDataSourceRequest 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 CreateDataSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.CreateDataSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.CreateDataSourceRequest) + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDataSourceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + dataSource_ = null; + if (dataSourceBuilder_ != null) { + dataSourceBuilder_.dispose(); + dataSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest build() { + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest result = + new com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataSource_ = dataSourceBuilder_ == null ? dataSource_ : dataSourceBuilder_.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.datasources.v1.CreateDataSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasDataSource()) { + mergeDataSource(other.getDataSource()); + } + 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(getDataSourceFieldBuilder().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 account where this data source will be created.
+     * 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 account where this data source will be created.
+     * 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 account where this data source will be created.
+     * 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 account where this data source will be created.
+     * 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 account where this data source will be created.
+     * 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.datasources.v1.DataSource dataSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + dataSourceBuilder_; + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + public boolean hasDataSource() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource() { + if (dataSourceBuilder_ == null) { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } else { + return dataSourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataSource(com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataSource_ = value; + } else { + dataSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataSource( + com.google.shopping.merchant.datasources.v1.DataSource.Builder builderForValue) { + if (dataSourceBuilder_ == null) { + dataSource_ = builderForValue.build(); + } else { + dataSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataSource(com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && dataSource_ != null + && dataSource_ + != com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance()) { + getDataSourceBuilder().mergeFrom(value); + } else { + dataSource_ = value; + } + } else { + dataSourceBuilder_.mergeFrom(value); + } + if (dataSource_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataSource() { + bitField0_ = (bitField0_ & ~0x00000002); + dataSource_ = null; + if (dataSourceBuilder_ != null) { + dataSourceBuilder_.dispose(); + dataSourceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSource.Builder getDataSourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder + getDataSourceOrBuilder() { + if (dataSourceBuilder_ != null) { + return dataSourceBuilder_.getMessageOrBuilder(); + } else { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + } + + /** + * + * + *
+     * Required. The data source to create.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + getDataSourceFieldBuilder() { + if (dataSourceBuilder_ == null) { + dataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder>( + getDataSource(), getParentForChildren(), isClean()); + dataSource_ = null; + } + return dataSourceBuilder_; + } + + @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.datasources.v1.CreateDataSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.CreateDataSourceRequest) + private static final com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateDataSourceRequest 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.datasources.v1.CreateDataSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequestOrBuilder.java new file mode 100644 index 000000000000..249e5cd6e7f3 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/CreateDataSourceRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface CreateDataSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.CreateDataSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account where this data source will be created.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The account where this data source will be created.
+   * 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 data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + boolean hasDataSource(); + + /** + * + * + *
+   * Required. The data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + com.google.shopping.merchant.datasources.v1.DataSource getDataSource(); + + /** + * + * + *
+   * Required. The data source to create.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourceOrBuilder(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSource.java new file mode 100644 index 000000000000..bdfc47ab7181 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSource.java @@ -0,0 +1,4359 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The [data source](/merchant/api/guides/data-sources/overview) for
+ * the Merchant Center account.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DataSource} + */ +public final class DataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.DataSource) + DataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DataSource.newBuilder() to construct. + private DataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataSource() { + name_ = ""; + displayName_ = ""; + input_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DataSource.class, + com.google.shopping.merchant.datasources.v1.DataSource.Builder.class); + } + + /** + * + * + *
+   * Determines the type of input to the data source. Based on the input some
+   * settings might not be supported.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.datasources.v1.DataSource.Input} + */ + public enum Input implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Input unspecified.
+     * 
+ * + * INPUT_UNSPECIFIED = 0; + */ + INPUT_UNSPECIFIED(0), + /** + * + * + *
+     * Represents data sources for which the data is primarily provided through
+     * the API.
+     * 
+ * + * API = 1; + */ + API(1), + /** + * + * + *
+     * Represents data sources for which the data is primarily provided through
+     * file input. Data can still be provided through the API.
+     * 
+ * + * FILE = 2; + */ + FILE(2), + /** + * + * + *
+     * The data source for products added directly in Merchant Center.
+     *
+     * This type of data source can not be created or updated through this API,
+     * only by Merchant Center UI.
+     *
+     * This type of data source is read only.
+     * 
+ * + * UI = 3; + */ + UI(3), + /** + * + * + *
+     * This is also known as
+     * [Automated feeds](https://support.google.com/merchants/answer/12158480)
+     * used to automatically build your product data. This type of data source
+     * can be enabled or disabled through the Accounts sub-API.
+     * 
+ * + * AUTOFEED = 4; + */ + AUTOFEED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Input unspecified.
+     * 
+ * + * INPUT_UNSPECIFIED = 0; + */ + public static final int INPUT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * Represents data sources for which the data is primarily provided through
+     * the API.
+     * 
+ * + * API = 1; + */ + public static final int API_VALUE = 1; + + /** + * + * + *
+     * Represents data sources for which the data is primarily provided through
+     * file input. Data can still be provided through the API.
+     * 
+ * + * FILE = 2; + */ + public static final int FILE_VALUE = 2; + + /** + * + * + *
+     * The data source for products added directly in Merchant Center.
+     *
+     * This type of data source can not be created or updated through this API,
+     * only by Merchant Center UI.
+     *
+     * This type of data source is read only.
+     * 
+ * + * UI = 3; + */ + public static final int UI_VALUE = 3; + + /** + * + * + *
+     * This is also known as
+     * [Automated feeds](https://support.google.com/merchants/answer/12158480)
+     * used to automatically build your product data. This type of data source
+     * can be enabled or disabled through the Accounts sub-API.
+     * 
+ * + * AUTOFEED = 4; + */ + public static final int AUTOFEED_VALUE = 4; + + 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 Input 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 Input forNumber(int value) { + switch (value) { + case 0: + return INPUT_UNSPECIFIED; + case 1: + return API; + case 2: + return FILE; + case 3: + return UI; + case 4: + return AUTOFEED; + 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 Input findValueByNumber(int number) { + return Input.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.datasources.v1.DataSource.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Input[] VALUES = values(); + + public static Input 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 Input(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.datasources.v1.DataSource.Input) + } + + private int bitField0_; + private int typeCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object type_; + + public enum TypeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PRIMARY_PRODUCT_DATA_SOURCE(4), + SUPPLEMENTAL_PRODUCT_DATA_SOURCE(5), + LOCAL_INVENTORY_DATA_SOURCE(6), + REGIONAL_INVENTORY_DATA_SOURCE(7), + PROMOTION_DATA_SOURCE(8), + PRODUCT_REVIEW_DATA_SOURCE(9), + MERCHANT_REVIEW_DATA_SOURCE(12), + TYPE_NOT_SET(0); + private final int value; + + private TypeCase(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 TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 4: + return PRIMARY_PRODUCT_DATA_SOURCE; + case 5: + return SUPPLEMENTAL_PRODUCT_DATA_SOURCE; + case 6: + return LOCAL_INVENTORY_DATA_SOURCE; + case 7: + return REGIONAL_INVENTORY_DATA_SOURCE; + case 8: + return PROMOTION_DATA_SOURCE; + case 9: + return PRODUCT_REVIEW_DATA_SOURCE; + case 12: + return MERCHANT_REVIEW_DATA_SOURCE; + case 0: + return TYPE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public static final int PRIMARY_PRODUCT_DATA_SOURCE_FIELD_NUMBER = 4; + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return Whether the primaryProductDataSource field is set. + */ + @java.lang.Override + public boolean hasPrimaryProductDataSource() { + return typeCase_ == 4; + } + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return The primaryProductDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + getPrimaryProductDataSource() { + if (typeCase_ == 4) { + return (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder + getPrimaryProductDataSourceOrBuilder() { + if (typeCase_ == 4) { + return (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + + public static final int SUPPLEMENTAL_PRODUCT_DATA_SOURCE_FIELD_NUMBER = 5; + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return Whether the supplementalProductDataSource field is set. + */ + @java.lang.Override + public boolean hasSupplementalProductDataSource() { + return typeCase_ == 5; + } + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return The supplementalProductDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + getSupplementalProductDataSource() { + if (typeCase_ == 5) { + return (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder + getSupplementalProductDataSourceOrBuilder() { + if (typeCase_ == 5) { + return (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + + public static final int LOCAL_INVENTORY_DATA_SOURCE_FIELD_NUMBER = 6; + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return Whether the localInventoryDataSource field is set. + */ + @java.lang.Override + public boolean hasLocalInventoryDataSource() { + return typeCase_ == 6; + } + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return The localInventoryDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + getLocalInventoryDataSource() { + if (typeCase_ == 6) { + return (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder + getLocalInventoryDataSourceOrBuilder() { + if (typeCase_ == 6) { + return (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + + public static final int REGIONAL_INVENTORY_DATA_SOURCE_FIELD_NUMBER = 7; + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return Whether the regionalInventoryDataSource field is set. + */ + @java.lang.Override + public boolean hasRegionalInventoryDataSource() { + return typeCase_ == 7; + } + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return The regionalInventoryDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + getRegionalInventoryDataSource() { + if (typeCase_ == 7) { + return (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder + getRegionalInventoryDataSourceOrBuilder() { + if (typeCase_ == 7) { + return (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + + public static final int PROMOTION_DATA_SOURCE_FIELD_NUMBER = 8; + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return Whether the promotionDataSource field is set. + */ + @java.lang.Override + public boolean hasPromotionDataSource() { + return typeCase_ == 8; + } + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return The promotionDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSource getPromotionDataSource() { + if (typeCase_ == 8) { + return (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder + getPromotionDataSourceOrBuilder() { + if (typeCase_ == 8) { + return (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + + public static final int PRODUCT_REVIEW_DATA_SOURCE_FIELD_NUMBER = 9; + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return Whether the productReviewDataSource field is set. + */ + @java.lang.Override + public boolean hasProductReviewDataSource() { + return typeCase_ == 9; + } + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return The productReviewDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + getProductReviewDataSource() { + if (typeCase_ == 9) { + return (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.getDefaultInstance(); + } + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder + getProductReviewDataSourceOrBuilder() { + if (typeCase_ == 9) { + return (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.getDefaultInstance(); + } + + public static final int MERCHANT_REVIEW_DATA_SOURCE_FIELD_NUMBER = 12; + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return Whether the merchantReviewDataSource field is set. + */ + @java.lang.Override + public boolean hasMerchantReviewDataSource() { + return typeCase_ == 12; + } + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return The merchantReviewDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + getMerchantReviewDataSource() { + if (typeCase_ == 12) { + return (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder + getMerchantReviewDataSourceOrBuilder() { + if (typeCase_ == 12) { + return (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Identifier. The name of the data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+   * Required. Identifier. The name of the data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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 DATA_SOURCE_ID_FIELD_NUMBER = 2; + private long dataSourceId_ = 0L; + + /** + * + * + *
+   * Output only. The data source id.
+   * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + @java.lang.Override + public long getDataSourceId() { + return dataSourceId_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * Required. The displayed data source name in the Merchant Center UI.
+   * 
+ * + * 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. The displayed data source name in the Merchant Center UI.
+   * 
+ * + * 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 INPUT_FIELD_NUMBER = 10; + private int input_ = 0; + + /** + * + * + *
+   * Output only. Determines the type of input to the data source. Based on the
+   * input some settings might not work. Only generic data sources can be
+   * created through the API.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for input. + */ + @java.lang.Override + public int getInputValue() { + return input_; + } + + /** + * + * + *
+   * Output only. Determines the type of input to the data source. Based on the
+   * input some settings might not work. Only generic data sources can be
+   * created through the API.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The input. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource.Input getInput() { + com.google.shopping.merchant.datasources.v1.DataSource.Input result = + com.google.shopping.merchant.datasources.v1.DataSource.Input.forNumber(input_); + return result == null + ? com.google.shopping.merchant.datasources.v1.DataSource.Input.UNRECOGNIZED + : result; + } + + public static final int FILE_INPUT_FIELD_NUMBER = 11; + private com.google.shopping.merchant.datasources.v1.FileInput fileInput_; + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileInput field is set. + */ + @java.lang.Override + public boolean hasFileInput() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileInput. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput getFileInput() { + return fileInput_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance() + : fileInput_; + } + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInputOrBuilder getFileInputOrBuilder() { + return fileInput_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance() + : fileInput_; + } + + 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 (dataSourceId_ != 0L) { + output.writeInt64(2, dataSourceId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (typeCase_ == 4) { + output.writeMessage( + 4, (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_); + } + if (typeCase_ == 5) { + output.writeMessage( + 5, (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_); + } + if (typeCase_ == 6) { + output.writeMessage( + 6, (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_); + } + if (typeCase_ == 7) { + output.writeMessage( + 7, (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_); + } + if (typeCase_ == 8) { + output.writeMessage( + 8, (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_); + } + if (typeCase_ == 9) { + output.writeMessage( + 9, (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_); + } + if (input_ + != com.google.shopping.merchant.datasources.v1.DataSource.Input.INPUT_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, input_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(11, getFileInput()); + } + if (typeCase_ == 12) { + output.writeMessage( + 12, (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_); + } + 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 (dataSourceId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, dataSourceId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (typeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_); + } + if (typeCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_); + } + if (typeCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_); + } + if (typeCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_); + } + if (typeCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_); + } + if (typeCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_); + } + if (input_ + != com.google.shopping.merchant.datasources.v1.DataSource.Input.INPUT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, input_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getFileInput()); + } + if (typeCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_); + } + 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.datasources.v1.DataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.DataSource other = + (com.google.shopping.merchant.datasources.v1.DataSource) obj; + + if (!getName().equals(other.getName())) return false; + if (getDataSourceId() != other.getDataSourceId()) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (input_ != other.input_) return false; + if (hasFileInput() != other.hasFileInput()) return false; + if (hasFileInput()) { + if (!getFileInput().equals(other.getFileInput())) return false; + } + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 4: + if (!getPrimaryProductDataSource().equals(other.getPrimaryProductDataSource())) + return false; + break; + case 5: + if (!getSupplementalProductDataSource().equals(other.getSupplementalProductDataSource())) + return false; + break; + case 6: + if (!getLocalInventoryDataSource().equals(other.getLocalInventoryDataSource())) + return false; + break; + case 7: + if (!getRegionalInventoryDataSource().equals(other.getRegionalInventoryDataSource())) + return false; + break; + case 8: + if (!getPromotionDataSource().equals(other.getPromotionDataSource())) return false; + break; + case 9: + if (!getProductReviewDataSource().equals(other.getProductReviewDataSource())) return false; + break; + case 12: + if (!getMerchantReviewDataSource().equals(other.getMerchantReviewDataSource())) + 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) + DATA_SOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDataSourceId()); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + INPUT_FIELD_NUMBER; + hash = (53 * hash) + input_; + if (hasFileInput()) { + hash = (37 * hash) + FILE_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getFileInput().hashCode(); + } + switch (typeCase_) { + case 4: + hash = (37 * hash) + PRIMARY_PRODUCT_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryProductDataSource().hashCode(); + break; + case 5: + hash = (37 * hash) + SUPPLEMENTAL_PRODUCT_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSupplementalProductDataSource().hashCode(); + break; + case 6: + hash = (37 * hash) + LOCAL_INVENTORY_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventoryDataSource().hashCode(); + break; + case 7: + hash = (37 * hash) + REGIONAL_INVENTORY_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRegionalInventoryDataSource().hashCode(); + break; + case 8: + hash = (37 * hash) + PROMOTION_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getPromotionDataSource().hashCode(); + break; + case 9: + hash = (37 * hash) + PRODUCT_REVIEW_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getProductReviewDataSource().hashCode(); + break; + case 12: + hash = (37 * hash) + MERCHANT_REVIEW_DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getMerchantReviewDataSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.DataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource 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.datasources.v1.DataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource 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.datasources.v1.DataSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource 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.datasources.v1.DataSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource 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.datasources.v1.DataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource 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.datasources.v1.DataSource 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; + } + + /** + * + * + *
+   * The [data source](/merchant/api/guides/data-sources/overview) for
+   * the Merchant Center account.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.DataSource) + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DataSource.class, + com.google.shopping.merchant.datasources.v1.DataSource.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.DataSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFileInputFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (primaryProductDataSourceBuilder_ != null) { + primaryProductDataSourceBuilder_.clear(); + } + if (supplementalProductDataSourceBuilder_ != null) { + supplementalProductDataSourceBuilder_.clear(); + } + if (localInventoryDataSourceBuilder_ != null) { + localInventoryDataSourceBuilder_.clear(); + } + if (regionalInventoryDataSourceBuilder_ != null) { + regionalInventoryDataSourceBuilder_.clear(); + } + if (promotionDataSourceBuilder_ != null) { + promotionDataSourceBuilder_.clear(); + } + if (productReviewDataSourceBuilder_ != null) { + productReviewDataSourceBuilder_.clear(); + } + if (merchantReviewDataSourceBuilder_ != null) { + merchantReviewDataSourceBuilder_.clear(); + } + name_ = ""; + dataSourceId_ = 0L; + displayName_ = ""; + input_ = 0; + fileInput_ = null; + if (fileInputBuilder_ != null) { + fileInputBuilder_.dispose(); + fileInputBuilder_ = null; + } + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource build() { + com.google.shopping.merchant.datasources.v1.DataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.DataSource result = + new com.google.shopping.merchant.datasources.v1.DataSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.merchant.datasources.v1.DataSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.dataSourceId_ = dataSourceId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.input_ = input_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000800) != 0)) { + result.fileInput_ = fileInputBuilder_ == null ? fileInput_ : fileInputBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.shopping.merchant.datasources.v1.DataSource result) { + result.typeCase_ = typeCase_; + result.type_ = this.type_; + if (typeCase_ == 4 && primaryProductDataSourceBuilder_ != null) { + result.type_ = primaryProductDataSourceBuilder_.build(); + } + if (typeCase_ == 5 && supplementalProductDataSourceBuilder_ != null) { + result.type_ = supplementalProductDataSourceBuilder_.build(); + } + if (typeCase_ == 6 && localInventoryDataSourceBuilder_ != null) { + result.type_ = localInventoryDataSourceBuilder_.build(); + } + if (typeCase_ == 7 && regionalInventoryDataSourceBuilder_ != null) { + result.type_ = regionalInventoryDataSourceBuilder_.build(); + } + if (typeCase_ == 8 && promotionDataSourceBuilder_ != null) { + result.type_ = promotionDataSourceBuilder_.build(); + } + if (typeCase_ == 9 && productReviewDataSourceBuilder_ != null) { + result.type_ = productReviewDataSourceBuilder_.build(); + } + if (typeCase_ == 12 && merchantReviewDataSourceBuilder_ != null) { + result.type_ = merchantReviewDataSourceBuilder_.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.datasources.v1.DataSource) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.DataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.datasources.v1.DataSource other) { + if (other == com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getDataSourceId() != 0L) { + setDataSourceId(other.getDataSourceId()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.input_ != 0) { + setInputValue(other.getInputValue()); + } + if (other.hasFileInput()) { + mergeFileInput(other.getFileInput()); + } + switch (other.getTypeCase()) { + case PRIMARY_PRODUCT_DATA_SOURCE: + { + mergePrimaryProductDataSource(other.getPrimaryProductDataSource()); + break; + } + case SUPPLEMENTAL_PRODUCT_DATA_SOURCE: + { + mergeSupplementalProductDataSource(other.getSupplementalProductDataSource()); + break; + } + case LOCAL_INVENTORY_DATA_SOURCE: + { + mergeLocalInventoryDataSource(other.getLocalInventoryDataSource()); + break; + } + case REGIONAL_INVENTORY_DATA_SOURCE: + { + mergeRegionalInventoryDataSource(other.getRegionalInventoryDataSource()); + break; + } + case PROMOTION_DATA_SOURCE: + { + mergePromotionDataSource(other.getPromotionDataSource()); + break; + } + case PRODUCT_REVIEW_DATA_SOURCE: + { + mergeProductReviewDataSource(other.getProductReviewDataSource()); + break; + } + case MERCHANT_REVIEW_DATA_SOURCE: + { + mergeMerchantReviewDataSource(other.getMerchantReviewDataSource()); + break; + } + case TYPE_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_ |= 0x00000080; + break; + } // case 10 + case 16: + { + dataSourceId_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 16 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 26 + case 34: + { + input.readMessage( + getPrimaryProductDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getSupplementalProductDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + getLocalInventoryDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + getRegionalInventoryDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getPromotionDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage( + getProductReviewDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 9; + break; + } // case 74 + case 80: + { + input_ = input.readEnum(); + bitField0_ |= 0x00000400; + break; + } // case 80 + case 90: + { + input.readMessage(getFileInputFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + input.readMessage( + getMerchantReviewDataSourceFieldBuilder().getBuilder(), extensionRegistry); + typeCase_ = 12; + break; + } // case 98 + 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 typeCase_ = 0; + private java.lang.Object type_; + + public TypeCase getTypeCase() { + return TypeCase.forNumber(typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder> + primaryProductDataSourceBuilder_; + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return Whether the primaryProductDataSource field is set. + */ + @java.lang.Override + public boolean hasPrimaryProductDataSource() { + return typeCase_ == 4; + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return The primaryProductDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + getPrimaryProductDataSource() { + if (primaryProductDataSourceBuilder_ == null) { + if (typeCase_ == 4) { + return (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 4) { + return primaryProductDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + public Builder setPrimaryProductDataSource( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource value) { + if (primaryProductDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + primaryProductDataSourceBuilder_.setMessage(value); + } + typeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + public Builder setPrimaryProductDataSource( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder + builderForValue) { + if (primaryProductDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + primaryProductDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + public Builder mergePrimaryProductDataSource( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource value) { + if (primaryProductDataSourceBuilder_ == null) { + if (typeCase_ == 4 + && type_ + != com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 4) { + primaryProductDataSourceBuilder_.mergeFrom(value); + } else { + primaryProductDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 4; + return this; + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + public Builder clearPrimaryProductDataSource() { + if (primaryProductDataSourceBuilder_ == null) { + if (typeCase_ == 4) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 4) { + typeCase_ = 0; + type_ = null; + } + primaryProductDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder + getPrimaryProductDataSourceBuilder() { + return getPrimaryProductDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder + getPrimaryProductDataSourceOrBuilder() { + if ((typeCase_ == 4) && (primaryProductDataSourceBuilder_ != null)) { + return primaryProductDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 4) { + return (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [primary data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder> + getPrimaryProductDataSourceFieldBuilder() { + if (primaryProductDataSourceBuilder_ == null) { + if (!(typeCase_ == 4)) { + type_ = + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + primaryProductDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 4; + onChanged(); + return primaryProductDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder> + supplementalProductDataSourceBuilder_; + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return Whether the supplementalProductDataSource field is set. + */ + @java.lang.Override + public boolean hasSupplementalProductDataSource() { + return typeCase_ == 5; + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return The supplementalProductDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + getSupplementalProductDataSource() { + if (supplementalProductDataSourceBuilder_ == null) { + if (typeCase_ == 5) { + return (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 5) { + return supplementalProductDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + public Builder setSupplementalProductDataSource( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource value) { + if (supplementalProductDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + supplementalProductDataSourceBuilder_.setMessage(value); + } + typeCase_ = 5; + return this; + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + public Builder setSupplementalProductDataSource( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder + builderForValue) { + if (supplementalProductDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + supplementalProductDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 5; + return this; + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + public Builder mergeSupplementalProductDataSource( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource value) { + if (supplementalProductDataSourceBuilder_ == null) { + if (typeCase_ == 5 + && type_ + != com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) + type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 5) { + supplementalProductDataSourceBuilder_.mergeFrom(value); + } else { + supplementalProductDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 5; + return this; + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + public Builder clearSupplementalProductDataSource() { + if (supplementalProductDataSourceBuilder_ == null) { + if (typeCase_ == 5) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 5) { + typeCase_ = 0; + type_ = null; + } + supplementalProductDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder + getSupplementalProductDataSourceBuilder() { + return getSupplementalProductDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder + getSupplementalProductDataSourceOrBuilder() { + if ((typeCase_ == 5) && (supplementalProductDataSourceBuilder_ != null)) { + return supplementalProductDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 5) { + return (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [supplemental data
+     * source](https://support.google.com/merchants/answer/7439058) for local
+     * and online products.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder> + getSupplementalProductDataSourceFieldBuilder() { + if (supplementalProductDataSourceBuilder_ == null) { + if (!(typeCase_ == 5)) { + type_ = + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + supplementalProductDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 5; + onChanged(); + return supplementalProductDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder> + localInventoryDataSourceBuilder_; + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return Whether the localInventoryDataSource field is set. + */ + @java.lang.Override + public boolean hasLocalInventoryDataSource() { + return typeCase_ == 6; + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return The localInventoryDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + getLocalInventoryDataSource() { + if (localInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 6) { + return (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 6) { + return localInventoryDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + public Builder setLocalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource value) { + if (localInventoryDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + localInventoryDataSourceBuilder_.setMessage(value); + } + typeCase_ = 6; + return this; + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + public Builder setLocalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder + builderForValue) { + if (localInventoryDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + localInventoryDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 6; + return this; + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + public Builder mergeLocalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource value) { + if (localInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 6 + && type_ + != com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 6) { + localInventoryDataSourceBuilder_.mergeFrom(value); + } else { + localInventoryDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 6; + return this; + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + public Builder clearLocalInventoryDataSource() { + if (localInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 6) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 6) { + typeCase_ = 0; + type_ = null; + } + localInventoryDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder + getLocalInventoryDataSourceBuilder() { + return getLocalInventoryDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder + getLocalInventoryDataSourceOrBuilder() { + if ((typeCase_ == 6) && (localInventoryDataSourceBuilder_ != null)) { + return localInventoryDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 6) { + return (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [local
+     * inventory](https://support.google.com/merchants/answer/7023001) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder> + getLocalInventoryDataSourceFieldBuilder() { + if (localInventoryDataSourceBuilder_ == null) { + if (!(typeCase_ == 6)) { + type_ = + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + localInventoryDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 6; + onChanged(); + return localInventoryDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder> + regionalInventoryDataSourceBuilder_; + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return Whether the regionalInventoryDataSource field is set. + */ + @java.lang.Override + public boolean hasRegionalInventoryDataSource() { + return typeCase_ == 7; + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return The regionalInventoryDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + getRegionalInventoryDataSource() { + if (regionalInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 7) { + return (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 7) { + return regionalInventoryDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + public Builder setRegionalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource value) { + if (regionalInventoryDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + regionalInventoryDataSourceBuilder_.setMessage(value); + } + typeCase_ = 7; + return this; + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + public Builder setRegionalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder + builderForValue) { + if (regionalInventoryDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + regionalInventoryDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 7; + return this; + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + public Builder mergeRegionalInventoryDataSource( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource value) { + if (regionalInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 7 + && type_ + != com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) + type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 7) { + regionalInventoryDataSourceBuilder_.mergeFrom(value); + } else { + regionalInventoryDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 7; + return this; + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + public Builder clearRegionalInventoryDataSource() { + if (regionalInventoryDataSourceBuilder_ == null) { + if (typeCase_ == 7) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 7) { + typeCase_ = 0; + type_ = null; + } + regionalInventoryDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder + getRegionalInventoryDataSourceBuilder() { + return getRegionalInventoryDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder + getRegionalInventoryDataSourceOrBuilder() { + if ((typeCase_ == 7) && (regionalInventoryDataSourceBuilder_ != null)) { + return regionalInventoryDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 7) { + return (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [regional
+     * inventory](https://support.google.com/merchants/answer/7439058) data
+     * source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder> + getRegionalInventoryDataSourceFieldBuilder() { + if (regionalInventoryDataSourceBuilder_ == null) { + if (!(typeCase_ == 7)) { + type_ = + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + regionalInventoryDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 7; + onChanged(); + return regionalInventoryDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PromotionDataSource, + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder> + promotionDataSourceBuilder_; + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return Whether the promotionDataSource field is set. + */ + @java.lang.Override + public boolean hasPromotionDataSource() { + return typeCase_ == 8; + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return The promotionDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSource + getPromotionDataSource() { + if (promotionDataSourceBuilder_ == null) { + if (typeCase_ == 8) { + return (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } else { + if (typeCase_ == 8) { + return promotionDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + public Builder setPromotionDataSource( + com.google.shopping.merchant.datasources.v1.PromotionDataSource value) { + if (promotionDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + promotionDataSourceBuilder_.setMessage(value); + } + typeCase_ = 8; + return this; + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + public Builder setPromotionDataSource( + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder builderForValue) { + if (promotionDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + promotionDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 8; + return this; + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + public Builder mergePromotionDataSource( + com.google.shopping.merchant.datasources.v1.PromotionDataSource value) { + if (promotionDataSourceBuilder_ == null) { + if (typeCase_ == 8 + && type_ + != com.google.shopping.merchant.datasources.v1.PromotionDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.PromotionDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 8) { + promotionDataSourceBuilder_.mergeFrom(value); + } else { + promotionDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 8; + return this; + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + public Builder clearPromotionDataSource() { + if (promotionDataSourceBuilder_ == null) { + if (typeCase_ == 8) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 8) { + typeCase_ = 0; + type_ = null; + } + promotionDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + public com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder + getPromotionDataSourceBuilder() { + return getPromotionDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder + getPromotionDataSourceOrBuilder() { + if ((typeCase_ == 8) && (promotionDataSourceBuilder_ != null)) { + return promotionDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 8) { + return (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [promotion](https://support.google.com/merchants/answer/2906014)
+     * data source.
+     * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PromotionDataSource, + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder> + getPromotionDataSourceFieldBuilder() { + if (promotionDataSourceBuilder_ == null) { + if (!(typeCase_ == 8)) { + type_ = + com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + promotionDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PromotionDataSource, + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder, + com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.PromotionDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 8; + onChanged(); + return promotionDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder> + productReviewDataSourceBuilder_; + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return Whether the productReviewDataSource field is set. + */ + @java.lang.Override + public boolean hasProductReviewDataSource() { + return typeCase_ == 9; + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return The productReviewDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + getProductReviewDataSource() { + if (productReviewDataSourceBuilder_ == null) { + if (typeCase_ == 9) { + return (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 9) { + return productReviewDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + public Builder setProductReviewDataSource( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource value) { + if (productReviewDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + productReviewDataSourceBuilder_.setMessage(value); + } + typeCase_ = 9; + return this; + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + public Builder setProductReviewDataSource( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder + builderForValue) { + if (productReviewDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + productReviewDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 9; + return this; + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + public Builder mergeProductReviewDataSource( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource value) { + if (productReviewDataSourceBuilder_ == null) { + if (typeCase_ == 9 + && type_ + != com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 9) { + productReviewDataSourceBuilder_.mergeFrom(value); + } else { + productReviewDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 9; + return this; + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + public Builder clearProductReviewDataSource() { + if (productReviewDataSourceBuilder_ == null) { + if (typeCase_ == 9) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 9) { + typeCase_ = 0; + type_ = null; + } + productReviewDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder + getProductReviewDataSourceBuilder() { + return getProductReviewDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder + getProductReviewDataSourceOrBuilder() { + if ((typeCase_ == 9) && (productReviewDataSourceBuilder_ != null)) { + return productReviewDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 9) { + return (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [product
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder> + getProductReviewDataSourceFieldBuilder() { + if (productReviewDataSourceBuilder_ == null) { + if (!(typeCase_ == 9)) { + type_ = + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance(); + } + productReviewDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 9; + onChanged(); + return productReviewDataSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder> + merchantReviewDataSourceBuilder_; + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return Whether the merchantReviewDataSource field is set. + */ + @java.lang.Override + public boolean hasMerchantReviewDataSource() { + return typeCase_ == 12; + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return The merchantReviewDataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + getMerchantReviewDataSource() { + if (merchantReviewDataSourceBuilder_ == null) { + if (typeCase_ == 12) { + return (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } else { + if (typeCase_ == 12) { + return merchantReviewDataSourceBuilder_.getMessage(); + } + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + public Builder setMerchantReviewDataSource( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource value) { + if (merchantReviewDataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + merchantReviewDataSourceBuilder_.setMessage(value); + } + typeCase_ = 12; + return this; + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + public Builder setMerchantReviewDataSource( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder + builderForValue) { + if (merchantReviewDataSourceBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + merchantReviewDataSourceBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 12; + return this; + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + public Builder mergeMerchantReviewDataSource( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource value) { + if (merchantReviewDataSourceBuilder_ == null) { + if (typeCase_ == 12 + && type_ + != com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance()) { + type_ = + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.newBuilder( + (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_) + .mergeFrom(value) + .buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 12) { + merchantReviewDataSourceBuilder_.mergeFrom(value); + } else { + merchantReviewDataSourceBuilder_.setMessage(value); + } + } + typeCase_ = 12; + return this; + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + public Builder clearMerchantReviewDataSource() { + if (merchantReviewDataSourceBuilder_ == null) { + if (typeCase_ == 12) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 12) { + typeCase_ = 0; + type_ = null; + } + merchantReviewDataSourceBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder + getMerchantReviewDataSourceBuilder() { + return getMerchantReviewDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder + getMerchantReviewDataSourceOrBuilder() { + if ((typeCase_ == 12) && (merchantReviewDataSourceBuilder_ != null)) { + return merchantReviewDataSourceBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 12) { + return (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_; + } + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + } + + /** + * + * + *
+     * The [merchant
+     * review](https://support.google.com/merchants/answer/7045996)
+     * data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder> + getMerchantReviewDataSourceFieldBuilder() { + if (merchantReviewDataSourceBuilder_ == null) { + if (!(typeCase_ == 12)) { + type_ = + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + merchantReviewDataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder>( + (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 12; + onChanged(); + return merchantReviewDataSourceBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Identifier. The name of the data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+     * Required. Identifier. The name of the data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + + /** + * + * + *
+     * Required. Identifier. The name of the data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Identifier. The name of the data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Identifier. The name of the data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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_ |= 0x00000080; + onChanged(); + return this; + } + + private long dataSourceId_; + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + @java.lang.Override + public long getDataSourceId() { + return dataSourceId_; + } + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dataSourceId to set. + * @return This builder for chaining. + */ + public Builder setDataSourceId(long value) { + + dataSourceId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDataSourceId() { + bitField0_ = (bitField0_ & ~0x00000100); + dataSourceId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * Required. The displayed data source name in the Merchant Center UI.
+     * 
+ * + * 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. The displayed data source name in the Merchant Center UI.
+     * 
+ * + * 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. The displayed data source name in the Merchant Center UI.
+     * 
+ * + * 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_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The displayed data source name in the Merchant Center UI.
+     * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The displayed data source name in the Merchant Center UI.
+     * 
+ * + * 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_ |= 0x00000200; + onChanged(); + return this; + } + + private int input_ = 0; + + /** + * + * + *
+     * Output only. Determines the type of input to the data source. Based on the
+     * input some settings might not work. Only generic data sources can be
+     * created through the API.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for input. + */ + @java.lang.Override + public int getInputValue() { + return input_; + } + + /** + * + * + *
+     * Output only. Determines the type of input to the data source. Based on the
+     * input some settings might not work. Only generic data sources can be
+     * created through the API.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for input to set. + * @return This builder for chaining. + */ + public Builder setInputValue(int value) { + input_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Determines the type of input to the data source. Based on the
+     * input some settings might not work. Only generic data sources can be
+     * created through the API.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The input. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource.Input getInput() { + com.google.shopping.merchant.datasources.v1.DataSource.Input result = + com.google.shopping.merchant.datasources.v1.DataSource.Input.forNumber(input_); + return result == null + ? com.google.shopping.merchant.datasources.v1.DataSource.Input.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. Determines the type of input to the data source. Based on the
+     * input some settings might not work. Only generic data sources can be
+     * created through the API.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The input to set. + * @return This builder for chaining. + */ + public Builder setInput(com.google.shopping.merchant.datasources.v1.DataSource.Input value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + input_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Determines the type of input to the data source. Based on the
+     * input some settings might not work. Only generic data sources can be
+     * created through the API.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearInput() { + bitField0_ = (bitField0_ & ~0x00000400); + input_ = 0; + onChanged(); + return this; + } + + private com.google.shopping.merchant.datasources.v1.FileInput fileInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput, + com.google.shopping.merchant.datasources.v1.FileInput.Builder, + com.google.shopping.merchant.datasources.v1.FileInputOrBuilder> + fileInputBuilder_; + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileInput field is set. + */ + public boolean hasFileInput() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileInput. + */ + public com.google.shopping.merchant.datasources.v1.FileInput getFileInput() { + if (fileInputBuilder_ == null) { + return fileInput_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance() + : fileInput_; + } else { + return fileInputBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFileInput(com.google.shopping.merchant.datasources.v1.FileInput value) { + if (fileInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fileInput_ = value; + } else { + fileInputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFileInput( + com.google.shopping.merchant.datasources.v1.FileInput.Builder builderForValue) { + if (fileInputBuilder_ == null) { + fileInput_ = builderForValue.build(); + } else { + fileInputBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFileInput(com.google.shopping.merchant.datasources.v1.FileInput value) { + if (fileInputBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && fileInput_ != null + && fileInput_ + != com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance()) { + getFileInputBuilder().mergeFrom(value); + } else { + fileInput_ = value; + } + } else { + fileInputBuilder_.mergeFrom(value); + } + if (fileInput_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFileInput() { + bitField0_ = (bitField0_ & ~0x00000800); + fileInput_ = null; + if (fileInputBuilder_ != null) { + fileInputBuilder_.dispose(); + fileInputBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileInput.Builder getFileInputBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getFileInputFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileInputOrBuilder getFileInputOrBuilder() { + if (fileInputBuilder_ != null) { + return fileInputBuilder_.getMessageOrBuilder(); + } else { + return fileInput_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance() + : fileInput_; + } + } + + /** + * + * + *
+     * Optional. The field is used only when data is managed through a file.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput, + com.google.shopping.merchant.datasources.v1.FileInput.Builder, + com.google.shopping.merchant.datasources.v1.FileInputOrBuilder> + getFileInputFieldBuilder() { + if (fileInputBuilder_ == null) { + fileInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput, + com.google.shopping.merchant.datasources.v1.FileInput.Builder, + com.google.shopping.merchant.datasources.v1.FileInputOrBuilder>( + getFileInput(), getParentForChildren(), isClean()); + fileInput_ = null; + } + return fileInputBuilder_; + } + + @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.datasources.v1.DataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.DataSource) + private static final com.google.shopping.merchant.datasources.v1.DataSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.DataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.DataSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataSource 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.datasources.v1.DataSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceName.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceName.java new file mode 100644 index 000000000000..41b0bc1b6df8 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceName.java @@ -0,0 +1,192 @@ +/* + * 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.datasources.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 DataSourceName implements ResourceName { + private static final PathTemplate ACCOUNT_DATASOURCE = + PathTemplate.createWithoutUrlEncoding("accounts/{account}/dataSources/{datasource}"); + private volatile Map fieldValuesMap; + private final String account; + private final String datasource; + + @Deprecated + protected DataSourceName() { + account = null; + datasource = null; + } + + private DataSourceName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + datasource = Preconditions.checkNotNull(builder.getDatasource()); + } + + public String getAccount() { + return account; + } + + public String getDatasource() { + return datasource; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static DataSourceName of(String account, String datasource) { + return newBuilder().setAccount(account).setDatasource(datasource).build(); + } + + public static String format(String account, String datasource) { + return newBuilder().setAccount(account).setDatasource(datasource).build().toString(); + } + + public static DataSourceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_DATASOURCE.validatedMatch( + formattedString, "DataSourceName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("datasource")); + } + + 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 (DataSourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_DATASOURCE.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 (datasource != null) { + fieldMapBuilder.put("datasource", datasource); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_DATASOURCE.instantiate("account", account, "datasource", datasource); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + DataSourceName that = ((DataSourceName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.datasource, that.datasource); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(datasource); + return h; + } + + /** Builder for accounts/{account}/dataSources/{datasource}. */ + public static class Builder { + private String account; + private String datasource; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getDatasource() { + return datasource; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setDatasource(String datasource) { + this.datasource = datasource; + return this; + } + + private Builder(DataSourceName dataSourceName) { + this.account = dataSourceName.account; + this.datasource = dataSourceName.datasource; + } + + public DataSourceName build() { + return new DataSourceName(this); + } + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceOrBuilder.java new file mode 100644 index 000000000000..c71456423aab --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceOrBuilder.java @@ -0,0 +1,527 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface DataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.DataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return Whether the primaryProductDataSource field is set. + */ + boolean hasPrimaryProductDataSource(); + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + * + * @return The primaryProductDataSource. + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + getPrimaryProductDataSource(); + + /** + * + * + *
+   * The [primary data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource primary_product_data_source = 4; + * + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder + getPrimaryProductDataSourceOrBuilder(); + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return Whether the supplementalProductDataSource field is set. + */ + boolean hasSupplementalProductDataSource(); + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + * + * @return The supplementalProductDataSource. + */ + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + getSupplementalProductDataSource(); + + /** + * + * + *
+   * The [supplemental data
+   * source](https://support.google.com/merchants/answer/7439058) for local
+   * and online products.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.SupplementalProductDataSource supplemental_product_data_source = 5; + * + */ + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder + getSupplementalProductDataSourceOrBuilder(); + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return Whether the localInventoryDataSource field is set. + */ + boolean hasLocalInventoryDataSource(); + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + * + * @return The localInventoryDataSource. + */ + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + getLocalInventoryDataSource(); + + /** + * + * + *
+   * The [local
+   * inventory](https://support.google.com/merchants/answer/7023001) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.LocalInventoryDataSource local_inventory_data_source = 6; + * + */ + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder + getLocalInventoryDataSourceOrBuilder(); + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return Whether the regionalInventoryDataSource field is set. + */ + boolean hasRegionalInventoryDataSource(); + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + * + * @return The regionalInventoryDataSource. + */ + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + getRegionalInventoryDataSource(); + + /** + * + * + *
+   * The [regional
+   * inventory](https://support.google.com/merchants/answer/7439058) data
+   * source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.RegionalInventoryDataSource regional_inventory_data_source = 7; + * + */ + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder + getRegionalInventoryDataSourceOrBuilder(); + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return Whether the promotionDataSource field is set. + */ + boolean hasPromotionDataSource(); + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + * + * @return The promotionDataSource. + */ + com.google.shopping.merchant.datasources.v1.PromotionDataSource getPromotionDataSource(); + + /** + * + * + *
+   * The [promotion](https://support.google.com/merchants/answer/2906014)
+   * data source.
+   * 
+ * + * .google.shopping.merchant.datasources.v1.PromotionDataSource promotion_data_source = 8; + * + */ + com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder + getPromotionDataSourceOrBuilder(); + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return Whether the productReviewDataSource field is set. + */ + boolean hasProductReviewDataSource(); + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + * + * @return The productReviewDataSource. + */ + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource getProductReviewDataSource(); + + /** + * + * + *
+   * The [product
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.ProductReviewDataSource product_review_data_source = 9; + * + */ + com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder + getProductReviewDataSourceOrBuilder(); + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return Whether the merchantReviewDataSource field is set. + */ + boolean hasMerchantReviewDataSource(); + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + * + * @return The merchantReviewDataSource. + */ + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + getMerchantReviewDataSource(); + + /** + * + * + *
+   * The [merchant
+   * review](https://support.google.com/merchants/answer/7045996)
+   * data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.MerchantReviewDataSource merchant_review_data_source = 12; + * + */ + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder + getMerchantReviewDataSourceOrBuilder(); + + /** + * + * + *
+   * Required. Identifier. The name of the data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Identifier. The name of the data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The data source id.
+   * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + long getDataSourceId(); + + /** + * + * + *
+   * Required. The displayed data source name in the Merchant Center UI.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * Required. The displayed data source name in the Merchant Center UI.
+   * 
+ * + * string display_name = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Determines the type of input to the data source. Based on the
+   * input some settings might not work. Only generic data sources can be
+   * created through the API.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for input. + */ + int getInputValue(); + + /** + * + * + *
+   * Output only. Determines the type of input to the data source. Based on the
+   * input some settings might not work. Only generic data sources can be
+   * created through the API.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource.Input input = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The input. + */ + com.google.shopping.merchant.datasources.v1.DataSource.Input getInput(); + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fileInput field is set. + */ + boolean hasFileInput(); + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fileInput. + */ + com.google.shopping.merchant.datasources.v1.FileInput getFileInput(); + + /** + * + * + *
+   * Optional. The field is used only when data is managed through a file.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput file_input = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.shopping.merchant.datasources.v1.FileInputOrBuilder getFileInputOrBuilder(); + + com.google.shopping.merchant.datasources.v1.DataSource.TypeCase getTypeCase(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReference.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReference.java new file mode 100644 index 000000000000..b1a13b943f52 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReference.java @@ -0,0 +1,1205 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Data source reference can be used to manage related data sources within the
+ * data source service.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DataSourceReference} + */ +public final class DataSourceReference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.DataSourceReference) + DataSourceReferenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DataSourceReference.newBuilder() to construct. + private DataSourceReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataSourceReference() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataSourceReference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DataSourceReference.class, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder.class); + } + + private int dataSourceIdCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object dataSourceId_; + + public enum DataSourceIdCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SELF(1), + PRIMARY_DATA_SOURCE_NAME(3), + SUPPLEMENTAL_DATA_SOURCE_NAME(2), + DATASOURCEID_NOT_SET(0); + private final int value; + + private DataSourceIdCase(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 DataSourceIdCase valueOf(int value) { + return forNumber(value); + } + + public static DataSourceIdCase forNumber(int value) { + switch (value) { + case 1: + return SELF; + case 3: + return PRIMARY_DATA_SOURCE_NAME; + case 2: + return SUPPLEMENTAL_DATA_SOURCE_NAME; + case 0: + return DATASOURCEID_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataSourceIdCase getDataSourceIdCase() { + return DataSourceIdCase.forNumber(dataSourceIdCase_); + } + + public static final int SELF_FIELD_NUMBER = 1; + + /** + * + * + *
+   * Self should be used to reference the primary data source itself.
+   * 
+ * + * bool self = 1; + * + * @return Whether the self field is set. + */ + @java.lang.Override + public boolean hasSelf() { + return dataSourceIdCase_ == 1; + } + + /** + * + * + *
+   * Self should be used to reference the primary data source itself.
+   * 
+ * + * bool self = 1; + * + * @return The self. + */ + @java.lang.Override + public boolean getSelf() { + if (dataSourceIdCase_ == 1) { + return (java.lang.Boolean) dataSourceId_; + } + return false; + } + + public static final int PRIMARY_DATA_SOURCE_NAME_FIELD_NUMBER = 3; + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the primaryDataSourceName field is set. + */ + public boolean hasPrimaryDataSourceName() { + return dataSourceIdCase_ == 3; + } + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryDataSourceName. + */ + public java.lang.String getPrimaryDataSourceName() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 3) { + ref = dataSourceId_; + } + 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(); + if (dataSourceIdCase_ == 3) { + dataSourceId_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryDataSourceName. + */ + public com.google.protobuf.ByteString getPrimaryDataSourceNameBytes() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 3) { + ref = dataSourceId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceIdCase_ == 3) { + dataSourceId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUPPLEMENTAL_DATA_SOURCE_NAME_FIELD_NUMBER = 2; + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the supplementalDataSourceName field is set. + */ + public boolean hasSupplementalDataSourceName() { + return dataSourceIdCase_ == 2; + } + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The supplementalDataSourceName. + */ + public java.lang.String getSupplementalDataSourceName() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 2) { + ref = dataSourceId_; + } + 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(); + if (dataSourceIdCase_ == 2) { + dataSourceId_ = s; + } + return s; + } + } + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for supplementalDataSourceName. + */ + public com.google.protobuf.ByteString getSupplementalDataSourceNameBytes() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 2) { + ref = dataSourceId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceIdCase_ == 2) { + dataSourceId_ = 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 (dataSourceIdCase_ == 1) { + output.writeBool(1, (boolean) ((java.lang.Boolean) dataSourceId_)); + } + if (dataSourceIdCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, dataSourceId_); + } + if (dataSourceIdCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dataSourceId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (dataSourceIdCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 1, (boolean) ((java.lang.Boolean) dataSourceId_)); + } + if (dataSourceIdCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, dataSourceId_); + } + if (dataSourceIdCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dataSourceId_); + } + 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.datasources.v1.DataSourceReference)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.DataSourceReference other = + (com.google.shopping.merchant.datasources.v1.DataSourceReference) obj; + + if (!getDataSourceIdCase().equals(other.getDataSourceIdCase())) return false; + switch (dataSourceIdCase_) { + case 1: + if (getSelf() != other.getSelf()) return false; + break; + case 3: + if (!getPrimaryDataSourceName().equals(other.getPrimaryDataSourceName())) return false; + break; + case 2: + if (!getSupplementalDataSourceName().equals(other.getSupplementalDataSourceName())) + 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(); + switch (dataSourceIdCase_) { + case 1: + hash = (37 * hash) + SELF_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSelf()); + break; + case 3: + hash = (37 * hash) + PRIMARY_DATA_SOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPrimaryDataSourceName().hashCode(); + break; + case 2: + hash = (37 * hash) + SUPPLEMENTAL_DATA_SOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSupplementalDataSourceName().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference 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.datasources.v1.DataSourceReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference 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.datasources.v1.DataSourceReference parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference 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.datasources.v1.DataSourceReference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference 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.datasources.v1.DataSourceReference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference 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.datasources.v1.DataSourceReference 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; + } + + /** + * + * + *
+   * Data source reference can be used to manage related data sources within the
+   * data source service.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DataSourceReference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.DataSourceReference) + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DataSourceReference.class, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.DataSourceReference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataSourceIdCase_ = 0; + dataSourceId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReference + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.DataSourceReference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReference build() { + com.google.shopping.merchant.datasources.v1.DataSourceReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReference buildPartial() { + com.google.shopping.merchant.datasources.v1.DataSourceReference result = + new com.google.shopping.merchant.datasources.v1.DataSourceReference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.DataSourceReference result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.shopping.merchant.datasources.v1.DataSourceReference result) { + result.dataSourceIdCase_ = dataSourceIdCase_; + result.dataSourceId_ = this.dataSourceId_; + } + + @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.datasources.v1.DataSourceReference) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.DataSourceReference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.DataSourceReference other) { + if (other + == com.google.shopping.merchant.datasources.v1.DataSourceReference.getDefaultInstance()) + return this; + switch (other.getDataSourceIdCase()) { + case SELF: + { + setSelf(other.getSelf()); + break; + } + case PRIMARY_DATA_SOURCE_NAME: + { + dataSourceIdCase_ = 3; + dataSourceId_ = other.dataSourceId_; + onChanged(); + break; + } + case SUPPLEMENTAL_DATA_SOURCE_NAME: + { + dataSourceIdCase_ = 2; + dataSourceId_ = other.dataSourceId_; + onChanged(); + break; + } + case DATASOURCEID_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 8: + { + dataSourceId_ = input.readBool(); + dataSourceIdCase_ = 1; + break; + } // case 8 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceIdCase_ = 2; + dataSourceId_ = s; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + dataSourceIdCase_ = 3; + dataSourceId_ = s; + 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 dataSourceIdCase_ = 0; + private java.lang.Object dataSourceId_; + + public DataSourceIdCase getDataSourceIdCase() { + return DataSourceIdCase.forNumber(dataSourceIdCase_); + } + + public Builder clearDataSourceId() { + dataSourceIdCase_ = 0; + dataSourceId_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Self should be used to reference the primary data source itself.
+     * 
+ * + * bool self = 1; + * + * @return Whether the self field is set. + */ + public boolean hasSelf() { + return dataSourceIdCase_ == 1; + } + + /** + * + * + *
+     * Self should be used to reference the primary data source itself.
+     * 
+ * + * bool self = 1; + * + * @return The self. + */ + public boolean getSelf() { + if (dataSourceIdCase_ == 1) { + return (java.lang.Boolean) dataSourceId_; + } + return false; + } + + /** + * + * + *
+     * Self should be used to reference the primary data source itself.
+     * 
+ * + * bool self = 1; + * + * @param value The self to set. + * @return This builder for chaining. + */ + public Builder setSelf(boolean value) { + + dataSourceIdCase_ = 1; + dataSourceId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Self should be used to reference the primary data source itself.
+     * 
+ * + * bool self = 1; + * + * @return This builder for chaining. + */ + public Builder clearSelf() { + if (dataSourceIdCase_ == 1) { + dataSourceIdCase_ = 0; + dataSourceId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the primaryDataSourceName field is set. + */ + @java.lang.Override + public boolean hasPrimaryDataSourceName() { + return dataSourceIdCase_ == 3; + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryDataSourceName. + */ + @java.lang.Override + public java.lang.String getPrimaryDataSourceName() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 3) { + ref = dataSourceId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceIdCase_ == 3) { + dataSourceId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryDataSourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrimaryDataSourceNameBytes() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 3) { + ref = dataSourceId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceIdCase_ == 3) { + dataSourceId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The primaryDataSourceName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryDataSourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataSourceIdCase_ = 3; + dataSourceId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrimaryDataSourceName() { + if (dataSourceIdCase_ == 3) { + dataSourceIdCase_ = 0; + dataSourceId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The name of the primary data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for primaryDataSourceName to set. + * @return This builder for chaining. + */ + public Builder setPrimaryDataSourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataSourceIdCase_ = 3; + dataSourceId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the supplementalDataSourceName field is set. + */ + @java.lang.Override + public boolean hasSupplementalDataSourceName() { + return dataSourceIdCase_ == 2; + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The supplementalDataSourceName. + */ + @java.lang.Override + public java.lang.String getSupplementalDataSourceName() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 2) { + ref = dataSourceId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (dataSourceIdCase_ == 2) { + dataSourceId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for supplementalDataSourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSupplementalDataSourceNameBytes() { + java.lang.Object ref = ""; + if (dataSourceIdCase_ == 2) { + ref = dataSourceId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (dataSourceIdCase_ == 2) { + dataSourceId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The supplementalDataSourceName to set. + * @return This builder for chaining. + */ + public Builder setSupplementalDataSourceName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + dataSourceIdCase_ = 2; + dataSourceId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSupplementalDataSourceName() { + if (dataSourceIdCase_ == 2) { + dataSourceIdCase_ = 0; + dataSourceId_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The name of the supplemental data source.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for supplementalDataSourceName to set. + * @return This builder for chaining. + */ + public Builder setSupplementalDataSourceNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + dataSourceIdCase_ = 2; + dataSourceId_ = value; + 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.datasources.v1.DataSourceReference) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.DataSourceReference) + private static final com.google.shopping.merchant.datasources.v1.DataSourceReference + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.DataSourceReference(); + } + + public static com.google.shopping.merchant.datasources.v1.DataSourceReference + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataSourceReference 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.datasources.v1.DataSourceReference + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReferenceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReferenceOrBuilder.java new file mode 100644 index 000000000000..e6dd58dd6fd3 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourceReferenceOrBuilder.java @@ -0,0 +1,148 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface DataSourceReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.DataSourceReference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Self should be used to reference the primary data source itself.
+   * 
+ * + * bool self = 1; + * + * @return Whether the self field is set. + */ + boolean hasSelf(); + + /** + * + * + *
+   * Self should be used to reference the primary data source itself.
+   * 
+ * + * bool self = 1; + * + * @return The self. + */ + boolean getSelf(); + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the primaryDataSourceName field is set. + */ + boolean hasPrimaryDataSourceName(); + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The primaryDataSourceName. + */ + java.lang.String getPrimaryDataSourceName(); + + /** + * + * + *
+   * Optional. The name of the primary data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for primaryDataSourceName. + */ + com.google.protobuf.ByteString getPrimaryDataSourceNameBytes(); + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the supplementalDataSourceName field is set. + */ + boolean hasSupplementalDataSourceName(); + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The supplementalDataSourceName. + */ + java.lang.String getSupplementalDataSourceName(); + + /** + * + * + *
+   * Optional. The name of the supplemental data source.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for supplementalDataSourceName. + */ + com.google.protobuf.ByteString getSupplementalDataSourceNameBytes(); + + com.google.shopping.merchant.datasources.v1.DataSourceReference.DataSourceIdCase + getDataSourceIdCase(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesProto.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesProto.java new file mode 100644 index 000000000000..e454d4d7e608 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DataSourcesProto.java @@ -0,0 +1,286 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public final class DataSourcesProto { + private DataSourcesProto() {} + + 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_datasources_v1_DataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_DataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_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" + + "9google/shopping/merchant/datasources/v1/datasources.proto\022\'google.shopping.mer" + + "chant.datasources.v1\032\034google/api/annotat" + + "ions.proto\032\027google/api/client.proto\032\037goo" + + "gle/api/field_behavior.proto\032\031google/api" + + "/resource.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032=google/shopping/merchant/datasources/v1/" + + "datasourcetypes.proto\0328google/shopping/m" + + "erchant/datasources/v1/fileinputs.proto\"\242\t\n\n" + + "DataSource\022h\n" + + "\033primary_product_data_source\030\004 \001(\0132A.google.shopping.merchant.d" + + "atasources.v1.PrimaryProductDataSourceH\000\022r\n" + + " supplemental_product_data_source\030\005 \001" + + "(\0132F.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceH\000\022h\n" + + "\033local_inventory_data_source\030\006 \001(\0132A.goog" + + "le.shopping.merchant.datasources.v1.LocalInventoryDataSourceH\000\022n\n" + + "\036regional_inventory_data_source\030\007 \001(\0132D.google.shopping" + + ".merchant.datasources.v1.RegionalInventoryDataSourceH\000\022]\n" + + "\025promotion_data_source\030\010" + + " \001(\0132<.google.shopping.merchant.datasources.v1.PromotionDataSourceH\000\022f\n" + + "\032product_review_data_source\030\t \001(\0132@.google.shopp" + + "ing.merchant.datasources.v1.ProductReviewDataSourceH\000\022h\n" + + "\033merchant_review_data_source\030\014 \001(\0132A.google.shopping.merchant.da" + + "tasources.v1.MerchantReviewDataSourceH\000\022\024\n" + + "\004name\030\001 \001(\tB\006\340A\002\340A\010\022\033\n" + + "\016data_source_id\030\002 \001(\003B\003\340A\003\022\031\n" + + "\014display_name\030\003 \001(\tB\003\340A\002\022M\n" + + "\005input\030\n" + + " \001(\01629.google.shopping.merchant.datasources.v1.DataSource.InputB\003\340A\003\022K\n\n" + + "file_input\030\013" + + " \001(\01322.google.shopping.merchant.datasources.v1.FileInputB\003\340A\001\"G\n" + + "\005Input\022\025\n" + + "\021INPUT_UNSPECIFIED\020\000\022\007\n" + + "\003API\020\001\022\010\n" + + "\004FILE\020\002\022\006\n" + + "\002UI\020\003\022\014\n" + + "\010AUTOFEED\020\004:p\352Am\n" + + "%merchantapi.googleapis.com/DataSource\022+accounts" + + "/{account}/dataSources/{datasource}*\013dataSources2\n" + + "dataSourceB\006\n" + + "\004Type\"S\n" + + "\024GetDataSourceRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%merchantapi.googleapis.com/DataSource\"\210\001\n" + + "\026ListDataSourcesRequest\022=\n" + + "\006parent\030\001 \001(\tB-\340A" + + "\002\372A\'\022%merchantapi.googleapis.com/DataSource\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\"}\n" + + "\027ListDataSourcesResponse\022I\n" + + "\014data_sources\030\001" + + " \003(\01323.google.shopping.merchant.datasources.v1.DataSource\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\247\001\n" + + "\027CreateDataSourceRequest\022=\n" + + "\006parent\030\001 \001(" + + "\tB-\340A\002\372A\'\022%merchantapi.googleapis.com/DataSource\022M\n" + + "\013data_source\030\002" + + " \001(\01323.google.shopping.merchant.datasources.v1.DataSourceB\003\340A\002\"\236\001\n" + + "\027UpdateDataSourceRequest\022M\n" + + "\013data_source\030\001 \001(\01323" + + ".google.shopping.merchant.datasources.v1.DataSourceB\003\340A\002\0224\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"U\n" + + "\026FetchDataSourceRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%merchantapi.googleapis.com/DataSource\"V\n" + + "\027DeleteDataSourceRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%merchantapi.googleapis.com/DataSource2\271\n\n" + + "\022DataSourcesService\022\303\001\n\r" + + "GetDataSource\022=.google.shopping.merchant.dataso" + + "urces.v1.GetDataSourceRequest\0323.google.shopping.merchant.datasources.v1.DataSour" + + "ce\">\332A\004name\202\323\344\223\0021\022//datasources/v1/{name=accounts/*/dataSources/*}\022\326\001\n" + + "\017ListDataSources\022?.google.shopping.merchant.dataso" + + "urces.v1.ListDataSourcesRequest\032@.google.shopping.merchant.datasources.v1.ListDa" + + "taSourcesResponse\"@\332A\006parent\202\323\344\223\0021\022//dat" + + "asources/v1/{parent=accounts/*}/dataSources\022\344\001\n" + + "\020CreateDataSource\022@.google.shopping.merchant.datasources.v1.CreateDataSou" + + "rceRequest\0323.google.shopping.merchant.da" + + "tasources.v1.DataSource\"Y\332A\022parent,data_" + + "source\202\323\344\223\002>\"//datasources/v1/{parent=accounts/*}/dataSources:\013data_source\022\365\001\n" + + "\020UpdateDataSource\022@.google.shopping.mercha" + + "nt.datasources.v1.UpdateDataSourceRequest\0323.google.shopping.merchant.datasources" + + ".v1.DataSource\"j\332A\027data_source,update_ma" + + "sk\202\323\344\223\002J2;/datasources/v1/{data_source.n" + + "ame=accounts/*/dataSources/*}:\013data_source\022\254\001\n" + + "\020DeleteDataSource\022@.google.shopping.merchant.datasources.v1.DeleteDataSour" + + "ceRequest\032\026.google.protobuf.Empty\">\332A\004na" + + "me\202\323\344\223\0021*//datasources/v1/{name=accounts/*/dataSources/*}\022\254\001\n" + + "\017FetchDataSource\022?.google.shopping.merchant.datasources.v1." + + "FetchDataSourceRequest\032\026.google.protobuf" + + ".Empty\"@\202\323\344\223\002:\"5/datasources/v1/{name=ac" + + "counts/*/dataSources/*}:fetch:\001*\032G\312A\032mer" + + "chantapi.googleapis.com\322A\'https://www.googleapis.com/auth/contentB\252\003\n" + + "+com.google.shopping.merchant.datasources.v1B\020DataS" + + "ourcesProtoP\001ZScloud.google.com/go/shopping/merchant/datasources/apiv1/datasourc" + + "espb;datasourcespb\252\002\'Google.Shopping.Mer" + + "chant.DataSources.V1\312\002\'Google\\Shopping\\M" + + "erchant\\DataSources\\V1\352\002+Google::Shopping::Merchant::DataSources::V1\352A8\n" + + "\"merchantapi.googleapis.com/Account\022\022accounts/{account}\352AT\n" + + "%merchantapi.googleapis.com/Datasource\022+accounts/{account}/dataSource" + + "s/{datasource}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.shopping.merchant.datasources.v1.DatasourcetypesProto.getDescriptor(), + com.google.shopping.merchant.datasources.v1.FileInputsProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_datasources_v1_DataSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_datasources_v1_DataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_DataSource_descriptor, + new java.lang.String[] { + "PrimaryProductDataSource", + "SupplementalProductDataSource", + "LocalInventoryDataSource", + "RegionalInventoryDataSource", + "PromotionDataSource", + "ProductReviewDataSource", + "MerchantReviewDataSource", + "Name", + "DataSourceId", + "DisplayName", + "Input", + "FileInput", + "Type", + }); + internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor, + new java.lang.String[] { + "DataSources", "NextPageToken", + }); + internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_CreateDataSourceRequest_descriptor, + new java.lang.String[] { + "Parent", "DataSource", + }); + internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor, + new java.lang.String[] { + "DataSource", "UpdateMask", + }); + internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + 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.shopping.merchant.datasources.v1.DatasourcetypesProto.getDescriptor(); + com.google.shopping.merchant.datasources.v1.FileInputsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DatasourcetypesProto.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DatasourcetypesProto.java new file mode 100644 index 000000000000..74f8854d6372 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DatasourcetypesProto.java @@ -0,0 +1,241 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public final class DatasourcetypesProto { + private DatasourcetypesProto() {} + + 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_datasources_v1_PrimaryProductDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_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/datasources/v1/datasourcetypes.proto\022\'google.shopping" + + ".merchant.datasources.v1\032\037google/api/field_behavior.proto\032" + + " google/shopping/type/types.proto\"\235\006\n" + + "\030PrimaryProductDataSource\022\034\n" + + "\014legacy_local\030\013 \001(\010B\006\340A\001\340A\005\022\037\n\n" + + "feed_label\030\004 \001(\tB\006\340A\001\340A\005H\000\210\001\001\022%\n" + + "\020content_language\030\005 \001(\tB\006\340A\001\340A\005H\001\210\001\001\022\026\n" + + "\tcountries\030\006 \003(\tB\003\340A\001\022h\n" + + "\014default_rule\030\007 \001(\0132M.google.sh" + + "opping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleB\003\340A\001\022\"\n" + + "\025contains_custom_rules\030\t \001(\010B\003\340A\003\022h\n" + + "\014destinations\030\n" + + " \003(\0132M.google.shopping.merchant.da" + + "tasources.v1.PrimaryProductDataSource.DestinationB\003\340A\001\032p\n" + + "\013DefaultRule\022a\n" + + "\026take_from_data_sources\030\001 \003(\0132<.google.shopping." + + "merchant.datasources.v1.DataSourceReferenceB\003\340A\002\032\364\001\n" + + "\013Destination\022F\n" + + "\013destination\030\001" + + " \001(\01621.google.shopping.type.Destination.DestinationEnum\022b\n" + + "\005state\030\002 \001(\0162S.google" + + ".shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State\"9\n" + + "\005State\022\025\n" + + "\021STATE_UNSPECIFIED\020\000\022\013\n" + + "\007ENABLED\020\001\022\014\n" + + "\010DISABLED\020\002B\r\n" + + "\013_feed_labelB\023\n" + + "\021_content_language\"\370\001\n" + + "\035SupplementalProductDataSource\022\037\n\n" + + "feed_label\030\004 \001(\tB\006\340A\001\340A\005H\000\210\001\001\022%\n" + + "\020content_language\030\005 \001(\tB\006\340A\001\340A\005H\001\210\001\001\022k\n" + + " referencing_primary_data_sources\030\007 \003(\0132" + + "<.google.shopping.merchant.datasources.v1.DataSourceReferenceB\003\340A\003B\r\n" + + "\013_feed_labelB\023\n" + + "\021_content_language\"X\n" + + "\030LocalInventoryDataSource\022\032\n\n" + + "feed_label\030\004 \001(\tB\006\340A\002\340A\005\022 \n" + + "\020content_language\030\005 \001(\tB\006\340A\002\340A\005\"[\n" + + "\033RegionalInventoryDataSource\022\032\n\n" + + "feed_label\030\004 \001(\tB\006\340A\002\340A\005\022 \n" + + "\020content_language\030\005 \001(\tB\006\340A\002\340A\005\"W\n" + + "\023PromotionDataSource\022\036\n" + + "\016target_country\030\001 \001(\tB\006\340A\002\340A\005\022 \n" + + "\020content_language\030\002 \001(\tB\006\340A\002\340A\005\"\031\n" + + "\027ProductReviewDataSource\"\032\n" + + "\030MerchantReviewDataSource\"\216\001\n" + + "\023DataSourceReference\022\016\n" + + "\004self\030\001 \001(\010H\000\022\'\n" + + "\030primary_data_source_name\030\003 \001(\tB\003\340A\001H\000\022,\n" + + "\035supplemental_data_source_name\030\002 \001(\tB\003\340A\001H\000B\020\n" + + "\016data_source_idB\234\002\n" + + "+com.google.shopping.merchant.datasources.v1B\024DatasourcetypesP" + + "rotoP\001ZScloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;da" + + "tasourcespb\252\002\'Google.Shopping.Merchant.D" + + "ataSources.V1\312\002\'Google\\Shopping\\Merchant" + + "\\DataSources\\V1\352\002+Google::Shopping::Merchant::DataSources::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor, + new java.lang.String[] { + "LegacyLocal", + "FeedLabel", + "ContentLanguage", + "Countries", + "DefaultRule", + "ContainsCustomRules", + "Destinations", + }); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor = + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor + .getNestedTypes() + .get(0); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor, + new java.lang.String[] { + "TakeFromDataSources", + }); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor = + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor + .getNestedTypes() + .get(1); + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor, + new java.lang.String[] { + "Destination", "State", + }); + internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor, + new java.lang.String[] { + "FeedLabel", "ContentLanguage", "ReferencingPrimaryDataSources", + }); + internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor, + new java.lang.String[] { + "FeedLabel", "ContentLanguage", + }); + internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor, + new java.lang.String[] { + "FeedLabel", "ContentLanguage", + }); + internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor, + new java.lang.String[] { + "TargetCountry", "ContentLanguage", + }); + internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor, + new java.lang.String[] {}); + internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor, + new java.lang.String[] {}); + internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_DataSourceReference_descriptor, + new java.lang.String[] { + "Self", "PrimaryDataSourceName", "SupplementalDataSourceName", "DataSourceId", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequest.java new file mode 100644 index 000000000000..115f9798e18f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequest.java @@ -0,0 +1,667 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the DeleteDataSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DeleteDataSourceRequest} + */ +public final class DeleteDataSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) + DeleteDataSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteDataSourceRequest.newBuilder() to construct. + private DeleteDataSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDataSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDataSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the data source to delete.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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 data source to delete.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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.datasources.v1.DeleteDataSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest other = + (com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) 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.datasources.v1.DeleteDataSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + 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.datasources.v1.DeleteDataSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest 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 DeleteDataSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.DeleteDataSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest.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.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_DeleteDataSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest build() { + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest result = + new com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + .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 data source to delete.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to delete.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to delete.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to delete.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to delete.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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.datasources.v1.DeleteDataSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) + private static final com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDataSourceRequest 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.datasources.v1.DeleteDataSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequestOrBuilder.java new file mode 100644 index 000000000000..e1621983c701 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/DeleteDataSourceRequestOrBuilder.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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface DeleteDataSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.DeleteDataSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the data source to delete.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the data source to delete.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequest.java new file mode 100644 index 000000000000..6475abf8b354 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequest.java @@ -0,0 +1,667 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the FetchDataSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FetchDataSourceRequest} + */ +public final class FetchDataSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.FetchDataSourceRequest) + FetchDataSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FetchDataSourceRequest.newBuilder() to construct. + private FetchDataSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchDataSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchDataSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the data source resource to fetch.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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 data source resource to fetch.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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.datasources.v1.FetchDataSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest other = + (com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest) 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.datasources.v1.FetchDataSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + 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.datasources.v1.FetchDataSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest 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 FetchDataSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FetchDataSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.FetchDataSourceRequest) + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest.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.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_FetchDataSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest build() { + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest result = + new com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + .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 data source resource to fetch.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source resource to fetch.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source resource to fetch.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source resource to fetch.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source resource to fetch.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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.datasources.v1.FetchDataSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.FetchDataSourceRequest) + private static final com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchDataSourceRequest 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.datasources.v1.FetchDataSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequestOrBuilder.java new file mode 100644 index 000000000000..d5a17f6df4d1 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FetchDataSourceRequestOrBuilder.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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface FetchDataSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.FetchDataSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the data source resource to fetch.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the data source resource to fetch.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInput.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInput.java new file mode 100644 index 000000000000..e9893a05deb4 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInput.java @@ -0,0 +1,3962 @@ +/* + * 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/datasources/v1/fileinputs.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The data specific for file data sources. This field is empty for other
+ * data source inputs.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileInput} + */ +public final class FileInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.FileInput) + FileInputOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FileInput.newBuilder() to construct. + private FileInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileInput() { + fileName_ = ""; + fileInputType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileInput(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileInput.class, + com.google.shopping.merchant.datasources.v1.FileInput.Builder.class); + } + + /** + * + * + *
+   * The method of file delivery.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.datasources.v1.FileInput.FileInputType} + */ + public enum FileInputType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * File input type unspecified.
+     * 
+ * + * FILE_INPUT_TYPE_UNSPECIFIED = 0; + */ + FILE_INPUT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The file is uploaded through SFTP, Google Cloud Storage or manually in
+     * the Merchant Center.
+     * 
+ * + * UPLOAD = 1; + */ + UPLOAD(1), + /** + * + * + *
+     * The file is fetched from the configured
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * 
+ * + * FETCH = 2; + */ + FETCH(2), + /** + * + * + *
+     * The file is fetched from Google Sheets specified in the
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * However, you can't set up `GOOGLE_SHEETS` as a data source through the
+     * API. To add `GOOGLE_SHEETS` as a data source through the Merchant Center,
+     * see [Add products to Merchant
+     * Center](https://support.google.com/merchants/answer/12158053).
+     * 
+ * + * GOOGLE_SHEETS = 3; + */ + GOOGLE_SHEETS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * File input type unspecified.
+     * 
+ * + * FILE_INPUT_TYPE_UNSPECIFIED = 0; + */ + public static final int FILE_INPUT_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The file is uploaded through SFTP, Google Cloud Storage or manually in
+     * the Merchant Center.
+     * 
+ * + * UPLOAD = 1; + */ + public static final int UPLOAD_VALUE = 1; + + /** + * + * + *
+     * The file is fetched from the configured
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * 
+ * + * FETCH = 2; + */ + public static final int FETCH_VALUE = 2; + + /** + * + * + *
+     * The file is fetched from Google Sheets specified in the
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * However, you can't set up `GOOGLE_SHEETS` as a data source through the
+     * API. To add `GOOGLE_SHEETS` as a data source through the Merchant Center,
+     * see [Add products to Merchant
+     * Center](https://support.google.com/merchants/answer/12158053).
+     * 
+ * + * GOOGLE_SHEETS = 3; + */ + public static final int GOOGLE_SHEETS_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 FileInputType 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 FileInputType forNumber(int value) { + switch (value) { + case 0: + return FILE_INPUT_TYPE_UNSPECIFIED; + case 1: + return UPLOAD; + case 2: + return FETCH; + case 3: + return GOOGLE_SHEETS; + 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 FileInputType findValueByNumber(int number) { + return FileInputType.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.datasources.v1.FileInput.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final FileInputType[] VALUES = values(); + + public static FileInputType 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 FileInputType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.datasources.v1.FileInput.FileInputType) + } + + public interface FetchSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.FileInput.FetchSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. Enables or pauses the fetch schedule.
+     * 
+ * + * bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + boolean getEnabled(); + + /** + * + * + *
+     * Optional. The day of the month when the data source file should be
+     * fetched (1-31). This field can only be set for monthly frequency.
+     * 
+ * + * int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dayOfMonth. + */ + int getDayOfMonth(); + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timeOfDay field is set. + */ + boolean hasTimeOfDay(); + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The timeOfDay. + */ + com.google.type.TimeOfDay getTimeOfDay(); + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.type.TimeOfDayOrBuilder getTimeOfDayOrBuilder(); + + /** + * + * + *
+     * Optional. The day of the week when the data source file should be
+     * fetched. This field can only be set for weekly frequency.
+     * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dayOfWeek. + */ + int getDayOfWeekValue(); + + /** + * + * + *
+     * Optional. The day of the week when the data source file should be
+     * fetched. This field can only be set for weekly frequency.
+     * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dayOfWeek. + */ + com.google.type.DayOfWeek getDayOfWeek(); + + /** + * + * + *
+     * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+     * default. For example, "America/Los_Angeles".
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The timeZone. + */ + java.lang.String getTimeZone(); + + /** + * + * + *
+     * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+     * default. For example, "America/Los_Angeles".
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for timeZone. + */ + com.google.protobuf.ByteString getTimeZoneBytes(); + + /** + * + * + *
+     * Required. The frequency describing fetch schedule.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for frequency. + */ + int getFrequencyValue(); + + /** + * + * + *
+     * Required. The frequency describing fetch schedule.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The frequency. + */ + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency getFrequency(); + + /** + * + * + *
+     * Optional. The URL where the data source file can be fetched. Google
+     * Merchant Center supports automatic scheduled uploads using the HTTP,
+     * HTTPS or SFTP protocols, so the value will need to be a valid link using
+     * one of those three protocols. Immutable for Google Sheets files.
+     * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fetchUri. + */ + java.lang.String getFetchUri(); + + /** + * + * + *
+     * Optional. The URL where the data source file can be fetched. Google
+     * Merchant Center supports automatic scheduled uploads using the HTTP,
+     * HTTPS or SFTP protocols, so the value will need to be a valid link using
+     * one of those three protocols. Immutable for Google Sheets files.
+     * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fetchUri. + */ + com.google.protobuf.ByteString getFetchUriBytes(); + + /** + * + * + *
+     * Optional. An optional user name for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * + * + *
+     * Optional. An optional user name for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+     * Optional. An optional password for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * + * + *
+     * Optional. An optional password for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + } + + /** + * + * + *
+   * Fetch details to deliver the data source.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileInput.FetchSettings} + */ + public static final class FetchSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.FileInput.FetchSettings) + FetchSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FetchSettings.newBuilder() to construct. + private FetchSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FetchSettings() { + dayOfWeek_ = 0; + timeZone_ = ""; + frequency_ = 0; + fetchUri_ = ""; + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FetchSettings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.class, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder.class); + } + + /** + * + * + *
+     * The required fields vary based on the frequency of fetching. For a
+     * monthly
+     * fetch schedule,
+     * `day of
+     * month`
+     * and
+     * [hour of
+     * day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday]
+     * are required. For a weekly fetch schedule,
+     * [day of
+     * week][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#dayofweek]
+     * and [hour of
+     * day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday]
+     * are required. For a daily fetch schedule, only an [hour of
+     * day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday]
+     * is required.
+     * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency} + */ + public enum Frequency implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Frequency unspecified.
+       * 
+ * + * FREQUENCY_UNSPECIFIED = 0; + */ + FREQUENCY_UNSPECIFIED(0), + /** + * + * + *
+       * The fetch happens every day.
+       * 
+ * + * FREQUENCY_DAILY = 1; + */ + FREQUENCY_DAILY(1), + /** + * + * + *
+       * The fetch happens every week.
+       * 
+ * + * FREQUENCY_WEEKLY = 2; + */ + FREQUENCY_WEEKLY(2), + /** + * + * + *
+       * The fetch happens every month.
+       * 
+ * + * FREQUENCY_MONTHLY = 3; + */ + FREQUENCY_MONTHLY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Frequency unspecified.
+       * 
+ * + * FREQUENCY_UNSPECIFIED = 0; + */ + public static final int FREQUENCY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The fetch happens every day.
+       * 
+ * + * FREQUENCY_DAILY = 1; + */ + public static final int FREQUENCY_DAILY_VALUE = 1; + + /** + * + * + *
+       * The fetch happens every week.
+       * 
+ * + * FREQUENCY_WEEKLY = 2; + */ + public static final int FREQUENCY_WEEKLY_VALUE = 2; + + /** + * + * + *
+       * The fetch happens every month.
+       * 
+ * + * FREQUENCY_MONTHLY = 3; + */ + public static final int FREQUENCY_MONTHLY_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 Frequency 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 Frequency forNumber(int value) { + switch (value) { + case 0: + return FREQUENCY_UNSPECIFIED; + case 1: + return FREQUENCY_DAILY; + case 2: + return FREQUENCY_WEEKLY; + case 3: + return FREQUENCY_MONTHLY; + 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 Frequency findValueByNumber(int number) { + return Frequency.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.datasources.v1.FileInput.FetchSettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Frequency[] VALUES = values(); + + public static Frequency 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 Frequency(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency) + } + + private int bitField0_; + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + + /** + * + * + *
+     * Optional. Enables or pauses the fetch schedule.
+     * 
+ * + * bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + public static final int DAY_OF_MONTH_FIELD_NUMBER = 2; + private int dayOfMonth_ = 0; + + /** + * + * + *
+     * Optional. The day of the month when the data source file should be
+     * fetched (1-31). This field can only be set for monthly frequency.
+     * 
+ * + * int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dayOfMonth. + */ + @java.lang.Override + public int getDayOfMonth() { + return dayOfMonth_; + } + + public static final int TIME_OF_DAY_FIELD_NUMBER = 3; + private com.google.type.TimeOfDay timeOfDay_; + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timeOfDay field is set. + */ + @java.lang.Override + public boolean hasTimeOfDay() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The timeOfDay. + */ + @java.lang.Override + public com.google.type.TimeOfDay getTimeOfDay() { + return timeOfDay_ == null ? com.google.type.TimeOfDay.getDefaultInstance() : timeOfDay_; + } + + /** + * + * + *
+     * Optional. The hour of the day when the data source file should be
+     * fetched. Minutes and seconds are not supported and will be ignored.
+     * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.type.TimeOfDayOrBuilder getTimeOfDayOrBuilder() { + return timeOfDay_ == null ? com.google.type.TimeOfDay.getDefaultInstance() : timeOfDay_; + } + + public static final int DAY_OF_WEEK_FIELD_NUMBER = 4; + private int dayOfWeek_ = 0; + + /** + * + * + *
+     * Optional. The day of the week when the data source file should be
+     * fetched. This field can only be set for weekly frequency.
+     * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dayOfWeek. + */ + @java.lang.Override + public int getDayOfWeekValue() { + return dayOfWeek_; + } + + /** + * + * + *
+     * Optional. The day of the week when the data source file should be
+     * fetched. This field can only be set for weekly frequency.
+     * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dayOfWeek. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDayOfWeek() { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(dayOfWeek_); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + + public static final int TIME_ZONE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object timeZone_ = ""; + + /** + * + * + *
+     * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+     * default. For example, "America/Los_Angeles".
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The timeZone. + */ + @java.lang.Override + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + 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(); + timeZone_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+     * default. For example, "America/Los_Angeles".
+     * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for timeZone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FREQUENCY_FIELD_NUMBER = 6; + private int frequency_ = 0; + + /** + * + * + *
+     * Required. The frequency describing fetch schedule.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for frequency. + */ + @java.lang.Override + public int getFrequencyValue() { + return frequency_; + } + + /** + * + * + *
+     * Required. The frequency describing fetch schedule.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The frequency. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + getFrequency() { + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency result = + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency.forNumber( + frequency_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + .UNRECOGNIZED + : result; + } + + public static final int FETCH_URI_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object fetchUri_ = ""; + + /** + * + * + *
+     * Optional. The URL where the data source file can be fetched. Google
+     * Merchant Center supports automatic scheduled uploads using the HTTP,
+     * HTTPS or SFTP protocols, so the value will need to be a valid link using
+     * one of those three protocols. Immutable for Google Sheets files.
+     * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fetchUri. + */ + @java.lang.Override + public java.lang.String getFetchUri() { + java.lang.Object ref = fetchUri_; + 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(); + fetchUri_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. The URL where the data source file can be fetched. Google
+     * Merchant Center supports automatic scheduled uploads using the HTTP,
+     * HTTPS or SFTP protocols, so the value will need to be a valid link using
+     * one of those three protocols. Immutable for Google Sheets files.
+     * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fetchUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFetchUriBytes() { + java.lang.Object ref = fetchUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fetchUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * + * + *
+     * Optional. An optional user name for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. An optional user name for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * + * + *
+     * Optional. An optional password for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + + /** + * + * + *
+     * Optional. An optional password for
+     * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+     * Used for [submitting data sources through
+     * SFTP](https://support.google.com/merchants/answer/13813117).
+     * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = 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 (enabled_ != false) { + output.writeBool(1, enabled_); + } + if (dayOfMonth_ != 0) { + output.writeInt32(2, dayOfMonth_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getTimeOfDay()); + } + if (dayOfWeek_ != com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED.getNumber()) { + output.writeEnum(4, dayOfWeek_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeZone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, timeZone_); + } + if (frequency_ + != com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + .FREQUENCY_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, frequency_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fetchUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, fetchUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, username_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, password_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_); + } + if (dayOfMonth_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, dayOfMonth_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimeOfDay()); + } + if (dayOfWeek_ != com.google.type.DayOfWeek.DAY_OF_WEEK_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, dayOfWeek_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(timeZone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, timeZone_); + } + if (frequency_ + != com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + .FREQUENCY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, frequency_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fetchUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, fetchUri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, username_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, password_); + } + 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.datasources.v1.FileInput.FetchSettings)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings other = + (com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings) obj; + + if (getEnabled() != other.getEnabled()) return false; + if (getDayOfMonth() != other.getDayOfMonth()) return false; + if (hasTimeOfDay() != other.hasTimeOfDay()) return false; + if (hasTimeOfDay()) { + if (!getTimeOfDay().equals(other.getTimeOfDay())) return false; + } + if (dayOfWeek_ != other.dayOfWeek_) return false; + if (!getTimeZone().equals(other.getTimeZone())) return false; + if (frequency_ != other.frequency_) return false; + if (!getFetchUri().equals(other.getFetchUri())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) 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) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled()); + hash = (37 * hash) + DAY_OF_MONTH_FIELD_NUMBER; + hash = (53 * hash) + getDayOfMonth(); + if (hasTimeOfDay()) { + hash = (37 * hash) + TIME_OF_DAY_FIELD_NUMBER; + hash = (53 * hash) + getTimeOfDay().hashCode(); + } + hash = (37 * hash) + DAY_OF_WEEK_FIELD_NUMBER; + hash = (53 * hash) + dayOfWeek_; + hash = (37 * hash) + TIME_ZONE_FIELD_NUMBER; + hash = (53 * hash) + getTimeZone().hashCode(); + hash = (37 * hash) + FREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + frequency_; + hash = (37 * hash) + FETCH_URI_FIELD_NUMBER; + hash = (53 * hash) + getFetchUri().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings 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.datasources.v1.FileInput.FetchSettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings 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.datasources.v1.FileInput.FetchSettings parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings 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.datasources.v1.FileInput.FetchSettings + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + 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.datasources.v1.FileInput.FetchSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings 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.datasources.v1.FileInput.FetchSettings 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; + } + + /** + * + * + *
+     * Fetch details to deliver the data source.
+     * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileInput.FetchSettings} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.FileInput.FetchSettings) + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.class, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTimeOfDayFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + dayOfMonth_ = 0; + timeOfDay_ = null; + if (timeOfDayBuilder_ != null) { + timeOfDayBuilder_.dispose(); + timeOfDayBuilder_ = null; + } + dayOfWeek_ = 0; + timeZone_ = ""; + frequency_ = 0; + fetchUri_ = ""; + username_ = ""; + password_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings build() { + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings buildPartial() { + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings result = + new com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dayOfMonth_ = dayOfMonth_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timeOfDay_ = timeOfDayBuilder_ == null ? timeOfDay_ : timeOfDayBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.dayOfWeek_ = dayOfWeek_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.timeZone_ = timeZone_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.frequency_ = frequency_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fetchUri_ = fetchUri_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.username_ = username_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.password_ = password_; + } + 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.datasources.v1.FileInput.FetchSettings) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings other) { + if (other + == com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + .getDefaultInstance()) return this; + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + if (other.getDayOfMonth() != 0) { + setDayOfMonth(other.getDayOfMonth()); + } + if (other.hasTimeOfDay()) { + mergeTimeOfDay(other.getTimeOfDay()); + } + if (other.dayOfWeek_ != 0) { + setDayOfWeekValue(other.getDayOfWeekValue()); + } + if (!other.getTimeZone().isEmpty()) { + timeZone_ = other.timeZone_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.frequency_ != 0) { + setFrequencyValue(other.getFrequencyValue()); + } + if (!other.getFetchUri().isEmpty()) { + fetchUri_ = other.fetchUri_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000100; + 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: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + dayOfMonth_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getTimeOfDayFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + dayOfWeek_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + timeZone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + frequency_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + fetchUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + 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 boolean enabled_; + + /** + * + * + *
+       * Optional. Enables or pauses the fetch schedule.
+       * 
+ * + * bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + + /** + * + * + *
+       * Optional. Enables or pauses the fetch schedule.
+       * 
+ * + * bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. Enables or pauses the fetch schedule.
+       * 
+ * + * bool enabled = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + enabled_ = false; + onChanged(); + return this; + } + + private int dayOfMonth_; + + /** + * + * + *
+       * Optional. The day of the month when the data source file should be
+       * fetched (1-31). This field can only be set for monthly frequency.
+       * 
+ * + * int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dayOfMonth. + */ + @java.lang.Override + public int getDayOfMonth() { + return dayOfMonth_; + } + + /** + * + * + *
+       * Optional. The day of the month when the data source file should be
+       * fetched (1-31). This field can only be set for monthly frequency.
+       * 
+ * + * int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The dayOfMonth to set. + * @return This builder for chaining. + */ + public Builder setDayOfMonth(int value) { + + dayOfMonth_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The day of the month when the data source file should be
+       * fetched (1-31). This field can only be set for monthly frequency.
+       * 
+ * + * int32 day_of_month = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDayOfMonth() { + bitField0_ = (bitField0_ & ~0x00000002); + dayOfMonth_ = 0; + onChanged(); + return this; + } + + private com.google.type.TimeOfDay timeOfDay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + timeOfDayBuilder_; + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timeOfDay field is set. + */ + public boolean hasTimeOfDay() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The timeOfDay. + */ + public com.google.type.TimeOfDay getTimeOfDay() { + if (timeOfDayBuilder_ == null) { + return timeOfDay_ == null ? com.google.type.TimeOfDay.getDefaultInstance() : timeOfDay_; + } else { + return timeOfDayBuilder_.getMessage(); + } + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTimeOfDay(com.google.type.TimeOfDay value) { + if (timeOfDayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeOfDay_ = value; + } else { + timeOfDayBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTimeOfDay(com.google.type.TimeOfDay.Builder builderForValue) { + if (timeOfDayBuilder_ == null) { + timeOfDay_ = builderForValue.build(); + } else { + timeOfDayBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTimeOfDay(com.google.type.TimeOfDay value) { + if (timeOfDayBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && timeOfDay_ != null + && timeOfDay_ != com.google.type.TimeOfDay.getDefaultInstance()) { + getTimeOfDayBuilder().mergeFrom(value); + } else { + timeOfDay_ = value; + } + } else { + timeOfDayBuilder_.mergeFrom(value); + } + if (timeOfDay_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTimeOfDay() { + bitField0_ = (bitField0_ & ~0x00000004); + timeOfDay_ = null; + if (timeOfDayBuilder_ != null) { + timeOfDayBuilder_.dispose(); + timeOfDayBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.type.TimeOfDay.Builder getTimeOfDayBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getTimeOfDayFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.type.TimeOfDayOrBuilder getTimeOfDayOrBuilder() { + if (timeOfDayBuilder_ != null) { + return timeOfDayBuilder_.getMessageOrBuilder(); + } else { + return timeOfDay_ == null ? com.google.type.TimeOfDay.getDefaultInstance() : timeOfDay_; + } + } + + /** + * + * + *
+       * Optional. The hour of the day when the data source file should be
+       * fetched. Minutes and seconds are not supported and will be ignored.
+       * 
+ * + * .google.type.TimeOfDay time_of_day = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder> + getTimeOfDayFieldBuilder() { + if (timeOfDayBuilder_ == null) { + timeOfDayBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.TimeOfDay, + com.google.type.TimeOfDay.Builder, + com.google.type.TimeOfDayOrBuilder>( + getTimeOfDay(), getParentForChildren(), isClean()); + timeOfDay_ = null; + } + return timeOfDayBuilder_; + } + + private int dayOfWeek_ = 0; + + /** + * + * + *
+       * Optional. The day of the week when the data source file should be
+       * fetched. This field can only be set for weekly frequency.
+       * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dayOfWeek. + */ + @java.lang.Override + public int getDayOfWeekValue() { + return dayOfWeek_; + } + + /** + * + * + *
+       * Optional. The day of the week when the data source file should be
+       * fetched. This field can only be set for weekly frequency.
+       * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for dayOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDayOfWeekValue(int value) { + dayOfWeek_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The day of the week when the data source file should be
+       * fetched. This field can only be set for weekly frequency.
+       * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dayOfWeek. + */ + @java.lang.Override + public com.google.type.DayOfWeek getDayOfWeek() { + com.google.type.DayOfWeek result = com.google.type.DayOfWeek.forNumber(dayOfWeek_); + return result == null ? com.google.type.DayOfWeek.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * Optional. The day of the week when the data source file should be
+       * fetched. This field can only be set for weekly frequency.
+       * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dayOfWeek to set. + * @return This builder for chaining. + */ + public Builder setDayOfWeek(com.google.type.DayOfWeek value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + dayOfWeek_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The day of the week when the data source file should be
+       * fetched. This field can only be set for weekly frequency.
+       * 
+ * + * .google.type.DayOfWeek day_of_week = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDayOfWeek() { + bitField0_ = (bitField0_ & ~0x00000008); + dayOfWeek_ = 0; + onChanged(); + return this; + } + + private java.lang.Object timeZone_ = ""; + + /** + * + * + *
+       * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+       * default. For example, "America/Los_Angeles".
+       * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The timeZone. + */ + public java.lang.String getTimeZone() { + java.lang.Object ref = timeZone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + timeZone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+       * default. For example, "America/Los_Angeles".
+       * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for timeZone. + */ + public com.google.protobuf.ByteString getTimeZoneBytes() { + java.lang.Object ref = timeZone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + timeZone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+       * default. For example, "America/Los_Angeles".
+       * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + timeZone_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+       * default. For example, "America/Los_Angeles".
+       * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTimeZone() { + timeZone_ = getDefaultInstance().getTimeZone(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by
+       * default. For example, "America/Los_Angeles".
+       * 
+ * + * string time_zone = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for timeZone to set. + * @return This builder for chaining. + */ + public Builder setTimeZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + timeZone_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int frequency_ = 0; + + /** + * + * + *
+       * Required. The frequency describing fetch schedule.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for frequency. + */ + @java.lang.Override + public int getFrequencyValue() { + return frequency_; + } + + /** + * + * + *
+       * Required. The frequency describing fetch schedule.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequencyValue(int value) { + frequency_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The frequency describing fetch schedule.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The frequency. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + getFrequency() { + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency result = + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency.forNumber( + frequency_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Required. The frequency describing fetch schedule.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The frequency to set. + * @return This builder for chaining. + */ + public Builder setFrequency( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + frequency_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Required. The frequency describing fetch schedule.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Frequency frequency = 6 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000020); + frequency_ = 0; + onChanged(); + return this; + } + + private java.lang.Object fetchUri_ = ""; + + /** + * + * + *
+       * Optional. The URL where the data source file can be fetched. Google
+       * Merchant Center supports automatic scheduled uploads using the HTTP,
+       * HTTPS or SFTP protocols, so the value will need to be a valid link using
+       * one of those three protocols. Immutable for Google Sheets files.
+       * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fetchUri. + */ + public java.lang.String getFetchUri() { + java.lang.Object ref = fetchUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fetchUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. The URL where the data source file can be fetched. Google
+       * Merchant Center supports automatic scheduled uploads using the HTTP,
+       * HTTPS or SFTP protocols, so the value will need to be a valid link using
+       * one of those three protocols. Immutable for Google Sheets files.
+       * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fetchUri. + */ + public com.google.protobuf.ByteString getFetchUriBytes() { + java.lang.Object ref = fetchUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fetchUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. The URL where the data source file can be fetched. Google
+       * Merchant Center supports automatic scheduled uploads using the HTTP,
+       * HTTPS or SFTP protocols, so the value will need to be a valid link using
+       * one of those three protocols. Immutable for Google Sheets files.
+       * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The fetchUri to set. + * @return This builder for chaining. + */ + public Builder setFetchUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fetchUri_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The URL where the data source file can be fetched. Google
+       * Merchant Center supports automatic scheduled uploads using the HTTP,
+       * HTTPS or SFTP protocols, so the value will need to be a valid link using
+       * one of those three protocols. Immutable for Google Sheets files.
+       * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFetchUri() { + fetchUri_ = getDefaultInstance().getFetchUri(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. The URL where the data source file can be fetched. Google
+       * Merchant Center supports automatic scheduled uploads using the HTTP,
+       * HTTPS or SFTP protocols, so the value will need to be a valid link using
+       * one of those three protocols. Immutable for Google Sheets files.
+       * 
+ * + * string fetch_uri = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for fetchUri to set. + * @return This builder for chaining. + */ + public Builder setFetchUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fetchUri_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * + * + *
+       * Optional. An optional user name for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. An optional user name for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. An optional user name for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. An optional user name for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. An optional user name for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string username = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + + /** + * + * + *
+       * Optional. An optional password for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Optional. An optional password for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Optional. An optional password for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. An optional password for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+       * Optional. An optional password for
+       * [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri].
+       * Used for [submitting data sources through
+       * SFTP](https://support.google.com/merchants/answer/13813117).
+       * 
+ * + * string password = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000100; + 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.datasources.v1.FileInput.FetchSettings) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.FileInput.FetchSettings) + private static final com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings(); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FetchSettings 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.datasources.v1.FileInput.FetchSettings + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int FETCH_SETTINGS_FIELD_NUMBER = 1; + private com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetchSettings_; + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fetchSettings field is set. + */ + @java.lang.Override + public boolean hasFetchSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fetchSettings. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings getFetchSettings() { + return fetchSettings_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.getDefaultInstance() + : fetchSettings_; + } + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder + getFetchSettingsOrBuilder() { + return fetchSettings_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.getDefaultInstance() + : fetchSettings_; + } + + public static final int FILE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object fileName_ = ""; + + /** + * + * + *
+   * Optional. The file name of the data source. Required for `UPLOAD` file
+   * input type.
+   * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileName. + */ + @java.lang.Override + public java.lang.String getFileName() { + java.lang.Object ref = fileName_; + 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(); + fileName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The file name of the data source. Required for `UPLOAD` file
+   * input type.
+   * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_INPUT_TYPE_FIELD_NUMBER = 3; + private int fileInputType_ = 0; + + /** + * + * + *
+   * Output only. The type of file input.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fileInputType. + */ + @java.lang.Override + public int getFileInputTypeValue() { + return fileInputType_; + } + + /** + * + * + *
+   * Output only. The type of file input.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fileInputType. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FileInputType getFileInputType() { + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType result = + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType.forNumber( + fileInputType_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FileInputType.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getFetchSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fileName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fileName_); + } + if (fileInputType_ + != com.google.shopping.merchant.datasources.v1.FileInput.FileInputType + .FILE_INPUT_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, fileInputType_); + } + 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, getFetchSettings()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fileName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fileName_); + } + if (fileInputType_ + != com.google.shopping.merchant.datasources.v1.FileInput.FileInputType + .FILE_INPUT_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, fileInputType_); + } + 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.datasources.v1.FileInput)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.FileInput other = + (com.google.shopping.merchant.datasources.v1.FileInput) obj; + + if (hasFetchSettings() != other.hasFetchSettings()) return false; + if (hasFetchSettings()) { + if (!getFetchSettings().equals(other.getFetchSettings())) return false; + } + if (!getFileName().equals(other.getFileName())) return false; + if (fileInputType_ != other.fileInputType_) 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 (hasFetchSettings()) { + hash = (37 * hash) + FETCH_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getFetchSettings().hashCode(); + } + hash = (37 * hash) + FILE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFileName().hashCode(); + hash = (37 * hash) + FILE_INPUT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + fileInputType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.FileInput parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput 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.datasources.v1.FileInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput 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.datasources.v1.FileInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput 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.datasources.v1.FileInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput 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.datasources.v1.FileInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput 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.datasources.v1.FileInput 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; + } + + /** + * + * + *
+   * The data specific for file data sources. This field is empty for other
+   * data source inputs.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.FileInput) + com.google.shopping.merchant.datasources.v1.FileInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileInput.class, + com.google.shopping.merchant.datasources.v1.FileInput.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.FileInput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFetchSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fetchSettings_ = null; + if (fetchSettingsBuilder_ != null) { + fetchSettingsBuilder_.dispose(); + fetchSettingsBuilder_ = null; + } + fileName_ = ""; + fileInputType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.FileInputsProto + .internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput build() { + com.google.shopping.merchant.datasources.v1.FileInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput buildPartial() { + com.google.shopping.merchant.datasources.v1.FileInput result = + new com.google.shopping.merchant.datasources.v1.FileInput(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.merchant.datasources.v1.FileInput result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fetchSettings_ = + fetchSettingsBuilder_ == null ? fetchSettings_ : fetchSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fileName_ = fileName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fileInputType_ = fileInputType_; + } + 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.datasources.v1.FileInput) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.FileInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.datasources.v1.FileInput other) { + if (other == com.google.shopping.merchant.datasources.v1.FileInput.getDefaultInstance()) + return this; + if (other.hasFetchSettings()) { + mergeFetchSettings(other.getFetchSettings()); + } + if (!other.getFileName().isEmpty()) { + fileName_ = other.fileName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.fileInputType_ != 0) { + setFileInputTypeValue(other.getFileInputTypeValue()); + } + 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(getFetchSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + fileName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + fileInputType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetchSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder> + fetchSettingsBuilder_; + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fetchSettings field is set. + */ + public boolean hasFetchSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fetchSettings. + */ + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings getFetchSettings() { + if (fetchSettingsBuilder_ == null) { + return fetchSettings_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + .getDefaultInstance() + : fetchSettings_; + } else { + return fetchSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFetchSettings( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings value) { + if (fetchSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fetchSettings_ = value; + } else { + fetchSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setFetchSettings( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder + builderForValue) { + if (fetchSettingsBuilder_ == null) { + fetchSettings_ = builderForValue.build(); + } else { + fetchSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeFetchSettings( + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings value) { + if (fetchSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && fetchSettings_ != null + && fetchSettings_ + != com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + .getDefaultInstance()) { + getFetchSettingsBuilder().mergeFrom(value); + } else { + fetchSettings_ = value; + } + } else { + fetchSettingsBuilder_.mergeFrom(value); + } + if (fetchSettings_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearFetchSettings() { + bitField0_ = (bitField0_ & ~0x00000001); + fetchSettings_ = null; + if (fetchSettingsBuilder_ != null) { + fetchSettingsBuilder_.dispose(); + fetchSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder + getFetchSettingsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getFetchSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder + getFetchSettingsOrBuilder() { + if (fetchSettingsBuilder_ != null) { + return fetchSettingsBuilder_.getMessageOrBuilder(); + } else { + return fetchSettings_ == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings + .getDefaultInstance() + : fetchSettings_; + } + } + + /** + * + * + *
+     * Optional. Fetch details to deliver the data source. It contains settings
+     * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+     * based on the frequency of fetching.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder> + getFetchSettingsFieldBuilder() { + if (fetchSettingsBuilder_ == null) { + fetchSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings.Builder, + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder>( + getFetchSettings(), getParentForChildren(), isClean()); + fetchSettings_ = null; + } + return fetchSettingsBuilder_; + } + + private java.lang.Object fileName_ = ""; + + /** + * + * + *
+     * Optional. The file name of the data source. Required for `UPLOAD` file
+     * input type.
+     * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileName. + */ + public java.lang.String getFileName() { + java.lang.Object ref = fileName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The file name of the data source. Required for `UPLOAD` file
+     * input type.
+     * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileName. + */ + public com.google.protobuf.ByteString getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The file name of the data source. Required for `UPLOAD` file
+     * input type.
+     * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The fileName to set. + * @return This builder for chaining. + */ + public Builder setFileName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fileName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The file name of the data source. Required for `UPLOAD` file
+     * input type.
+     * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFileName() { + fileName_ = getDefaultInstance().getFileName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The file name of the data source. Required for `UPLOAD` file
+     * input type.
+     * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for fileName to set. + * @return This builder for chaining. + */ + public Builder setFileNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fileName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int fileInputType_ = 0; + + /** + * + * + *
+     * Output only. The type of file input.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fileInputType. + */ + @java.lang.Override + public int getFileInputTypeValue() { + return fileInputType_; + } + + /** + * + * + *
+     * Output only. The type of file input.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for fileInputType to set. + * @return This builder for chaining. + */ + public Builder setFileInputTypeValue(int value) { + fileInputType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of file input.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fileInputType. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileInput.FileInputType getFileInputType() { + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType result = + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType.forNumber( + fileInputType_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileInput.FileInputType.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The type of file input.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The fileInputType to set. + * @return This builder for chaining. + */ + public Builder setFileInputType( + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + fileInputType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The type of file input.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearFileInputType() { + bitField0_ = (bitField0_ & ~0x00000004); + fileInputType_ = 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.datasources.v1.FileInput) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.FileInput) + private static final com.google.shopping.merchant.datasources.v1.FileInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.FileInput(); + } + + public static com.google.shopping.merchant.datasources.v1.FileInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileInput 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.datasources.v1.FileInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputOrBuilder.java new file mode 100644 index 000000000000..2f3491785da3 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputOrBuilder.java @@ -0,0 +1,134 @@ +/* + * 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/datasources/v1/fileinputs.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface FileInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.FileInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the fetchSettings field is set. + */ + boolean hasFetchSettings(); + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The fetchSettings. + */ + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettings getFetchSettings(); + + /** + * + * + *
+   * Optional. Fetch details to deliver the data source. It contains settings
+   * for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary
+   * based on the frequency of fetching.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FetchSettings fetch_settings = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.shopping.merchant.datasources.v1.FileInput.FetchSettingsOrBuilder + getFetchSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. The file name of the data source. Required for `UPLOAD` file
+   * input type.
+   * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The fileName. + */ + java.lang.String getFileName(); + + /** + * + * + *
+   * Optional. The file name of the data source. Required for `UPLOAD` file
+   * input type.
+   * 
+ * + * string file_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for fileName. + */ + com.google.protobuf.ByteString getFileNameBytes(); + + /** + * + * + *
+   * Output only. The type of file input.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for fileInputType. + */ + int getFileInputTypeValue(); + + /** + * + * + *
+   * Output only. The type of file input.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileInput.FileInputType file_input_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The fileInputType. + */ + com.google.shopping.merchant.datasources.v1.FileInput.FileInputType getFileInputType(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputsProto.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputsProto.java new file mode 100644 index 000000000000..41cb4c605dd3 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileInputsProto.java @@ -0,0 +1,130 @@ +/* + * 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/datasources/v1/fileinputs.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public final class FileInputsProto { + private FileInputsProto() {} + + 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_datasources_v1_FileInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_FileInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_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" + + "8google/shopping/merchant/datasources/v1/fileinputs.proto\022\'google.shopping.merc" + + "hant.datasources.v1\032\037google/api/field_be" + + "havior.proto\032\033google/type/dayofweek.proto\032\033google/type/timeofday.proto\"\221\006\n" + + "\tFileInput\022]\n" + + "\016fetch_settings\030\001 \001(\0132@.google.sh" + + "opping.merchant.datasources.v1.FileInput.FetchSettingsB\003\340A\001\022\026\n" + + "\tfile_name\030\002 \001(\tB\003\340A\001\022^\n" + + "\017file_input_type\030\003 \001(\0162@.google.sh" + + "opping.merchant.datasources.v1.FileInput.FileInputTypeB\003\340A\003\032\320\003\n\r" + + "FetchSettings\022\024\n" + + "\007enabled\030\001 \001(\010B\003\340A\001\022\031\n" + + "\014day_of_month\030\002 \001(\005B\003\340A\001\0220\n" + + "\013time_of_day\030\003 \001(\0132\026.google.type.TimeOfDayB\003\340A\001\0220\n" + + "\013day_of_week\030\004 \001(\0162\026.google.type.DayOfWeekB\003\340A\001\022\026\n" + + "\ttime_zone\030\005 \001(\tB\003\340A\001\022b\n" + + "\tfrequency\030\006 \001(\0162J.google.s" + + "hopping.merchant.datasources.v1.FileInput.FetchSettings.FrequencyB\003\340A\002\022\026\n" + + "\tfetch_uri\030\007 \001(\tB\003\340A\001\022\025\n" + + "\010username\030\010 \001(\tB\003\340A\001\022\025\n" + + "\010password\030\t \001(\tB\003\340A\001\"h\n" + + "\tFrequency\022\031\n" + + "\025FREQUENCY_UNSPECIFIED\020\000\022\023\n" + + "\017FREQUENCY_DAILY\020\001\022\024\n" + + "\020FREQUENCY_WEEKLY\020\002\022\025\n" + + "\021FREQUENCY_MONTHLY\020\003\"Z\n\r" + + "FileInputType\022\037\n" + + "\033FILE_INPUT_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006UPLOAD\020\001\022\t\n" + + "\005FETCH\020\002\022\021\n\r" + + "GOOGLE_SHEETS\020\003B\227\002\n" + + "+com.google.shopping.merchant.datasources.v1B\017FileInputsPr" + + "otoP\001ZScloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;dat" + + "asourcespb\252\002\'Google.Shopping.Merchant.Da" + + "taSources.V1\312\002\'Google\\Shopping\\Merchant\\" + + "DataSources\\V1\352\002+Google::Shopping::Merchant::DataSources::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.type.DayOfWeekProto.getDescriptor(), + com.google.type.TimeOfDayProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_datasources_v1_FileInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor, + new java.lang.String[] { + "FetchSettings", "FileName", "FileInputType", + }); + internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor = + internal_static_google_shopping_merchant_datasources_v1_FileInput_descriptor + .getNestedTypes() + .get(0); + internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_FileInput_FetchSettings_descriptor, + new java.lang.String[] { + "Enabled", + "DayOfMonth", + "TimeOfDay", + "DayOfWeek", + "TimeZone", + "Frequency", + "FetchUri", + "Username", + "Password", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.type.DayOfWeekProto.getDescriptor(); + com.google.type.TimeOfDayProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUpload.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUpload.java new file mode 100644 index 000000000000..ea17f653e917 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUpload.java @@ -0,0 +1,4137 @@ +/* + * 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/datasources/v1/fileuploads.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The file upload of a specific data source, that is, the result of the
+ * retrieval of the data source at a certain timestamp computed asynchronously
+ * when the data source processing is finished. Only applicable to file data
+ * sources.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileUpload} + */ +public final class FileUpload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.FileUpload) + FileUploadOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FileUpload.newBuilder() to construct. + private FileUpload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FileUpload() { + name_ = ""; + processingState_ = 0; + issues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileUpload(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileUpload.class, + com.google.shopping.merchant.datasources.v1.FileUpload.Builder.class); + } + + /** + * + * + *
+   * The processing state of the data source.
+   * 
+ * + * Protobuf enum {@code google.shopping.merchant.datasources.v1.FileUpload.ProcessingState} + */ + public enum ProcessingState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Processing state unspecified.
+     * 
+ * + * PROCESSING_STATE_UNSPECIFIED = 0; + */ + PROCESSING_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The data source could not be processed or all the items had errors.
+     * 
+ * + * FAILED = 1; + */ + FAILED(1), + /** + * + * + *
+     * The data source is being processed.
+     * 
+ * + * IN_PROGRESS = 2; + */ + IN_PROGRESS(2), + /** + * + * + *
+     * The data source was processed successfully, though some items might have
+     * had errors.
+     * 
+ * + * SUCCEEDED = 3; + */ + SUCCEEDED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Processing state unspecified.
+     * 
+ * + * PROCESSING_STATE_UNSPECIFIED = 0; + */ + public static final int PROCESSING_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * The data source could not be processed or all the items had errors.
+     * 
+ * + * FAILED = 1; + */ + public static final int FAILED_VALUE = 1; + + /** + * + * + *
+     * The data source is being processed.
+     * 
+ * + * IN_PROGRESS = 2; + */ + public static final int IN_PROGRESS_VALUE = 2; + + /** + * + * + *
+     * The data source was processed successfully, though some items might have
+     * had errors.
+     * 
+ * + * SUCCEEDED = 3; + */ + public static final int SUCCEEDED_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 ProcessingState 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 ProcessingState forNumber(int value) { + switch (value) { + case 0: + return PROCESSING_STATE_UNSPECIFIED; + case 1: + return FAILED; + case 2: + return IN_PROGRESS; + case 3: + return SUCCEEDED; + 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 ProcessingState findValueByNumber(int number) { + return ProcessingState.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.datasources.v1.FileUpload.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ProcessingState[] VALUES = values(); + + public static ProcessingState 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 ProcessingState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.datasources.v1.FileUpload.ProcessingState) + } + + public interface IssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.FileUpload.Issue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The title of the issue, for example, "Item too big".
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + java.lang.String getTitle(); + + /** + * + * + *
+     * Output only. The title of the issue, for example, "Item too big".
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+     * Output only. The error description, for example, "Your data source
+     * contains items which have too many attributes, or are too big. These
+     * items will be dropped".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+     * Output only. The error description, for example, "Your data source
+     * contains items which have too many attributes, or are too big. These
+     * items will be dropped".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * Output only. The code of the error, for example,
+     * "validation/invalid_value". Returns
+     * "?" if the code is unknown.
+     * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The code. + */ + java.lang.String getCode(); + + /** + * + * + *
+     * Output only. The code of the error, for example,
+     * "validation/invalid_value". Returns
+     * "?" if the code is unknown.
+     * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); + + /** + * + * + *
+     * Output only. The number of occurrences of the error in the file upload.
+     * 
+ * + * int64 count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count. + */ + long getCount(); + + /** + * + * + *
+     * Output only. The severity of the issue.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
+     * Output only. The severity of the issue.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity getSeverity(); + + /** + * + * + *
+     * Output only. Link to the documentation explaining the issue in more
+     * details, if available.
+     * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentationUri. + */ + java.lang.String getDocumentationUri(); + + /** + * + * + *
+     * Output only. Link to the documentation explaining the issue in more
+     * details, if available.
+     * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for documentationUri. + */ + com.google.protobuf.ByteString getDocumentationUriBytes(); + } + + /** + * + * + *
+   * An error occurring in the data source, like "invalid price".
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileUpload.Issue} + */ + public static final class Issue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.FileUpload.Issue) + IssueOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Issue.newBuilder() to construct. + private Issue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Issue() { + title_ = ""; + description_ = ""; + code_ = ""; + severity_ = 0; + documentationUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Issue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.class, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder.class); + } + + /** + * + * + *
+     * The severity of the issue.
+     * 
+ * + * Protobuf enum {@code google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Severity unspecified.
+       * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+       * The issue is the warning.
+       * 
+ * + * WARNING = 1; + */ + WARNING(1), + /** + * + * + *
+       * The issue is an error.
+       * 
+ * + * ERROR = 2; + */ + ERROR(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Severity unspecified.
+       * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * The issue is the warning.
+       * 
+ * + * WARNING = 1; + */ + public static final int WARNING_VALUE = 1; + + /** + * + * + *
+       * The issue is an error.
+       * 
+ * + * ERROR = 2; + */ + public static final int ERROR_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return WARNING; + case 2: + return ERROR; + 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 Severity findValueByNumber(int number) { + return Severity.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.datasources.v1.FileUpload.Issue.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity) + } + + public static final int TITLE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + + /** + * + * + *
+     * Output only. The title of the issue, for example, "Item too big".
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The title of the issue, for example, "Item too big".
+     * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+     * Output only. The error description, for example, "Your data source
+     * contains items which have too many attributes, or are too big. These
+     * items will be dropped".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The error description, for example, "Your data source
+     * contains items which have too many attributes, or are too big. These
+     * items will be dropped".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CODE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + + /** + * + * + *
+     * Output only. The code of the error, for example,
+     * "validation/invalid_value". Returns
+     * "?" if the code is unknown.
+     * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The code. + */ + @java.lang.Override + public java.lang.String getCode() { + java.lang.Object ref = code_; + 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(); + code_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. The code of the error, for example,
+     * "validation/invalid_value". Returns
+     * "?" if the code is unknown.
+     * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for code. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COUNT_FIELD_NUMBER = 4; + private long count_ = 0L; + + /** + * + * + *
+     * Output only. The number of occurrences of the error in the file upload.
+     * 
+ * + * int64 count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + public static final int SEVERITY_FIELD_NUMBER = 5; + private int severity_ = 0; + + /** + * + * + *
+     * Output only. The severity of the issue.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
+     * Output only. The severity of the issue.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity getSeverity() { + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity result = + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity.forNumber( + severity_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity.UNRECOGNIZED + : result; + } + + public static final int DOCUMENTATION_URI_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentationUri_ = ""; + + /** + * + * + *
+     * Output only. Link to the documentation explaining the issue in more
+     * details, if available.
+     * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentationUri. + */ + @java.lang.Override + public java.lang.String getDocumentationUri() { + java.lang.Object ref = documentationUri_; + 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(); + documentationUri_ = s; + return s; + } + } + + /** + * + * + *
+     * Output only. Link to the documentation explaining the issue in more
+     * details, if available.
+     * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for documentationUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentationUriBytes() { + java.lang.Object ref = documentationUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentationUri_ = 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(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, code_); + } + if (count_ != 0L) { + output.writeInt64(4, count_); + } + if (severity_ + != com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity + .SEVERITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, documentationUri_); + } + 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(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, code_); + } + if (count_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, count_); + } + if (severity_ + != com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity + .SEVERITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentationUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, documentationUri_); + } + 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.datasources.v1.FileUpload.Issue)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.FileUpload.Issue other = + (com.google.shopping.merchant.datasources.v1.FileUpload.Issue) obj; + + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getCode().equals(other.getCode())) return false; + if (getCount() != other.getCount()) return false; + if (severity_ != other.severity_) return false; + if (!getDocumentationUri().equals(other.getDocumentationUri())) 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) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCount()); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DOCUMENTATION_URI_FIELD_NUMBER; + hash = (53 * hash) + getDocumentationUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue 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.datasources.v1.FileUpload.Issue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue 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.datasources.v1.FileUpload.Issue parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue 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.datasources.v1.FileUpload.Issue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue 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.datasources.v1.FileUpload.Issue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue 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.datasources.v1.FileUpload.Issue 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; + } + + /** + * + * + *
+     * An error occurring in the data source, like "invalid price".
+     * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileUpload.Issue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.FileUpload.Issue) + com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.class, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.FileUpload.Issue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + title_ = ""; + description_ = ""; + code_ = ""; + count_ = 0L; + severity_ = 0; + documentationUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.FileUpload.Issue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue build() { + com.google.shopping.merchant.datasources.v1.FileUpload.Issue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue buildPartial() { + com.google.shopping.merchant.datasources.v1.FileUpload.Issue result = + new com.google.shopping.merchant.datasources.v1.FileUpload.Issue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.title_ = title_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.count_ = count_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.documentationUri_ = documentationUri_; + } + } + + @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.datasources.v1.FileUpload.Issue) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.FileUpload.Issue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.datasources.v1.FileUpload.Issue other) { + if (other + == com.google.shopping.merchant.datasources.v1.FileUpload.Issue.getDefaultInstance()) + return this; + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getCount() != 0L) { + setCount(other.getCount()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDocumentationUri().isEmpty()) { + documentationUri_ = other.documentationUri_; + bitField0_ |= 0x00000020; + 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: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + code_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + count_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + documentationUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + 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 title_ = ""; + + /** + * + * + *
+       * Output only. The title of the issue, for example, "Item too big".
+       * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The title of the issue, for example, "Item too big".
+       * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The title of the issue, for example, "Item too big".
+       * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + title_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The title of the issue, for example, "Item too big".
+       * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The title of the issue, for example, "Item too big".
+       * 
+ * + * string title = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + title_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+       * Output only. The error description, for example, "Your data source
+       * contains items which have too many attributes, or are too big. These
+       * items will be dropped".
+       * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The error description, for example, "Your data source
+       * contains items which have too many attributes, or are too big. These
+       * items will be dropped".
+       * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The error description, for example, "Your data source
+       * contains items which have too many attributes, or are too big. These
+       * items will be dropped".
+       * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The error description, for example, "Your data source
+       * contains items which have too many attributes, or are too big. These
+       * items will be dropped".
+       * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The error description, for example, "Your data source
+       * contains items which have too many attributes, or are too big. These
+       * items will be dropped".
+       * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + + /** + * + * + *
+       * Output only. The code of the error, for example,
+       * "validation/invalid_value". Returns
+       * "?" if the code is unknown.
+       * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The code. + */ + public java.lang.String getCode() { + java.lang.Object ref = code_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + code_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. The code of the error, for example,
+       * "validation/invalid_value". Returns
+       * "?" if the code is unknown.
+       * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for code. + */ + public com.google.protobuf.ByteString getCodeBytes() { + java.lang.Object ref = code_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + code_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. The code of the error, for example,
+       * "validation/invalid_value". Returns
+       * "?" if the code is unknown.
+       * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + code_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The code of the error, for example,
+       * "validation/invalid_value". Returns
+       * "?" if the code is unknown.
+       * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The code of the error, for example,
+       * "validation/invalid_value". Returns
+       * "?" if the code is unknown.
+       * 
+ * + * string code = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for code to set. + * @return This builder for chaining. + */ + public Builder setCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + code_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private long count_; + + /** + * + * + *
+       * Output only. The number of occurrences of the error in the file upload.
+       * 
+ * + * int64 count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The count. + */ + @java.lang.Override + public long getCount() { + return count_; + } + + /** + * + * + *
+       * Output only. The number of occurrences of the error in the file upload.
+       * 
+ * + * int64 count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The count to set. + * @return This builder for chaining. + */ + public Builder setCount(long value) { + + count_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The number of occurrences of the error in the file upload.
+       * 
+ * + * int64 count = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCount() { + bitField0_ = (bitField0_ & ~0x00000008); + count_ = 0L; + onChanged(); + return this; + } + + private int severity_ = 0; + + /** + * + * + *
+       * Output only. The severity of the issue.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
+       * Output only. The severity of the issue.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + severity_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The severity of the issue.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity getSeverity() { + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity result = + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity.forNumber( + severity_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * Output only. The severity of the issue.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. The severity of the issue.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.Issue.Severity severity = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000010); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object documentationUri_ = ""; + + /** + * + * + *
+       * Output only. Link to the documentation explaining the issue in more
+       * details, if available.
+       * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The documentationUri. + */ + public java.lang.String getDocumentationUri() { + java.lang.Object ref = documentationUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentationUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * Output only. Link to the documentation explaining the issue in more
+       * details, if available.
+       * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for documentationUri. + */ + public com.google.protobuf.ByteString getDocumentationUriBytes() { + java.lang.Object ref = documentationUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentationUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * Output only. Link to the documentation explaining the issue in more
+       * details, if available.
+       * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The documentationUri to set. + * @return This builder for chaining. + */ + public Builder setDocumentationUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentationUri_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Link to the documentation explaining the issue in more
+       * details, if available.
+       * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDocumentationUri() { + documentationUri_ = getDefaultInstance().getDocumentationUri(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+       * Output only. Link to the documentation explaining the issue in more
+       * details, if available.
+       * 
+ * + * string documentation_uri = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for documentationUri to set. + * @return This builder for chaining. + */ + public Builder setDocumentationUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentationUri_ = value; + bitField0_ |= 0x00000020; + 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.datasources.v1.FileUpload.Issue) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.FileUpload.Issue) + private static final com.google.shopping.merchant.datasources.v1.FileUpload.Issue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.FileUpload.Issue(); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload.Issue + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Issue 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.datasources.v1.FileUpload.Issue + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The name of the data source file upload.
+   * Format:
+   * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The name of the data source file upload.
+   * Format:
+   * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_SOURCE_ID_FIELD_NUMBER = 2; + private long dataSourceId_ = 0L; + + /** + * + * + *
+   * Output only. The data source id.
+   * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + @java.lang.Override + public long getDataSourceId() { + return dataSourceId_; + } + + public static final int PROCESSING_STATE_FIELD_NUMBER = 3; + private int processingState_ = 0; + + /** + * + * + *
+   * Output only. The processing state of the data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for processingState. + */ + @java.lang.Override + public int getProcessingStateValue() { + return processingState_; + } + + /** + * + * + *
+   * Output only. The processing state of the data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The processingState. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState + getProcessingState() { + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState result = + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState.forNumber( + processingState_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState.UNRECOGNIZED + : result; + } + + public static final int ISSUES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List issues_; + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getIssuesList() { + return issues_; + } + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder> + getIssuesOrBuilderList() { + return issues_; + } + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getIssuesCount() { + return issues_.size(); + } + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue getIssues(int index) { + return issues_.get(index); + } + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder getIssuesOrBuilder( + int index) { + return issues_.get(index); + } + + public static final int ITEMS_TOTAL_FIELD_NUMBER = 5; + private long itemsTotal_ = 0L; + + /** + * + * + *
+   * Output only. The number of items in the data source that were processed.
+   * 
+ * + * int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsTotal. + */ + @java.lang.Override + public long getItemsTotal() { + return itemsTotal_; + } + + public static final int ITEMS_CREATED_FIELD_NUMBER = 6; + private long itemsCreated_ = 0L; + + /** + * + * + *
+   * Output only. The number of items in the data source that were created.
+   * 
+ * + * int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsCreated. + */ + @java.lang.Override + public long getItemsCreated() { + return itemsCreated_; + } + + public static final int ITEMS_UPDATED_FIELD_NUMBER = 7; + private long itemsUpdated_ = 0L; + + /** + * + * + *
+   * Output only. The number of items in the data source that were updated.
+   * 
+ * + * int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsUpdated. + */ + @java.lang.Override + public long getItemsUpdated() { + return itemsUpdated_; + } + + public static final int UPLOAD_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp uploadTime_; + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the uploadTime field is set. + */ + @java.lang.Override + public boolean hasUploadTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The uploadTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUploadTime() { + return uploadTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : uploadTime_; + } + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder() { + return uploadTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : uploadTime_; + } + + 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 (dataSourceId_ != 0L) { + output.writeInt64(2, dataSourceId_); + } + if (processingState_ + != com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState + .PROCESSING_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, processingState_); + } + for (int i = 0; i < issues_.size(); i++) { + output.writeMessage(4, issues_.get(i)); + } + if (itemsTotal_ != 0L) { + output.writeInt64(5, itemsTotal_); + } + if (itemsCreated_ != 0L) { + output.writeInt64(6, itemsCreated_); + } + if (itemsUpdated_ != 0L) { + output.writeInt64(7, itemsUpdated_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getUploadTime()); + } + 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 (dataSourceId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, dataSourceId_); + } + if (processingState_ + != com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState + .PROCESSING_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, processingState_); + } + for (int i = 0; i < issues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, issues_.get(i)); + } + if (itemsTotal_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, itemsTotal_); + } + if (itemsCreated_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, itemsCreated_); + } + if (itemsUpdated_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, itemsUpdated_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getUploadTime()); + } + 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.datasources.v1.FileUpload)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.FileUpload other = + (com.google.shopping.merchant.datasources.v1.FileUpload) obj; + + if (!getName().equals(other.getName())) return false; + if (getDataSourceId() != other.getDataSourceId()) return false; + if (processingState_ != other.processingState_) return false; + if (!getIssuesList().equals(other.getIssuesList())) return false; + if (getItemsTotal() != other.getItemsTotal()) return false; + if (getItemsCreated() != other.getItemsCreated()) return false; + if (getItemsUpdated() != other.getItemsUpdated()) return false; + if (hasUploadTime() != other.hasUploadTime()) return false; + if (hasUploadTime()) { + if (!getUploadTime().equals(other.getUploadTime())) 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) + DATA_SOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getDataSourceId()); + hash = (37 * hash) + PROCESSING_STATE_FIELD_NUMBER; + hash = (53 * hash) + processingState_; + if (getIssuesCount() > 0) { + hash = (37 * hash) + ISSUES_FIELD_NUMBER; + hash = (53 * hash) + getIssuesList().hashCode(); + } + hash = (37 * hash) + ITEMS_TOTAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getItemsTotal()); + hash = (37 * hash) + ITEMS_CREATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getItemsCreated()); + hash = (37 * hash) + ITEMS_UPDATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getItemsUpdated()); + if (hasUploadTime()) { + hash = (37 * hash) + UPLOAD_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUploadTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload 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.datasources.v1.FileUpload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload 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.datasources.v1.FileUpload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload 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.datasources.v1.FileUpload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload 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.datasources.v1.FileUpload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload 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.datasources.v1.FileUpload 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; + } + + /** + * + * + *
+   * The file upload of a specific data source, that is, the result of the
+   * retrieval of the data source at a certain timestamp computed asynchronously
+   * when the data source processing is finished. Only applicable to file data
+   * sources.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.FileUpload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.FileUpload) + com.google.shopping.merchant.datasources.v1.FileUploadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.FileUpload.class, + com.google.shopping.merchant.datasources.v1.FileUpload.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.FileUpload.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIssuesFieldBuilder(); + getUploadTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + dataSourceId_ = 0L; + processingState_ = 0; + if (issuesBuilder_ == null) { + issues_ = java.util.Collections.emptyList(); + } else { + issues_ = null; + issuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + itemsTotal_ = 0L; + itemsCreated_ = 0L; + itemsUpdated_ = 0L; + uploadTime_ = null; + if (uploadTimeBuilder_ != null) { + uploadTimeBuilder_.dispose(); + uploadTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.FileUpload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload build() { + com.google.shopping.merchant.datasources.v1.FileUpload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload buildPartial() { + com.google.shopping.merchant.datasources.v1.FileUpload result = + new com.google.shopping.merchant.datasources.v1.FileUpload(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.datasources.v1.FileUpload result) { + if (issuesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + issues_ = java.util.Collections.unmodifiableList(issues_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.issues_ = issues_; + } else { + result.issues_ = issuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.merchant.datasources.v1.FileUpload result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dataSourceId_ = dataSourceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.processingState_ = processingState_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.itemsTotal_ = itemsTotal_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.itemsCreated_ = itemsCreated_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.itemsUpdated_ = itemsUpdated_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.uploadTime_ = uploadTimeBuilder_ == null ? uploadTime_ : uploadTimeBuilder_.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.datasources.v1.FileUpload) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.FileUpload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.datasources.v1.FileUpload other) { + if (other == com.google.shopping.merchant.datasources.v1.FileUpload.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getDataSourceId() != 0L) { + setDataSourceId(other.getDataSourceId()); + } + if (other.processingState_ != 0) { + setProcessingStateValue(other.getProcessingStateValue()); + } + if (issuesBuilder_ == null) { + if (!other.issues_.isEmpty()) { + if (issues_.isEmpty()) { + issues_ = other.issues_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureIssuesIsMutable(); + issues_.addAll(other.issues_); + } + onChanged(); + } + } else { + if (!other.issues_.isEmpty()) { + if (issuesBuilder_.isEmpty()) { + issuesBuilder_.dispose(); + issuesBuilder_ = null; + issues_ = other.issues_; + bitField0_ = (bitField0_ & ~0x00000008); + issuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIssuesFieldBuilder() + : null; + } else { + issuesBuilder_.addAllMessages(other.issues_); + } + } + } + if (other.getItemsTotal() != 0L) { + setItemsTotal(other.getItemsTotal()); + } + if (other.getItemsCreated() != 0L) { + setItemsCreated(other.getItemsCreated()); + } + if (other.getItemsUpdated() != 0L) { + setItemsUpdated(other.getItemsUpdated()); + } + if (other.hasUploadTime()) { + mergeUploadTime(other.getUploadTime()); + } + 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: + { + dataSourceId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + processingState_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.shopping.merchant.datasources.v1.FileUpload.Issue m = + input.readMessage( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.parser(), + extensionRegistry); + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(m); + } else { + issuesBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: + { + itemsTotal_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + itemsCreated_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: + { + itemsUpdated_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + input.readMessage(getUploadTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The name of the data source file upload.
+     * Format:
+     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of the data source file upload.
+     * Format:
+     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The name of the data source file upload.
+     * Format:
+     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of the data source file upload.
+     * Format:
+     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The name of the data source file upload.
+     * Format:
+     * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long dataSourceId_; + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + @java.lang.Override + public long getDataSourceId() { + return dataSourceId_; + } + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The dataSourceId to set. + * @return This builder for chaining. + */ + public Builder setDataSourceId(long value) { + + dataSourceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The data source id.
+     * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDataSourceId() { + bitField0_ = (bitField0_ & ~0x00000002); + dataSourceId_ = 0L; + onChanged(); + return this; + } + + private int processingState_ = 0; + + /** + * + * + *
+     * Output only. The processing state of the data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for processingState. + */ + @java.lang.Override + public int getProcessingStateValue() { + return processingState_; + } + + /** + * + * + *
+     * Output only. The processing state of the data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for processingState to set. + * @return This builder for chaining. + */ + public Builder setProcessingStateValue(int value) { + processingState_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The processing state of the data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The processingState. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState + getProcessingState() { + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState result = + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState.forNumber( + processingState_); + return result == null + ? com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState.UNRECOGNIZED + : result; + } + + /** + * + * + *
+     * Output only. The processing state of the data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The processingState to set. + * @return This builder for chaining. + */ + public Builder setProcessingState( + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + processingState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The processing state of the data source.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearProcessingState() { + bitField0_ = (bitField0_ & ~0x00000004); + processingState_ = 0; + onChanged(); + return this; + } + + private java.util.List issues_ = + java.util.Collections.emptyList(); + + private void ensureIssuesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + issues_ = + new java.util.ArrayList( + issues_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileUpload.Issue, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder, + com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder> + issuesBuilder_; + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIssuesList() { + if (issuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(issues_); + } else { + return issuesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getIssuesCount() { + if (issuesBuilder_ == null) { + return issues_.size(); + } else { + return issuesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue getIssues(int index) { + if (issuesBuilder_ == null) { + return issues_.get(index); + } else { + return issuesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIssues( + int index, com.google.shopping.merchant.datasources.v1.FileUpload.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.set(index, value); + onChanged(); + } else { + issuesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setIssues( + int index, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.set(index, builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIssues(com.google.shopping.merchant.datasources.v1.FileUpload.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.add(value); + onChanged(); + } else { + issuesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIssues( + int index, com.google.shopping.merchant.datasources.v1.FileUpload.Issue value) { + if (issuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIssuesIsMutable(); + issues_.add(index, value); + onChanged(); + } else { + issuesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIssues( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addIssues( + int index, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder builderForValue) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.add(index, builderForValue.build()); + onChanged(); + } else { + issuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllIssues( + java.lang.Iterable + values) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, issues_); + onChanged(); + } else { + issuesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearIssues() { + if (issuesBuilder_ == null) { + issues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + issuesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeIssues(int index) { + if (issuesBuilder_ == null) { + ensureIssuesIsMutable(); + issues_.remove(index); + onChanged(); + } else { + issuesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder getIssuesBuilder( + int index) { + return getIssuesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder getIssuesOrBuilder( + int index) { + if (issuesBuilder_ == null) { + return issues_.get(index); + } else { + return issuesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder> + getIssuesOrBuilderList() { + if (issuesBuilder_ != null) { + return issuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(issues_); + } + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder addIssuesBuilder() { + return getIssuesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder addIssuesBuilder( + int index) { + return getIssuesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The list of issues occurring in the data source.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getIssuesBuilderList() { + return getIssuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileUpload.Issue, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder, + com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder> + getIssuesFieldBuilder() { + if (issuesBuilder_ == null) { + issuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.FileUpload.Issue, + com.google.shopping.merchant.datasources.v1.FileUpload.Issue.Builder, + com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder>( + issues_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + issues_ = null; + } + return issuesBuilder_; + } + + private long itemsTotal_; + + /** + * + * + *
+     * Output only. The number of items in the data source that were processed.
+     * 
+ * + * int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsTotal. + */ + @java.lang.Override + public long getItemsTotal() { + return itemsTotal_; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were processed.
+     * 
+ * + * int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The itemsTotal to set. + * @return This builder for chaining. + */ + public Builder setItemsTotal(long value) { + + itemsTotal_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were processed.
+     * 
+ * + * int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearItemsTotal() { + bitField0_ = (bitField0_ & ~0x00000010); + itemsTotal_ = 0L; + onChanged(); + return this; + } + + private long itemsCreated_; + + /** + * + * + *
+     * Output only. The number of items in the data source that were created.
+     * 
+ * + * int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsCreated. + */ + @java.lang.Override + public long getItemsCreated() { + return itemsCreated_; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were created.
+     * 
+ * + * int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The itemsCreated to set. + * @return This builder for chaining. + */ + public Builder setItemsCreated(long value) { + + itemsCreated_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were created.
+     * 
+ * + * int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearItemsCreated() { + bitField0_ = (bitField0_ & ~0x00000020); + itemsCreated_ = 0L; + onChanged(); + return this; + } + + private long itemsUpdated_; + + /** + * + * + *
+     * Output only. The number of items in the data source that were updated.
+     * 
+ * + * int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsUpdated. + */ + @java.lang.Override + public long getItemsUpdated() { + return itemsUpdated_; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were updated.
+     * 
+ * + * int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The itemsUpdated to set. + * @return This builder for chaining. + */ + public Builder setItemsUpdated(long value) { + + itemsUpdated_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The number of items in the data source that were updated.
+     * 
+ * + * int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearItemsUpdated() { + bitField0_ = (bitField0_ & ~0x00000040); + itemsUpdated_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp uploadTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + uploadTimeBuilder_; + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the uploadTime field is set. + */ + public boolean hasUploadTime() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The uploadTime. + */ + public com.google.protobuf.Timestamp getUploadTime() { + if (uploadTimeBuilder_ == null) { + return uploadTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : uploadTime_; + } else { + return uploadTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUploadTime(com.google.protobuf.Timestamp value) { + if (uploadTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + uploadTime_ = value; + } else { + uploadTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUploadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (uploadTimeBuilder_ == null) { + uploadTime_ = builderForValue.build(); + } else { + uploadTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUploadTime(com.google.protobuf.Timestamp value) { + if (uploadTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && uploadTime_ != null + && uploadTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUploadTimeBuilder().mergeFrom(value); + } else { + uploadTime_ = value; + } + } else { + uploadTimeBuilder_.mergeFrom(value); + } + if (uploadTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUploadTime() { + bitField0_ = (bitField0_ & ~0x00000080); + uploadTime_ = null; + if (uploadTimeBuilder_ != null) { + uploadTimeBuilder_.dispose(); + uploadTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUploadTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUploadTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder() { + if (uploadTimeBuilder_ != null) { + return uploadTimeBuilder_.getMessageOrBuilder(); + } else { + return uploadTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : uploadTime_; + } + } + + /** + * + * + *
+     * Output only. The date at which the file of the data source was uploaded.
+     * 
+ * + * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUploadTimeFieldBuilder() { + if (uploadTimeBuilder_ == null) { + uploadTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUploadTime(), getParentForChildren(), isClean()); + uploadTime_ = null; + } + return uploadTimeBuilder_; + } + + @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.datasources.v1.FileUpload) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.FileUpload) + private static final com.google.shopping.merchant.datasources.v1.FileUpload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.FileUpload(); + } + + public static com.google.shopping.merchant.datasources.v1.FileUpload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileUpload 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.datasources.v1.FileUpload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadName.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadName.java new file mode 100644 index 000000000000..60e024f477b1 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadName.java @@ -0,0 +1,227 @@ +/* + * 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.datasources.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 FileUploadName implements ResourceName { + private static final PathTemplate ACCOUNT_DATASOURCE_FILEUPLOAD = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}"); + private volatile Map fieldValuesMap; + private final String account; + private final String datasource; + private final String fileupload; + + @Deprecated + protected FileUploadName() { + account = null; + datasource = null; + fileupload = null; + } + + private FileUploadName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + datasource = Preconditions.checkNotNull(builder.getDatasource()); + fileupload = Preconditions.checkNotNull(builder.getFileupload()); + } + + public String getAccount() { + return account; + } + + public String getDatasource() { + return datasource; + } + + public String getFileupload() { + return fileupload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FileUploadName of(String account, String datasource, String fileupload) { + return newBuilder() + .setAccount(account) + .setDatasource(datasource) + .setFileupload(fileupload) + .build(); + } + + public static String format(String account, String datasource, String fileupload) { + return newBuilder() + .setAccount(account) + .setDatasource(datasource) + .setFileupload(fileupload) + .build() + .toString(); + } + + public static FileUploadName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_DATASOURCE_FILEUPLOAD.validatedMatch( + formattedString, "FileUploadName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("datasource"), matchMap.get("fileupload")); + } + + 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 (FileUploadName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_DATASOURCE_FILEUPLOAD.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 (datasource != null) { + fieldMapBuilder.put("datasource", datasource); + } + if (fileupload != null) { + fieldMapBuilder.put("fileupload", fileupload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_DATASOURCE_FILEUPLOAD.instantiate( + "account", account, "datasource", datasource, "fileupload", fileupload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + FileUploadName that = ((FileUploadName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.datasource, that.datasource) + && Objects.equals(this.fileupload, that.fileupload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(datasource); + h *= 1000003; + h ^= Objects.hashCode(fileupload); + return h; + } + + /** Builder for accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}. */ + public static class Builder { + private String account; + private String datasource; + private String fileupload; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getDatasource() { + return datasource; + } + + public String getFileupload() { + return fileupload; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setDatasource(String datasource) { + this.datasource = datasource; + return this; + } + + public Builder setFileupload(String fileupload) { + this.fileupload = fileupload; + return this; + } + + private Builder(FileUploadName fileUploadName) { + this.account = fileUploadName.account; + this.datasource = fileUploadName.datasource; + this.fileupload = fileUploadName.fileupload; + } + + public FileUploadName build() { + return new FileUploadName(this); + } + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadOrBuilder.java new file mode 100644 index 000000000000..386420d9f79a --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadOrBuilder.java @@ -0,0 +1,245 @@ +/* + * 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/datasources/v1/fileuploads.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface FileUploadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.FileUpload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of the data source file upload.
+   * Format:
+   * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The name of the data source file upload.
+   * Format:
+   * `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The data source id.
+   * 
+ * + * int64 data_source_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The dataSourceId. + */ + long getDataSourceId(); + + /** + * + * + *
+   * Output only. The processing state of the data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for processingState. + */ + int getProcessingStateValue(); + + /** + * + * + *
+   * Output only. The processing state of the data source.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.FileUpload.ProcessingState processing_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The processingState. + */ + com.google.shopping.merchant.datasources.v1.FileUpload.ProcessingState getProcessingState(); + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getIssuesList(); + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.datasources.v1.FileUpload.Issue getIssues(int index); + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getIssuesCount(); + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getIssuesOrBuilderList(); + + /** + * + * + *
+   * Output only. The list of issues occurring in the data source.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.FileUpload.Issue issues = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.datasources.v1.FileUpload.IssueOrBuilder getIssuesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. The number of items in the data source that were processed.
+   * 
+ * + * int64 items_total = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsTotal. + */ + long getItemsTotal(); + + /** + * + * + *
+   * Output only. The number of items in the data source that were created.
+   * 
+ * + * int64 items_created = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsCreated. + */ + long getItemsCreated(); + + /** + * + * + *
+   * Output only. The number of items in the data source that were updated.
+   * 
+ * + * int64 items_updated = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The itemsUpdated. + */ + long getItemsUpdated(); + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the uploadTime field is set. + */ + boolean hasUploadTime(); + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The uploadTime. + */ + com.google.protobuf.Timestamp getUploadTime(); + + /** + * + * + *
+   * Output only. The date at which the file of the data source was uploaded.
+   * 
+ * + * .google.protobuf.Timestamp upload_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUploadTimeOrBuilder(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsProto.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsProto.java new file mode 100644 index 000000000000..3bffd50c6874 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/FileUploadsProto.java @@ -0,0 +1,169 @@ +/* + * 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/datasources/v1/fileuploads.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public final class FileUploadsProto { + private FileUploadsProto() {} + + 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_datasources_v1_FileUpload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_FileUpload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_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" + + "9google/shopping/merchant/datasources/v1/fileuploads.proto\022\'google.shopping.mer" + + "chant.datasources.v1\032\034google/api/annotat" + + "ions.proto\032\027google/api/client.proto\032\037goo" + + "gle/api/field_behavior.proto\032\031google/api" + + "/resource.proto\032\037google/protobuf/timestamp.proto\"\376\006\n\n" + + "FileUpload\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\033\n" + + "\016data_source_id\030\002 \001(\003B\003\340A\003\022b\n" + + "\020processing_state\030\003 \001(\0162C.google.shopping.merc" + + "hant.datasources.v1.FileUpload.ProcessingStateB\003\340A\003\022N\n" + + "\006issues\030\004 \003(\01329.google.sho" + + "pping.merchant.datasources.v1.FileUpload.IssueB\003\340A\003\022\030\n" + + "\013items_total\030\005 \001(\003B\003\340A\003\022\032\n" + + "\r" + + "items_created\030\006 \001(\003B\003\340A\003\022\032\n\r" + + "items_updated\030\007 \001(\003B\003\340A\003\0224\n" + + "\013upload_time\030\010" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\032\225\002\n" + + "\005Issue\022\022\n" + + "\005title\030\001 \001(\tB\003\340A\003\022\030\n" + + "\013description\030\002 \001(\tB\003\340A\003\022\021\n" + + "\004code\030\003 \001(\tB\003\340A\003\022\022\n" + + "\005count\030\004 \001(\003B\003\340A\003\022Y\n" + + "\010severity\030\005 \001(\0162B.google.shopping.m" + + "erchant.datasources.v1.FileUpload.Issue.SeverityB\003\340A\003\022\036\n" + + "\021documentation_uri\030\006 \001(\tB\003\340A\003\"<\n" + + "\010Severity\022\030\n" + + "\024SEVERITY_UNSPECIFIED\020\000\022\013\n" + + "\007WARNING\020\001\022\t\n" + + "\005ERROR\020\002\"_\n" + + "\017ProcessingState\022 \n" + + "\034PROCESSING_STATE_UNSPECIFIED\020\000\022\n\n" + + "\006FAILED\020\001\022\017\n" + + "\013IN_PROGRESS\020\002\022\r\n" + + "\tSUCCEEDED\020\003:\212\001\352A\206\001\n" + + "%merchantapi.googleapis.com/FileUpload\022Daccounts/{account}/dataSourc" + + "es/{datasource}/fileUploads/{fileupload}*\013fileUploads2\n" + + "fileUpload\"S\n" + + "\024GetFileUploadRequest\022;\n" + + "\004name\030\001 \001(\tB-\340A\002\372A\'\n" + + "%merchantapi.googleapis.com/FileUpload2\261\002\n" + + "\022FileUploadsService\022\321\001\n\r" + + "GetFileUpload\022=.google.shopping.merchant.datasources.v1.GetFil" + + "eUploadRequest\0323.google.shopping.merchan" + + "t.datasources.v1.FileUpload\"L\332A\004name\202\323\344\223" + + "\002?\022=/datasources/v1/{name=accounts/*/dat" + + "aSources/*/fileUploads/*}\032G\312A\032merchantap" + + "i.googleapis.com\322A\'https://www.googleapis.com/auth/contentB\230\002\n" + + "+com.google.shopping.merchant.datasources.v1B\020FileUploadsP" + + "rotoP\001ZScloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;da" + + "tasourcespb\252\002\'Google.Shopping.Merchant.D" + + "ataSources.V1\312\002\'Google\\Shopping\\Merchant" + + "\\DataSources\\V1\352\002+Google::Shopping::Merchant::DataSources::V1b\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.TimestampProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_datasources_v1_FileUpload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor, + new java.lang.String[] { + "Name", + "DataSourceId", + "ProcessingState", + "Issues", + "ItemsTotal", + "ItemsCreated", + "ItemsUpdated", + "UploadTime", + }); + internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor = + internal_static_google_shopping_merchant_datasources_v1_FileUpload_descriptor + .getNestedTypes() + .get(0); + internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_FileUpload_Issue_descriptor, + new java.lang.String[] { + "Title", "Description", "Code", "Count", "Severity", "DocumentationUri", + }); + internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor, + new java.lang.String[] { + "Name", + }); + 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.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.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequest.java new file mode 100644 index 000000000000..5b2d23889b75 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequest.java @@ -0,0 +1,663 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the GetDataSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.GetDataSourceRequest} + */ +public final class GetDataSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.GetDataSourceRequest) + GetDataSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetDataSourceRequest.newBuilder() to construct. + private GetDataSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetDataSourceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetDataSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the data source to retrieve.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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 data source to retrieve.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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.datasources.v1.GetDataSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest other = + (com.google.shopping.merchant.datasources.v1.GetDataSourceRequest) 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.datasources.v1.GetDataSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest 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 GetDataSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.GetDataSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.GetDataSourceRequest) + com.google.shopping.merchant.datasources.v1.GetDataSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.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.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_GetDataSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetDataSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetDataSourceRequest build() { + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetDataSourceRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest result = + new com.google.shopping.merchant.datasources.v1.GetDataSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.GetDataSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.GetDataSourceRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.GetDataSourceRequest.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 data source to retrieve.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to retrieve.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to retrieve.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to retrieve.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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 data source to retrieve.
+     * Format: `accounts/{account}/dataSources/{datasource}`
+     * 
+ * + * + * 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.datasources.v1.GetDataSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.GetDataSourceRequest) + private static final com.google.shopping.merchant.datasources.v1.GetDataSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.GetDataSourceRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.GetDataSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetDataSourceRequest 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.datasources.v1.GetDataSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequestOrBuilder.java new file mode 100644 index 000000000000..e2bf0bd8637f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetDataSourceRequestOrBuilder.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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface GetDataSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.GetDataSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the data source to retrieve.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the data source to retrieve.
+   * Format: `accounts/{account}/dataSources/{datasource}`
+   * 
+ * + * + * 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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequest.java new file mode 100644 index 000000000000..5631d662747a --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequest.java @@ -0,0 +1,670 @@ +/* + * 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/datasources/v1/fileuploads.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the GetFileUploadRequest method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.GetFileUploadRequest} + */ +public final class GetFileUploadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.GetFileUploadRequest) + GetFileUploadRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetFileUploadRequest.newBuilder() to construct. + private GetFileUploadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFileUploadRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFileUploadRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.class, + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The name of the data source file upload to retrieve.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+   * 
+ * + * + * 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 data source file upload to retrieve.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+   * 
+ * + * + * 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.datasources.v1.GetFileUploadRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest other = + (com.google.shopping.merchant.datasources.v1.GetFileUploadRequest) 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.datasources.v1.GetFileUploadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest 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 GetFileUploadRequest method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.GetFileUploadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.GetFileUploadRequest) + com.google.shopping.merchant.datasources.v1.GetFileUploadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.class, + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.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.datasources.v1.FileUploadsProto + .internal_static_google_shopping_merchant_datasources_v1_GetFileUploadRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetFileUploadRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetFileUploadRequest build() { + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.GetFileUploadRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest result = + new com.google.shopping.merchant.datasources.v1.GetFileUploadRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.GetFileUploadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.GetFileUploadRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.GetFileUploadRequest.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 data source file upload to retrieve.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+     * 
+ * + * + * 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 data source file upload to retrieve.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+     * 
+ * + * + * 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 data source file upload to retrieve.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+     * 
+ * + * + * 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 data source file upload to retrieve.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+     * 
+ * + * + * 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 data source file upload to retrieve.
+     * Format:
+     * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+     * 
+ * + * + * 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.datasources.v1.GetFileUploadRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.GetFileUploadRequest) + private static final com.google.shopping.merchant.datasources.v1.GetFileUploadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.GetFileUploadRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.GetFileUploadRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFileUploadRequest 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.datasources.v1.GetFileUploadRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequestOrBuilder.java new file mode 100644 index 000000000000..3036c605e776 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/GetFileUploadRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * 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/datasources/v1/fileuploads.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface GetFileUploadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.GetFileUploadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the data source file upload to retrieve.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The name of the data source file upload to retrieve.
+   * Format:
+   * `accounts/{account}/dataSources/{datasource}/fileUploads/latest`
+   * 
+ * + * + * 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-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequest.java new file mode 100644 index 000000000000..4506d23ab4ef --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequest.java @@ -0,0 +1,993 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the ListDataSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ListDataSourcesRequest} + */ +public final class ListDataSourcesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.ListDataSourcesRequest) + ListDataSourcesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListDataSourcesRequest.newBuilder() to construct. + private ListDataSourcesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDataSourcesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDataSourcesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.class, + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The account to list data sources for.
+   * 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 account to list data sources for.
+   * 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 data sources to return. The service may
+   * return fewer than this value. The maximum value is 1000; values above 1000
+   * will be coerced to 1000. If unspecified, the maximum number of data sources
+   * will be returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDataSources` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDataSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDataSources` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDataSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest other = + (com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest 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.datasources.v1.ListDataSourcesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest 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.datasources.v1.ListDataSourcesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest 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.datasources.v1.ListDataSourcesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + 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.datasources.v1.ListDataSourcesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest 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.datasources.v1.ListDataSourcesRequest 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 ListDataSources method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ListDataSourcesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.ListDataSourcesRequest) + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.class, + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest build() { + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest result = + new com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The account to list data sources for.
+     * 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 account to list data sources for.
+     * 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 account to list data sources for.
+     * 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 account to list data sources for.
+     * 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 account to list data sources for.
+     * 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 data sources to return. The service may
+     * return fewer than this value. The maximum value is 1000; values above 1000
+     * will be coerced to 1000. If unspecified, the maximum number of data sources
+     * will be returned.
+     * 
+ * + * 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 data sources to return. The service may
+     * return fewer than this value. The maximum value is 1000; values above 1000
+     * will be coerced to 1000. If unspecified, the maximum number of data sources
+     * will be returned.
+     * 
+ * + * 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 data sources to return. The service may
+     * return fewer than this value. The maximum value is 1000; values above 1000
+     * will be coerced to 1000. If unspecified, the maximum number of data sources
+     * will be returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDataSources` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDataSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDataSources` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDataSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDataSources` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDataSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDataSources` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDataSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A page token, received from a previous `ListDataSources` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListDataSources`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.datasources.v1.ListDataSourcesRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.ListDataSourcesRequest) + private static final com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDataSourcesRequest 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.datasources.v1.ListDataSourcesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequestOrBuilder.java new file mode 100644 index 000000000000..31556799ff86 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface ListDataSourcesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.ListDataSourcesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account to list data sources for.
+   * Format: `accounts/{account}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The account to list data sources for.
+   * 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 data sources to return. The service may
+   * return fewer than this value. The maximum value is 1000; values above 1000
+   * will be coerced to 1000. If unspecified, the maximum number of data sources
+   * will be returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDataSources` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDataSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListDataSources` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListDataSources`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponse.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponse.java new file mode 100644 index 000000000000..342fd9b70834 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponse.java @@ -0,0 +1,1182 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Response message for the ListDataSources method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ListDataSourcesResponse} + */ +public final class ListDataSourcesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.ListDataSourcesResponse) + ListDataSourcesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListDataSourcesResponse.newBuilder() to construct. + private ListDataSourcesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListDataSourcesResponse() { + dataSources_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListDataSourcesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.class, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.Builder.class); + } + + public static final int DATA_SOURCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List dataSources_; + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + @java.lang.Override + public java.util.List + getDataSourcesList() { + return dataSources_; + } + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + @java.lang.Override + public java.util.List + getDataSourcesOrBuilderList() { + return dataSources_; + } + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + @java.lang.Override + public int getDataSourcesCount() { + return dataSources_.size(); + } + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource getDataSources(int index) { + return dataSources_.get(index); + } + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourcesOrBuilder( + int index) { + return dataSources_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dataSources_.size(); i++) { + output.writeMessage(1, dataSources_.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 < dataSources_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dataSources_.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.datasources.v1.ListDataSourcesResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse other = + (com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse) obj; + + if (!getDataSourcesList().equals(other.getDataSourcesList())) 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 (getDataSourcesCount() > 0) { + hash = (37 * hash) + DATA_SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getDataSourcesList().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.datasources.v1.ListDataSourcesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + 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.datasources.v1.ListDataSourcesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse 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 ListDataSources method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ListDataSourcesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.ListDataSourcesResponse) + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.class, + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (dataSourcesBuilder_ == null) { + dataSources_ = java.util.Collections.emptyList(); + } else { + dataSources_ = null; + dataSourcesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_ListDataSourcesResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse build() { + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse buildPartial() { + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse result = + new com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse result) { + if (dataSourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + dataSources_ = java.util.Collections.unmodifiableList(dataSources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dataSources_ = dataSources_; + } else { + result.dataSources_ = dataSourcesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse other) { + if (other + == com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + .getDefaultInstance()) return this; + if (dataSourcesBuilder_ == null) { + if (!other.dataSources_.isEmpty()) { + if (dataSources_.isEmpty()) { + dataSources_ = other.dataSources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDataSourcesIsMutable(); + dataSources_.addAll(other.dataSources_); + } + onChanged(); + } + } else { + if (!other.dataSources_.isEmpty()) { + if (dataSourcesBuilder_.isEmpty()) { + dataSourcesBuilder_.dispose(); + dataSourcesBuilder_ = null; + dataSources_ = other.dataSources_; + bitField0_ = (bitField0_ & ~0x00000001); + dataSourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDataSourcesFieldBuilder() + : null; + } else { + dataSourcesBuilder_.addAllMessages(other.dataSources_); + } + } + } + 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.datasources.v1.DataSource m = + input.readMessage( + com.google.shopping.merchant.datasources.v1.DataSource.parser(), + extensionRegistry); + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + dataSources_.add(m); + } else { + dataSourcesBuilder_.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 dataSources_ = + java.util.Collections.emptyList(); + + private void ensureDataSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dataSources_ = + new java.util.ArrayList( + dataSources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + dataSourcesBuilder_; + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public java.util.List + getDataSourcesList() { + if (dataSourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(dataSources_); + } else { + return dataSourcesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public int getDataSourcesCount() { + if (dataSourcesBuilder_ == null) { + return dataSources_.size(); + } else { + return dataSourcesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public com.google.shopping.merchant.datasources.v1.DataSource getDataSources(int index) { + if (dataSourcesBuilder_ == null) { + return dataSources_.get(index); + } else { + return dataSourcesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder setDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSourcesIsMutable(); + dataSources_.set(index, value); + onChanged(); + } else { + dataSourcesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder setDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSource.Builder builderForValue) { + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + dataSources_.set(index, builderForValue.build()); + onChanged(); + } else { + dataSourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder addDataSources(com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSourcesIsMutable(); + dataSources_.add(value); + onChanged(); + } else { + dataSourcesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder addDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataSourcesIsMutable(); + dataSources_.add(index, value); + onChanged(); + } else { + dataSourcesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder addDataSources( + com.google.shopping.merchant.datasources.v1.DataSource.Builder builderForValue) { + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + dataSources_.add(builderForValue.build()); + onChanged(); + } else { + dataSourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder addDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSource.Builder builderForValue) { + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + dataSources_.add(index, builderForValue.build()); + onChanged(); + } else { + dataSourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder addAllDataSources( + java.lang.Iterable + values) { + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataSources_); + onChanged(); + } else { + dataSourcesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder clearDataSources() { + if (dataSourcesBuilder_ == null) { + dataSources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + dataSourcesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public Builder removeDataSources(int index) { + if (dataSourcesBuilder_ == null) { + ensureDataSourcesIsMutable(); + dataSources_.remove(index); + onChanged(); + } else { + dataSourcesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public com.google.shopping.merchant.datasources.v1.DataSource.Builder getDataSourcesBuilder( + int index) { + return getDataSourcesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourcesOrBuilder( + int index) { + if (dataSourcesBuilder_ == null) { + return dataSources_.get(index); + } else { + return dataSourcesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public java.util.List + getDataSourcesOrBuilderList() { + if (dataSourcesBuilder_ != null) { + return dataSourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dataSources_); + } + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public com.google.shopping.merchant.datasources.v1.DataSource.Builder addDataSourcesBuilder() { + return getDataSourcesFieldBuilder() + .addBuilder(com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance()); + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public com.google.shopping.merchant.datasources.v1.DataSource.Builder addDataSourcesBuilder( + int index) { + return getDataSourcesFieldBuilder() + .addBuilder( + index, com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance()); + } + + /** + * + * + *
+     * The data sources from the specified account.
+     * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + public java.util.List + getDataSourcesBuilderList() { + return getDataSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + getDataSourcesFieldBuilder() { + if (dataSourcesBuilder_ == null) { + dataSourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder>( + dataSources_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + dataSources_ = null; + } + return dataSourcesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.datasources.v1.ListDataSourcesResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.ListDataSourcesResponse) + private static final com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse(); + } + + public static com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListDataSourcesResponse 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.datasources.v1.ListDataSourcesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponseOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponseOrBuilder.java new file mode 100644 index 000000000000..a5d0f9e89327 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ListDataSourcesResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface ListDataSourcesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.ListDataSourcesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + java.util.List getDataSourcesList(); + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + com.google.shopping.merchant.datasources.v1.DataSource getDataSources(int index); + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + int getDataSourcesCount(); + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + java.util.List + getDataSourcesOrBuilderList(); + + /** + * + * + *
+   * The data sources from the specified account.
+   * 
+ * + * repeated .google.shopping.merchant.datasources.v1.DataSource data_sources = 1; + */ + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourcesOrBuilder( + int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSource.java new file mode 100644 index 000000000000..3b78fb9a8f5d --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSource.java @@ -0,0 +1,921 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The local inventory data source type is only available for file inputs and
+ * can't be used to create API local inventory data sources.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.LocalInventoryDataSource} + */ +public final class LocalInventoryDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.LocalInventoryDataSource) + LocalInventoryDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LocalInventoryDataSource.newBuilder() to construct. + private LocalInventoryDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalInventoryDataSource() { + feedLabel_ = ""; + contentLanguage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalInventoryDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.class, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder.class); + } + + public static final int FEED_LABEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the local
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + @java.lang.Override + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + 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(); + feedLabel_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the local
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the local inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the local inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = 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(feedLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, feedLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contentLanguage_); + } + 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(feedLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, feedLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, contentLanguage_); + } + 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.datasources.v1.LocalInventoryDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource other = + (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) obj; + + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) 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) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource 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.datasources.v1.LocalInventoryDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource 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.datasources.v1.LocalInventoryDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource 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.datasources.v1.LocalInventoryDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + 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.datasources.v1.LocalInventoryDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource 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.datasources.v1.LocalInventoryDataSource 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; + } + + /** + * + * + *
+   * The local inventory data source type is only available for file inputs and
+   * can't be used to create API local inventory data sources.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.LocalInventoryDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.LocalInventoryDataSource) + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.class, + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + feedLabel_ = ""; + contentLanguage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_LocalInventoryDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource build() { + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource result = + new com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.feedLabel_ = feedLabel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contentLanguage_ = contentLanguage_; + } + } + + @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.datasources.v1.LocalInventoryDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + .getDefaultInstance()) return this; + if (!other.getFeedLabel().isEmpty()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + 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 34: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 34 + case 42: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 42 + 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 feedLabel_ = ""; + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the local
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + feedLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the local
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the local
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the local
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the local
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the local inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the local inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the local inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentLanguage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the local inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the local inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentLanguage_ = 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.datasources.v1.LocalInventoryDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.LocalInventoryDataSource) + private static final com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.LocalInventoryDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalInventoryDataSource 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.datasources.v1.LocalInventoryDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSourceOrBuilder.java new file mode 100644 index 000000000000..60ca345ea611 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/LocalInventoryDataSourceOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface LocalInventoryDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.LocalInventoryDataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the local
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the local
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the local inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the local inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSource.java new file mode 100644 index 000000000000..29b372c296bf --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSource.java @@ -0,0 +1,445 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The merchant review data source.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.MerchantReviewDataSource} + */ +public final class MerchantReviewDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.MerchantReviewDataSource) + MerchantReviewDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MerchantReviewDataSource.newBuilder() to construct. + private MerchantReviewDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MerchantReviewDataSource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MerchantReviewDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.class, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource other = + (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource 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.datasources.v1.MerchantReviewDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource 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.datasources.v1.MerchantReviewDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource 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.datasources.v1.MerchantReviewDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + 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.datasources.v1.MerchantReviewDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource 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.datasources.v1.MerchantReviewDataSource 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; + } + + /** + * + * + *
+   * The merchant review data source.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.MerchantReviewDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.MerchantReviewDataSource) + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.class, + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_MerchantReviewDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource build() { + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource result = + new com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.datasources.v1.MerchantReviewDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.MerchantReviewDataSource) + private static final com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.MerchantReviewDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MerchantReviewDataSource 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.datasources.v1.MerchantReviewDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSourceOrBuilder.java new file mode 100644 index 000000000000..7f2bfec8b555 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/MerchantReviewDataSourceOrBuilder.java @@ -0,0 +1,25 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface MerchantReviewDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.MerchantReviewDataSource) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSource.java new file mode 100644 index 000000000000..eae46e842a4f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSource.java @@ -0,0 +1,5747 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The primary data source for local and online products.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.PrimaryProductDataSource} + */ +public final class PrimaryProductDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource) + PrimaryProductDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PrimaryProductDataSource.newBuilder() to construct. + private PrimaryProductDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PrimaryProductDataSource() { + feedLabel_ = ""; + contentLanguage_ = ""; + countries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + destinations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PrimaryProductDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder.class); + } + + public interface DefaultRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getTakeFromDataSourcesList(); + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceReference getTakeFromDataSources( + int index); + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getTakeFromDataSourcesCount(); + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getTakeFromDataSourcesOrBuilderList(); + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getTakeFromDataSourcesOrBuilder(int index); + } + + /** + * + * + *
+   * Default rule management of the data source.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule} + */ + public static final class DefaultRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) + DefaultRuleOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DefaultRule.newBuilder() to construct. + private DefaultRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DefaultRule() { + takeFromDataSources_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DefaultRule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .Builder.class); + } + + public static final int TAKE_FROM_DATA_SOURCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + takeFromDataSources_; + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getTakeFromDataSourcesList() { + return takeFromDataSources_; + } + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getTakeFromDataSourcesOrBuilderList() { + return takeFromDataSources_; + } + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getTakeFromDataSourcesCount() { + return takeFromDataSources_.size(); + } + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReference getTakeFromDataSources( + int index) { + return takeFromDataSources_.get(index); + } + + /** + * + * + *
+     * Required. The list of data sources linked in the [default
+     * rule](https://support.google.com/merchants/answer/7450276).
+     * This list is ordered by the default rule priority of joining the data.
+     * It might include none or multiple references to `self` and supplemental
+     * data sources.
+     *
+     * The list must not be empty.
+     *
+     * To link the data source to the default rule, you need to add a
+     * new reference to this list (in sequential order).
+     *
+     * To unlink the data source from the default rule, you need to
+     * remove the given reference from this list.
+     *
+     * Changing the order of this list will result in changing the priority of
+     * data sources in the default rule.
+     *
+     * For example, providing the following list: [`1001`, `self`] will
+     * take attribute values from supplemental data source `1001`, and fallback
+     * to `self` if the attribute is not set in `1001`.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getTakeFromDataSourcesOrBuilder(int index) { + return takeFromDataSources_.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 { + for (int i = 0; i < takeFromDataSources_.size(); i++) { + output.writeMessage(1, takeFromDataSources_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < takeFromDataSources_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, takeFromDataSources_.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.datasources.v1.PrimaryProductDataSource.DefaultRule)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule other = + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) obj; + + if (!getTakeFromDataSourcesList().equals(other.getTakeFromDataSourcesList())) 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 (getTakeFromDataSourcesCount() > 0) { + hash = (37 * hash) + TAKE_FROM_DATA_SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getTakeFromDataSourcesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + 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.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + 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.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + 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.datasources.v1.PrimaryProductDataSource.DefaultRule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + 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.datasources.v1.PrimaryProductDataSource.DefaultRule + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + 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.datasources.v1.PrimaryProductDataSource.DefaultRule + 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; + } + + /** + * + * + *
+     * Default rule management of the data source.
+     * 
+ * + * Protobuf type {@code + * google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (takeFromDataSourcesBuilder_ == null) { + takeFromDataSources_ = java.util.Collections.emptyList(); + } else { + takeFromDataSources_ = null; + takeFromDataSourcesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_DefaultRule_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + build() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + buildPartial() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule result = + new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule result) { + if (takeFromDataSourcesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + takeFromDataSources_ = java.util.Collections.unmodifiableList(takeFromDataSources_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.takeFromDataSources_ = takeFromDataSources_; + } else { + result.takeFromDataSources_ = takeFromDataSourcesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule result) { + int from_bitField0_ = 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.datasources.v1.PrimaryProductDataSource.DefaultRule) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule other) { + if (other + == com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance()) return this; + if (takeFromDataSourcesBuilder_ == null) { + if (!other.takeFromDataSources_.isEmpty()) { + if (takeFromDataSources_.isEmpty()) { + takeFromDataSources_ = other.takeFromDataSources_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.addAll(other.takeFromDataSources_); + } + onChanged(); + } + } else { + if (!other.takeFromDataSources_.isEmpty()) { + if (takeFromDataSourcesBuilder_.isEmpty()) { + takeFromDataSourcesBuilder_.dispose(); + takeFromDataSourcesBuilder_ = null; + takeFromDataSources_ = other.takeFromDataSources_; + bitField0_ = (bitField0_ & ~0x00000001); + takeFromDataSourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTakeFromDataSourcesFieldBuilder() + : null; + } else { + takeFromDataSourcesBuilder_.addAllMessages(other.takeFromDataSources_); + } + } + } + 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.datasources.v1.DataSourceReference m = + input.readMessage( + com.google.shopping.merchant.datasources.v1.DataSourceReference.parser(), + extensionRegistry); + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.add(m); + } else { + takeFromDataSourcesBuilder_.addMessage(m); + } + 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.util.List + takeFromDataSources_ = java.util.Collections.emptyList(); + + private void ensureTakeFromDataSourcesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + takeFromDataSources_ = + new java.util.ArrayList< + com.google.shopping.merchant.datasources.v1.DataSourceReference>( + takeFromDataSources_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + takeFromDataSourcesBuilder_; + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getTakeFromDataSourcesList() { + if (takeFromDataSourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(takeFromDataSources_); + } else { + return takeFromDataSourcesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getTakeFromDataSourcesCount() { + if (takeFromDataSourcesBuilder_ == null) { + return takeFromDataSources_.size(); + } else { + return takeFromDataSourcesBuilder_.getCount(); + } + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference getTakeFromDataSources( + int index) { + if (takeFromDataSourcesBuilder_ == null) { + return takeFromDataSources_.get(index); + } else { + return takeFromDataSourcesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTakeFromDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (takeFromDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.set(index, value); + onChanged(); + } else { + takeFromDataSourcesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTakeFromDataSources( + int index, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.set(index, builderForValue.build()); + onChanged(); + } else { + takeFromDataSourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTakeFromDataSources( + com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (takeFromDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.add(value); + onChanged(); + } else { + takeFromDataSourcesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTakeFromDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (takeFromDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.add(index, value); + onChanged(); + } else { + takeFromDataSourcesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTakeFromDataSources( + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.add(builderForValue.build()); + onChanged(); + } else { + takeFromDataSourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addTakeFromDataSources( + int index, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.add(index, builderForValue.build()); + onChanged(); + } else { + takeFromDataSourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllTakeFromDataSources( + java.lang.Iterable< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReference> + values) { + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, takeFromDataSources_); + onChanged(); + } else { + takeFromDataSourcesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTakeFromDataSources() { + if (takeFromDataSourcesBuilder_ == null) { + takeFromDataSources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + takeFromDataSourcesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeTakeFromDataSources(int index) { + if (takeFromDataSourcesBuilder_ == null) { + ensureTakeFromDataSourcesIsMutable(); + takeFromDataSources_.remove(index); + onChanged(); + } else { + takeFromDataSourcesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + getTakeFromDataSourcesBuilder(int index) { + return getTakeFromDataSourcesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getTakeFromDataSourcesOrBuilder(int index) { + if (takeFromDataSourcesBuilder_ == null) { + return takeFromDataSources_.get(index); + } else { + return takeFromDataSourcesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getTakeFromDataSourcesOrBuilderList() { + if (takeFromDataSourcesBuilder_ != null) { + return takeFromDataSourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(takeFromDataSources_); + } + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + addTakeFromDataSourcesBuilder() { + return getTakeFromDataSourcesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.datasources.v1.DataSourceReference + .getDefaultInstance()); + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + addTakeFromDataSourcesBuilder(int index) { + return getTakeFromDataSourcesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.datasources.v1.DataSourceReference + .getDefaultInstance()); + } + + /** + * + * + *
+       * Required. The list of data sources linked in the [default
+       * rule](https://support.google.com/merchants/answer/7450276).
+       * This list is ordered by the default rule priority of joining the data.
+       * It might include none or multiple references to `self` and supplemental
+       * data sources.
+       *
+       * The list must not be empty.
+       *
+       * To link the data source to the default rule, you need to add a
+       * new reference to this list (in sequential order).
+       *
+       * To unlink the data source from the default rule, you need to
+       * remove the given reference from this list.
+       *
+       * Changing the order of this list will result in changing the priority of
+       * data sources in the default rule.
+       *
+       * For example, providing the following list: [`1001`, `self`] will
+       * take attribute values from supplemental data source `1001`, and fallback
+       * to `self` if the attribute is not set in `1001`.
+       * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference take_from_data_sources = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getTakeFromDataSourcesBuilderList() { + return getTakeFromDataSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getTakeFromDataSourcesFieldBuilder() { + if (takeFromDataSourcesBuilder_ == null) { + takeFromDataSourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder>( + takeFromDataSources_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + takeFromDataSources_ = null; + } + return takeFromDataSourcesBuilder_; + } + + @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.datasources.v1.PrimaryProductDataSource.DefaultRule) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule) + private static final com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DefaultRule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule(); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DefaultRule 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.datasources.v1.PrimaryProductDataSource.DefaultRule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+     * (also known as destination) selections.
+     * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + int getDestinationValue(); + + /** + * + * + *
+     * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+     * (also known as destination) selections.
+     * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The destination. + */ + com.google.shopping.type.Destination.DestinationEnum getDestination(); + + /** + * + * + *
+     * The state of the destination.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+     * The state of the destination.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The state. + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + getState(); + } + + /** + * + * + *
+   * Destinations also known as [Marketing
+   * methods](https://support.google.com/merchants/answer/15130232) selections.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination} + */ + public static final class Destination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) + DestinationOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Destination.newBuilder() to construct. + private Destination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Destination() { + destination_ = 0; + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Destination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder.class); + } + + /** + * + * + *
+     * The state of the destination.
+     * 
+ * + * Protobuf enum {@code + * google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not specified.
+       * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+       * Indicates that the destination is enabled.
+       * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+       * Indicates that the destination is disabled.
+       * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not specified.
+       * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * Indicates that the destination is enabled.
+       * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + + /** + * + * + *
+       * Indicates that the destination is disabled.
+       * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_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 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 ENABLED; + case 2: + return DISABLED; + 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.datasources.v1.PrimaryProductDataSource.Destination + .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.datasources.v1.PrimaryProductDataSource.Destination.State) + } + + public static final int DESTINATION_FIELD_NUMBER = 1; + private int destination_ = 0; + + /** + * + * + *
+     * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+     * (also known as destination) selections.
+     * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override + public int getDestinationValue() { + return destination_; + } + + /** + * + * + *
+     * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+     * (also known as destination) selections.
+     * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.shopping.type.Destination.DestinationEnum getDestination() { + com.google.shopping.type.Destination.DestinationEnum result = + com.google.shopping.type.Destination.DestinationEnum.forNumber(destination_); + return result == null + ? com.google.shopping.type.Destination.DestinationEnum.UNRECOGNIZED + : result; + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_ = 0; + + /** + * + * + *
+     * The state of the destination.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * The state of the destination.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + getState() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + result = + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + .forNumber(state_); + return result == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + .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 (destination_ + != com.google.shopping.type.Destination.DestinationEnum.DESTINATION_ENUM_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, destination_); + } + if (state_ + != com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + .STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destination_ + != com.google.shopping.type.Destination.DestinationEnum.DESTINATION_ENUM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, destination_); + } + if (state_ + != com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + .STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + 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.datasources.v1.PrimaryProductDataSource.Destination)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination other = + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) obj; + + if (destination_ != other.destination_) return false; + if (state_ != other.state_) 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) + destination_; + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + 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.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + 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.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + 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.datasources.v1.PrimaryProductDataSource.Destination + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + 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.datasources.v1.PrimaryProductDataSource.Destination + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + 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.datasources.v1.PrimaryProductDataSource.Destination + 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; + } + + /** + * + * + *
+     * Destinations also known as [Marketing
+     * methods](https://support.google.com/merchants/answer/15130232) selections.
+     * 
+ * + * Protobuf type {@code + * google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destination_ = 0; + state_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_Destination_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + build() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + buildPartial() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination result = + new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.destination_ = destination_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + } + + @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.datasources.v1.PrimaryProductDataSource.Destination) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination other) { + if (other + == com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .getDefaultInstance()) return this; + if (other.destination_ != 0) { + setDestinationValue(other.getDestinationValue()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + 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: + { + destination_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + state_ = input.readEnum(); + 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 int destination_ = 0; + + /** + * + * + *
+       * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+       * (also known as destination) selections.
+       * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The enum numeric value on the wire for destination. + */ + @java.lang.Override + public int getDestinationValue() { + return destination_; + } + + /** + * + * + *
+       * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+       * (also known as destination) selections.
+       * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @param value The enum numeric value on the wire for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationValue(int value) { + destination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+       * (also known as destination) selections.
+       * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public com.google.shopping.type.Destination.DestinationEnum getDestination() { + com.google.shopping.type.Destination.DestinationEnum result = + com.google.shopping.type.Destination.DestinationEnum.forNumber(destination_); + return result == null + ? com.google.shopping.type.Destination.DestinationEnum.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+       * (also known as destination) selections.
+       * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(com.google.shopping.type.Destination.DestinationEnum value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + destination_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * [Marketing methods](https://support.google.com/merchants/answer/15130232)
+       * (also known as destination) selections.
+       * 
+ * + * .google.shopping.type.Destination.DestinationEnum destination = 1; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + bitField0_ = (bitField0_ & ~0x00000001); + destination_ = 0; + onChanged(); + return this; + } + + private int state_ = 0; + + /** + * + * + *
+       * The state of the destination.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+       * The state of the destination.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * The state of the destination.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + getState() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + result = + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .State.forNumber(state_); + return result == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + .UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The state of the destination.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The state of the destination.
+       * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.State state = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 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.datasources.v1.PrimaryProductDataSource.Destination) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination) + private static final com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .Destination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination(); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Destination 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.datasources.v1.PrimaryProductDataSource.Destination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int LEGACY_LOCAL_FIELD_NUMBER = 11; + private boolean legacyLocal_ = false; + + /** + * + * + *
+   * Optional. Immutable. Determines whether the products of this data source
+   * are **only** targeting local destinations. Legacy local products are
+   * prefixed with `local~` in the product resource ID. For example,
+   * `accounts/123/products/local~en~US~sku123`.
+   * 
+ * + * + * bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The legacyLocal. + */ + @java.lang.Override + public boolean getLegacyLocal() { + return legacyLocal_; + } + + public static final int FEED_LABEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + @java.lang.Override + public boolean hasFeedLabel() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + @java.lang.Override + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + 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(); + feedLabel_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + @java.lang.Override + public boolean hasContentLanguage() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COUNTRIES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList countries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the countries. + */ + public com.google.protobuf.ProtocolStringList getCountriesList() { + return countries_; + } + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of countries. + */ + public int getCountriesCount() { + return countries_.size(); + } + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The countries at the given index. + */ + public java.lang.String getCountries(int index) { + return countries_.get(index); + } + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the countries at the given index. + */ + public com.google.protobuf.ByteString getCountriesBytes(int index) { + return countries_.getByteString(index); + } + + public static final int DEFAULT_RULE_FIELD_NUMBER = 7; + private com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + defaultRule_; + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the defaultRule field is set. + */ + @java.lang.Override + public boolean hasDefaultRule() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The defaultRule. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + getDefaultRule() { + return defaultRule_ == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance() + : defaultRule_; + } + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleOrBuilder + getDefaultRuleOrBuilder() { + return defaultRule_ == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance() + : defaultRule_; + } + + public static final int CONTAINS_CUSTOM_RULES_FIELD_NUMBER = 9; + private boolean containsCustomRules_ = false; + + /** + * + * + *
+   * Output only. The existing data source setup contains at least one custom
+   * (non-default) rule and therefore its management through the
+   * `default_rule_data_sources` field should be treated with caution.
+   * 
+ * + * bool contains_custom_rules = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The containsCustomRules. + */ + @java.lang.Override + public boolean getContainsCustomRules() { + return containsCustomRules_; + } + + public static final int DESTINATIONS_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private java.util.List< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination> + destinations_; + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination> + getDestinationsList() { + return destinations_; + } + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder> + getDestinationsOrBuilderList() { + return destinations_; + } + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getDestinationsCount() { + return destinations_.size(); + } + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + getDestinations(int index) { + return destinations_.get(index); + } + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder + getDestinationsOrBuilder(int index) { + return destinations_.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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, feedLabel_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contentLanguage_); + } + for (int i = 0; i < countries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, countries_.getRaw(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(7, getDefaultRule()); + } + if (containsCustomRules_ != false) { + output.writeBool(9, containsCustomRules_); + } + for (int i = 0; i < destinations_.size(); i++) { + output.writeMessage(10, destinations_.get(i)); + } + if (legacyLocal_ != false) { + output.writeBool(11, legacyLocal_); + } + 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.GeneratedMessageV3.computeStringSize(4, feedLabel_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, contentLanguage_); + } + { + int dataSize = 0; + for (int i = 0; i < countries_.size(); i++) { + dataSize += computeStringSizeNoTag(countries_.getRaw(i)); + } + size += dataSize; + size += 1 * getCountriesList().size(); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getDefaultRule()); + } + if (containsCustomRules_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, containsCustomRules_); + } + for (int i = 0; i < destinations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, destinations_.get(i)); + } + if (legacyLocal_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, legacyLocal_); + } + 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.datasources.v1.PrimaryProductDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource other = + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) obj; + + if (getLegacyLocal() != other.getLegacyLocal()) return false; + if (hasFeedLabel() != other.hasFeedLabel()) return false; + if (hasFeedLabel()) { + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + } + if (hasContentLanguage() != other.hasContentLanguage()) return false; + if (hasContentLanguage()) { + if (!getContentLanguage().equals(other.getContentLanguage())) return false; + } + if (!getCountriesList().equals(other.getCountriesList())) return false; + if (hasDefaultRule() != other.hasDefaultRule()) return false; + if (hasDefaultRule()) { + if (!getDefaultRule().equals(other.getDefaultRule())) return false; + } + if (getContainsCustomRules() != other.getContainsCustomRules()) return false; + if (!getDestinationsList().equals(other.getDestinationsList())) 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) + LEGACY_LOCAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLegacyLocal()); + if (hasFeedLabel()) { + hash = (37 * hash) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + } + if (hasContentLanguage()) { + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + } + if (getCountriesCount() > 0) { + hash = (37 * hash) + COUNTRIES_FIELD_NUMBER; + hash = (53 * hash) + getCountriesList().hashCode(); + } + if (hasDefaultRule()) { + hash = (37 * hash) + DEFAULT_RULE_FIELD_NUMBER; + hash = (53 * hash) + getDefaultRule().hashCode(); + } + hash = (37 * hash) + CONTAINS_CUSTOM_RULES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getContainsCustomRules()); + if (getDestinationsCount() > 0) { + hash = (37 * hash) + DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDestinationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource 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.datasources.v1.PrimaryProductDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource 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.datasources.v1.PrimaryProductDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource 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.datasources.v1.PrimaryProductDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + 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.datasources.v1.PrimaryProductDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource 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.datasources.v1.PrimaryProductDataSource 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; + } + + /** + * + * + *
+   * The primary data source for local and online products.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.PrimaryProductDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.PrimaryProductDataSource) + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.class, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDefaultRuleFieldBuilder(); + getDestinationsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + legacyLocal_ = false; + feedLabel_ = ""; + contentLanguage_ = ""; + countries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + defaultRule_ = null; + if (defaultRuleBuilder_ != null) { + defaultRuleBuilder_.dispose(); + defaultRuleBuilder_ = null; + } + containsCustomRules_ = false; + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + } else { + destinations_ = null; + destinationsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PrimaryProductDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource build() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource result = + new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource result) { + if (destinationsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + destinations_ = java.util.Collections.unmodifiableList(destinations_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.destinations_ = destinations_; + } else { + result.destinations_ = destinationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.legacyLocal_ = legacyLocal_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.feedLabel_ = feedLabel_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.contentLanguage_ = contentLanguage_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + countries_.makeImmutable(); + result.countries_ = countries_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.defaultRule_ = + defaultRuleBuilder_ == null ? defaultRule_ : defaultRuleBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.containsCustomRules_ = containsCustomRules_; + } + 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.datasources.v1.PrimaryProductDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .getDefaultInstance()) return this; + if (other.getLegacyLocal() != false) { + setLegacyLocal(other.getLegacyLocal()); + } + if (other.hasFeedLabel()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasContentLanguage()) { + contentLanguage_ = other.contentLanguage_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.countries_.isEmpty()) { + if (countries_.isEmpty()) { + countries_ = other.countries_; + bitField0_ |= 0x00000008; + } else { + ensureCountriesIsMutable(); + countries_.addAll(other.countries_); + } + onChanged(); + } + if (other.hasDefaultRule()) { + mergeDefaultRule(other.getDefaultRule()); + } + if (other.getContainsCustomRules() != false) { + setContainsCustomRules(other.getContainsCustomRules()); + } + if (destinationsBuilder_ == null) { + if (!other.destinations_.isEmpty()) { + if (destinations_.isEmpty()) { + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureDestinationsIsMutable(); + destinations_.addAll(other.destinations_); + } + onChanged(); + } + } else { + if (!other.destinations_.isEmpty()) { + if (destinationsBuilder_.isEmpty()) { + destinationsBuilder_.dispose(); + destinationsBuilder_ = null; + destinations_ = other.destinations_; + bitField0_ = (bitField0_ & ~0x00000040); + destinationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDestinationsFieldBuilder() + : null; + } else { + destinationsBuilder_.addAllMessages(other.destinations_); + } + } + } + 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 34: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 34 + case 42: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCountriesIsMutable(); + countries_.add(s); + break; + } // case 50 + case 58: + { + input.readMessage(getDefaultRuleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 72: + { + containsCustomRules_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 72 + case 82: + { + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination m = + input.readMessage( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .Destination.parser(), + extensionRegistry); + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(m); + } else { + destinationsBuilder_.addMessage(m); + } + break; + } // case 82 + case 88: + { + legacyLocal_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 88 + 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 boolean legacyLocal_; + + /** + * + * + *
+     * Optional. Immutable. Determines whether the products of this data source
+     * are **only** targeting local destinations. Legacy local products are
+     * prefixed with `local~` in the product resource ID. For example,
+     * `accounts/123/products/local~en~US~sku123`.
+     * 
+ * + * + * bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The legacyLocal. + */ + @java.lang.Override + public boolean getLegacyLocal() { + return legacyLocal_; + } + + /** + * + * + *
+     * Optional. Immutable. Determines whether the products of this data source
+     * are **only** targeting local destinations. Legacy local products are
+     * prefixed with `local~` in the product resource ID. For example,
+     * `accounts/123/products/local~en~US~sku123`.
+     * 
+ * + * + * bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The legacyLocal to set. + * @return This builder for chaining. + */ + public Builder setLegacyLocal(boolean value) { + + legacyLocal_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. Determines whether the products of this data source
+     * are **only** targeting local destinations. Legacy local products are
+     * prefixed with `local~` in the product resource ID. For example,
+     * `accounts/123/products/local~en~US~sku123`.
+     * 
+ * + * + * bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearLegacyLocal() { + bitField0_ = (bitField0_ & ~0x00000001); + legacyLocal_ = false; + onChanged(); + return this; + } + + private java.lang.Object feedLabel_ = ""; + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + public boolean hasFeedLabel() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + feedLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + feedLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     * They must be set for data sources with a file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + feedLabel_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + public boolean hasContentLanguage() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentLanguage_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept products without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentLanguage_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList countries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCountriesIsMutable() { + if (!countries_.isModifiable()) { + countries_ = new com.google.protobuf.LazyStringArrayList(countries_); + } + bitField0_ |= 0x00000008; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the countries. + */ + public com.google.protobuf.ProtocolStringList getCountriesList() { + countries_.makeImmutable(); + return countries_; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of countries. + */ + public int getCountriesCount() { + return countries_.size(); + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The countries at the given index. + */ + public java.lang.String getCountries(int index) { + return countries_.get(index); + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the countries at the given index. + */ + public com.google.protobuf.ByteString getCountriesBytes(int index) { + return countries_.getByteString(index); + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The countries to set. + * @return This builder for chaining. + */ + public Builder setCountries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCountriesIsMutable(); + countries_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The countries to add. + * @return This builder for chaining. + */ + public Builder addCountries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCountriesIsMutable(); + countries_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The countries to add. + * @return This builder for chaining. + */ + public Builder addAllCountries(java.lang.Iterable values) { + ensureCountriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, countries_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearCountries() { + countries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The countries where the items may be displayed. Represented as a
+     * [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the countries to add. + * @return This builder for chaining. + */ + public Builder addCountriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCountriesIsMutable(); + countries_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + defaultRule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DefaultRuleOrBuilder> + defaultRuleBuilder_; + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the defaultRule field is set. + */ + public boolean hasDefaultRule() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The defaultRule. + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + getDefaultRule() { + if (defaultRuleBuilder_ == null) { + return defaultRule_ == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance() + : defaultRule_; + } else { + return defaultRuleBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDefaultRule( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule value) { + if (defaultRuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + defaultRule_ = value; + } else { + defaultRuleBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDefaultRule( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule.Builder + builderForValue) { + if (defaultRuleBuilder_ == null) { + defaultRule_ = builderForValue.build(); + } else { + defaultRuleBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeDefaultRule( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule value) { + if (defaultRuleBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && defaultRule_ != null + && defaultRule_ + != com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance()) { + getDefaultRuleBuilder().mergeFrom(value); + } else { + defaultRule_ = value; + } + } else { + defaultRuleBuilder_.mergeFrom(value); + } + if (defaultRule_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDefaultRule() { + bitField0_ = (bitField0_ & ~0x00000010); + defaultRule_ = null; + if (defaultRuleBuilder_ != null) { + defaultRuleBuilder_.dispose(); + defaultRuleBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule.Builder + getDefaultRuleBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDefaultRuleFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleOrBuilder + getDefaultRuleOrBuilder() { + if (defaultRuleBuilder_ != null) { + return defaultRuleBuilder_.getMessageOrBuilder(); + } else { + return defaultRule_ == null + ? com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .getDefaultInstance() + : defaultRule_; + } + } + + /** + * + * + *
+     * Optional. Default rule management of the data source. If set, the linked
+     * data sources will be replaced.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DefaultRuleOrBuilder> + getDefaultRuleFieldBuilder() { + if (defaultRuleBuilder_ == null) { + defaultRuleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DefaultRuleOrBuilder>(getDefaultRule(), getParentForChildren(), isClean()); + defaultRule_ = null; + } + return defaultRuleBuilder_; + } + + private boolean containsCustomRules_; + + /** + * + * + *
+     * Output only. The existing data source setup contains at least one custom
+     * (non-default) rule and therefore its management through the
+     * `default_rule_data_sources` field should be treated with caution.
+     * 
+ * + * bool contains_custom_rules = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The containsCustomRules. + */ + @java.lang.Override + public boolean getContainsCustomRules() { + return containsCustomRules_; + } + + /** + * + * + *
+     * Output only. The existing data source setup contains at least one custom
+     * (non-default) rule and therefore its management through the
+     * `default_rule_data_sources` field should be treated with caution.
+     * 
+ * + * bool contains_custom_rules = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The containsCustomRules to set. + * @return This builder for chaining. + */ + public Builder setContainsCustomRules(boolean value) { + + containsCustomRules_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The existing data source setup contains at least one custom
+     * (non-default) rule and therefore its management through the
+     * `default_rule_data_sources` field should be treated with caution.
+     * 
+ * + * bool contains_custom_rules = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearContainsCustomRules() { + bitField0_ = (bitField0_ & ~0x00000020); + containsCustomRules_ = false; + onChanged(); + return this; + } + + private java.util.List< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination> + destinations_ = java.util.Collections.emptyList(); + + private void ensureDestinationsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + destinations_ = + new java.util.ArrayList< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination>( + destinations_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder> + destinationsBuilder_; + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination> + getDestinationsList() { + if (destinationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(destinations_); + } else { + return destinationsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getDestinationsCount() { + if (destinationsBuilder_ == null) { + return destinations_.size(); + } else { + return destinationsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + getDestinations(int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDestinations( + int index, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.set(index, value); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setDestinations( + int index, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.set(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(value); + onChanged(); + } else { + destinationsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + int index, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination value) { + if (destinationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationsIsMutable(); + destinations_.add(index, value); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addDestinations( + int index, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + builderForValue) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.add(index, builderForValue.build()); + onChanged(); + } else { + destinationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllDestinations( + java.lang.Iterable< + ? extends + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .Destination> + values) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinations_); + onChanged(); + } else { + destinationsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearDestinations() { + if (destinationsBuilder_ == null) { + destinations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + destinationsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeDestinations(int index) { + if (destinationsBuilder_ == null) { + ensureDestinationsIsMutable(); + destinations_.remove(index); + onChanged(); + } else { + destinationsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + getDestinationsBuilder(int index) { + return getDestinationsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder + getDestinationsOrBuilder(int index) { + if (destinationsBuilder_ == null) { + return destinations_.get(index); + } else { + return destinationsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder> + getDestinationsOrBuilderList() { + if (destinationsBuilder_ != null) { + return destinationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(destinations_); + } + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + addDestinationsBuilder() { + return getDestinationsFieldBuilder() + .addBuilder( + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination.Builder + addDestinationsBuilder(int index) { + return getDestinationsFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. A list of destinations describing where products of the data
+     * source can be shown.
+     *
+     * When retrieving the data source, the list contains all the destinations
+     * that can be used for the data source, including the ones that are disabled
+     * for the data source but enabled for the account.
+     *
+     * Only destinations that are enabled on the account, for example through
+     * program participation, can be enabled on the data source.
+     *
+     * If unset, during creation, the destinations will be inherited based on the
+     * account level program participation.
+     *
+     * If set, during creation or update, the data source will be set only for the
+     * specified destinations.
+     *
+     * Updating this field requires at least one destination.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder> + getDestinationsBuilderList() { + return getDestinationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder> + getDestinationsFieldBuilder() { + if (destinationsBuilder_ == null) { + destinationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination + .Builder, + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder>( + destinations_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + destinations_ = null; + } + return destinationsBuilder_; + } + + @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.datasources.v1.PrimaryProductDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.PrimaryProductDataSource) + private static final com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PrimaryProductDataSource 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.datasources.v1.PrimaryProductDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSourceOrBuilder.java new file mode 100644 index 000000000000..4e839cf1ecd0 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PrimaryProductDataSourceOrBuilder.java @@ -0,0 +1,479 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface PrimaryProductDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.PrimaryProductDataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Immutable. Determines whether the products of this data source
+   * are **only** targeting local destinations. Legacy local products are
+   * prefixed with `local~` in the product resource ID. For example,
+   * `accounts/123/products/local~en~US~sku123`.
+   * 
+ * + * + * bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The legacyLocal. + */ + boolean getLegacyLocal(); + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + boolean hasFeedLabel(); + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   * They must be set for data sources with a file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + boolean hasContentLanguage(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept products without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the countries. + */ + java.util.List getCountriesList(); + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of countries. + */ + int getCountriesCount(); + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The countries at the given index. + */ + java.lang.String getCountries(int index); + + /** + * + * + *
+   * Optional. The countries where the items may be displayed. Represented as a
+   * [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   * 
+ * + * repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the countries at the given index. + */ + com.google.protobuf.ByteString getCountriesBytes(int index); + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the defaultRule field is set. + */ + boolean hasDefaultRule(); + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The defaultRule. + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule getDefaultRule(); + + /** + * + * + *
+   * Optional. Default rule management of the data source. If set, the linked
+   * data sources will be replaced.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleOrBuilder + getDefaultRuleOrBuilder(); + + /** + * + * + *
+   * Output only. The existing data source setup contains at least one custom
+   * (non-default) rule and therefore its management through the
+   * `default_rule_data_sources` field should be treated with caution.
+   * 
+ * + * bool contains_custom_rules = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The containsCustomRules. + */ + boolean getContainsCustomRules(); + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getDestinationsList(); + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination getDestinations( + int index); + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getDestinationsCount(); + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource + .DestinationOrBuilder> + getDestinationsOrBuilderList(); + + /** + * + * + *
+   * Optional. A list of destinations describing where products of the data
+   * source can be shown.
+   *
+   * When retrieving the data source, the list contains all the destinations
+   * that can be used for the data source, including the ones that are disabled
+   * for the data source but enabled for the account.
+   *
+   * Only destinations that are enabled on the account, for example through
+   * program participation, can be enabled on the data source.
+   *
+   * If unset, during creation, the destinations will be inherited based on the
+   * account level program participation.
+   *
+   * If set, during creation or update, the data source will be set only for the
+   * specified destinations.
+   *
+   * Updating this field requires at least one destination.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder + getDestinationsOrBuilder(int index); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSource.java new file mode 100644 index 000000000000..aa4ae789f422 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSource.java @@ -0,0 +1,445 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The product review data source.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ProductReviewDataSource} + */ +public final class ProductReviewDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.ProductReviewDataSource) + ProductReviewDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ProductReviewDataSource.newBuilder() to construct. + private ProductReviewDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductReviewDataSource() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductReviewDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.class, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.datasources.v1.ProductReviewDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource other = + (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource 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.datasources.v1.ProductReviewDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource 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.datasources.v1.ProductReviewDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource 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.datasources.v1.ProductReviewDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + 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.datasources.v1.ProductReviewDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource 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.datasources.v1.ProductReviewDataSource 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; + } + + /** + * + * + *
+   * The product review data source.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.ProductReviewDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.ProductReviewDataSource) + com.google.shopping.merchant.datasources.v1.ProductReviewDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.class, + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.ProductReviewDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_ProductReviewDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource build() { + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.ProductReviewDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource result = + new com.google.shopping.merchant.datasources.v1.ProductReviewDataSource(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.ProductReviewDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.ProductReviewDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + .getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.datasources.v1.ProductReviewDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.ProductReviewDataSource) + private static final com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.ProductReviewDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.ProductReviewDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductReviewDataSource 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.datasources.v1.ProductReviewDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSourceOrBuilder.java new file mode 100644 index 000000000000..2da23e45955a --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/ProductReviewDataSourceOrBuilder.java @@ -0,0 +1,25 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface ProductReviewDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.ProductReviewDataSource) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSource.java new file mode 100644 index 000000000000..95a12b05b19e --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSource.java @@ -0,0 +1,901 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The promotion data source.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.PromotionDataSource} + */ +public final class PromotionDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.PromotionDataSource) + PromotionDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PromotionDataSource.newBuilder() to construct. + private PromotionDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PromotionDataSource() { + targetCountry_ = ""; + contentLanguage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PromotionDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PromotionDataSource.class, + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder.class); + } + + public static final int TARGET_COUNTRY_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetCountry_ = ""; + + /** + * + * + *
+   * Required. Immutable. The target country used as part of the unique
+   * identifier. Represented as a [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   *
+   * Promotions are only available in selected
+   * [countries](https://support.google.com/merchants/answer/4588460).
+   * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The targetCountry. + */ + @java.lang.Override + public java.lang.String getTargetCountry() { + java.lang.Object ref = targetCountry_; + 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(); + targetCountry_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The target country used as part of the unique
+   * identifier. Represented as a [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   *
+   * Promotions are only available in selected
+   * [countries](https://support.google.com/merchants/answer/4588460).
+   * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for targetCountry. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetCountryBytes() { + java.lang.Object ref = targetCountry_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetCountry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = 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(targetCountry_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, targetCountry_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, contentLanguage_); + } + 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(targetCountry_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, targetCountry_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, contentLanguage_); + } + 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.datasources.v1.PromotionDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.PromotionDataSource other = + (com.google.shopping.merchant.datasources.v1.PromotionDataSource) obj; + + if (!getTargetCountry().equals(other.getTargetCountry())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) 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) + TARGET_COUNTRY_FIELD_NUMBER; + hash = (53 * hash) + getTargetCountry().hashCode(); + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource 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.datasources.v1.PromotionDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource 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.datasources.v1.PromotionDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource 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.datasources.v1.PromotionDataSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource 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.datasources.v1.PromotionDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource 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.datasources.v1.PromotionDataSource 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; + } + + /** + * + * + *
+   * The promotion data source.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.PromotionDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.PromotionDataSource) + com.google.shopping.merchant.datasources.v1.PromotionDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.PromotionDataSource.class, + com.google.shopping.merchant.datasources.v1.PromotionDataSource.Builder.class); + } + + // Construct using com.google.shopping.merchant.datasources.v1.PromotionDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetCountry_ = ""; + contentLanguage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_PromotionDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSource build() { + com.google.shopping.merchant.datasources.v1.PromotionDataSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.PromotionDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.PromotionDataSource result = + new com.google.shopping.merchant.datasources.v1.PromotionDataSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.PromotionDataSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetCountry_ = targetCountry_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contentLanguage_ = contentLanguage_; + } + } + + @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.datasources.v1.PromotionDataSource) { + return mergeFrom((com.google.shopping.merchant.datasources.v1.PromotionDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.PromotionDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.PromotionDataSource.getDefaultInstance()) + return this; + if (!other.getTargetCountry().isEmpty()) { + targetCountry_ = other.targetCountry_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + 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: + { + targetCountry_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object targetCountry_ = ""; + + /** + * + * + *
+     * Required. Immutable. The target country used as part of the unique
+     * identifier. Represented as a [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     *
+     * Promotions are only available in selected
+     * [countries](https://support.google.com/merchants/answer/4588460).
+     * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The targetCountry. + */ + public java.lang.String getTargetCountry() { + java.lang.Object ref = targetCountry_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetCountry_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The target country used as part of the unique
+     * identifier. Represented as a [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     *
+     * Promotions are only available in selected
+     * [countries](https://support.google.com/merchants/answer/4588460).
+     * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for targetCountry. + */ + public com.google.protobuf.ByteString getTargetCountryBytes() { + java.lang.Object ref = targetCountry_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetCountry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The target country used as part of the unique
+     * identifier. Represented as a [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     *
+     * Promotions are only available in selected
+     * [countries](https://support.google.com/merchants/answer/4588460).
+     * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The targetCountry to set. + * @return This builder for chaining. + */ + public Builder setTargetCountry(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetCountry_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The target country used as part of the unique
+     * identifier. Represented as a [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     *
+     * Promotions are only available in selected
+     * [countries](https://support.google.com/merchants/answer/4588460).
+     * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetCountry() { + targetCountry_ = getDefaultInstance().getTargetCountry(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The target country used as part of the unique
+     * identifier. Represented as a [CLDR territory
+     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+     *
+     * Promotions are only available in selected
+     * [countries](https://support.google.com/merchants/answer/4588460).
+     * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for targetCountry to set. + * @return This builder for chaining. + */ + public Builder setTargetCountryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetCountry_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentLanguage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentLanguage_ = 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.datasources.v1.PromotionDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.PromotionDataSource) + private static final com.google.shopping.merchant.datasources.v1.PromotionDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.PromotionDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.PromotionDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PromotionDataSource 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.datasources.v1.PromotionDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSourceOrBuilder.java new file mode 100644 index 000000000000..94f239f7185f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/PromotionDataSourceOrBuilder.java @@ -0,0 +1,98 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface PromotionDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.PromotionDataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The target country used as part of the unique
+   * identifier. Represented as a [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   *
+   * Promotions are only available in selected
+   * [countries](https://support.google.com/merchants/answer/4588460).
+   * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The targetCountry. + */ + java.lang.String getTargetCountry(); + + /** + * + * + *
+   * Required. Immutable. The target country used as part of the unique
+   * identifier. Represented as a [CLDR territory
+   * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
+   *
+   * Promotions are only available in selected
+   * [countries](https://support.google.com/merchants/answer/4588460).
+   * 
+ * + * + * string target_country = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for targetCountry. + */ + com.google.protobuf.ByteString getTargetCountryBytes(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   * 
+ * + * + * string content_language = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSource.java new file mode 100644 index 000000000000..465bb065d316 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSource.java @@ -0,0 +1,907 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** Protobuf type {@code google.shopping.merchant.datasources.v1.RegionalInventoryDataSource} */ +public final class RegionalInventoryDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) + RegionalInventoryDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RegionalInventoryDataSource.newBuilder() to construct. + private RegionalInventoryDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RegionalInventoryDataSource() { + feedLabel_ = ""; + contentLanguage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RegionalInventoryDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.class, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder.class); + } + + public static final int FEED_LABEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the regional
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + @java.lang.Override + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + 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(); + feedLabel_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the regional
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the regional inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the regional inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = 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(feedLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, feedLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contentLanguage_); + } + 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(feedLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, feedLabel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, contentLanguage_); + } + 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.datasources.v1.RegionalInventoryDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource other = + (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) obj; + + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) 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) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource 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.datasources.v1.RegionalInventoryDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource 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.datasources.v1.RegionalInventoryDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource 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.datasources.v1.RegionalInventoryDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + 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.datasources.v1.RegionalInventoryDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource 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.datasources.v1.RegionalInventoryDataSource 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; + } + + /** Protobuf type {@code google.shopping.merchant.datasources.v1.RegionalInventoryDataSource} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.class, + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + feedLabel_ = ""; + contentLanguage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_RegionalInventoryDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource build() { + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource buildPartial() { + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource result = + new com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.feedLabel_ = feedLabel_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contentLanguage_ = contentLanguage_; + } + } + + @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.datasources.v1.RegionalInventoryDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + .getDefaultInstance()) return this; + if (!other.getFeedLabel().isEmpty()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + 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 34: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 34 + case 42: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 42 + 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 feedLabel_ = ""; + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the regional
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + feedLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the regional
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the regional
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the regional
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The feed label of the offers to which the regional
+     * inventory is provided.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the regional inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the regional inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the regional inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentLanguage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the regional inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. The two-letter ISO 639-1 language of the items to
+     * which the regional inventory is provided.
+     * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentLanguage_ = 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.datasources.v1.RegionalInventoryDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) + private static final com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.RegionalInventoryDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RegionalInventoryDataSource 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.datasources.v1.RegionalInventoryDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSourceOrBuilder.java new file mode 100644 index 000000000000..392072125b3f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/RegionalInventoryDataSourceOrBuilder.java @@ -0,0 +1,102 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface RegionalInventoryDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.RegionalInventoryDataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the regional
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + + /** + * + * + *
+   * Required. Immutable. The feed label of the offers to which the regional
+   * inventory is provided.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   * 
+ * + * + * string feed_label = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the regional inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + + /** + * + * + *
+   * Required. Immutable. The two-letter ISO 639-1 language of the items to
+   * which the regional inventory is provided.
+   * 
+ * + * + * string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSource.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSource.java new file mode 100644 index 000000000000..6d5f26d58b26 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSource.java @@ -0,0 +1,1845 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * The supplemental data source for local and online products. After creation,
+ * you should make sure to link the supplemental product data source into one or
+ * more primary product data sources.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.SupplementalProductDataSource} + */ +public final class SupplementalProductDataSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.SupplementalProductDataSource) + SupplementalProductDataSourceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SupplementalProductDataSource.newBuilder() to construct. + private SupplementalProductDataSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SupplementalProductDataSource() { + feedLabel_ = ""; + contentLanguage_ = ""; + referencingPrimaryDataSources_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SupplementalProductDataSource(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.class, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder + .class); + } + + private int bitField0_; + public static final int FEED_LABEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + @java.lang.Override + public boolean hasFeedLabel() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + @java.lang.Override + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + 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(); + feedLabel_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + @java.lang.Override + public boolean hasContentLanguage() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REFERENCING_PRIMARY_DATA_SOURCES_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List + referencingPrimaryDataSources_; + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getReferencingPrimaryDataSourcesList() { + return referencingPrimaryDataSources_; + } + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getReferencingPrimaryDataSourcesOrBuilderList() { + return referencingPrimaryDataSources_; + } + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getReferencingPrimaryDataSourcesCount() { + return referencingPrimaryDataSources_.size(); + } + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReference + getReferencingPrimaryDataSources(int index) { + return referencingPrimaryDataSources_.get(index); + } + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getReferencingPrimaryDataSourcesOrBuilder(int index) { + return referencingPrimaryDataSources_.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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, feedLabel_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, contentLanguage_); + } + for (int i = 0; i < referencingPrimaryDataSources_.size(); i++) { + output.writeMessage(7, referencingPrimaryDataSources_.get(i)); + } + 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.GeneratedMessageV3.computeStringSize(4, feedLabel_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, contentLanguage_); + } + for (int i = 0; i < referencingPrimaryDataSources_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, referencingPrimaryDataSources_.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.datasources.v1.SupplementalProductDataSource)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource other = + (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) obj; + + if (hasFeedLabel() != other.hasFeedLabel()) return false; + if (hasFeedLabel()) { + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + } + if (hasContentLanguage() != other.hasContentLanguage()) return false; + if (hasContentLanguage()) { + if (!getContentLanguage().equals(other.getContentLanguage())) return false; + } + if (!getReferencingPrimaryDataSourcesList() + .equals(other.getReferencingPrimaryDataSourcesList())) 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 (hasFeedLabel()) { + hash = (37 * hash) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + } + if (hasContentLanguage()) { + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + } + if (getReferencingPrimaryDataSourcesCount() > 0) { + hash = (37 * hash) + REFERENCING_PRIMARY_DATA_SOURCES_FIELD_NUMBER; + hash = (53 * hash) + getReferencingPrimaryDataSourcesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource 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.datasources.v1.SupplementalProductDataSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource 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.datasources.v1.SupplementalProductDataSource parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource 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.datasources.v1.SupplementalProductDataSource + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + 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.datasources.v1.SupplementalProductDataSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource 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.datasources.v1.SupplementalProductDataSource 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; + } + + /** + * + * + *
+   * The supplemental data source for local and online products. After creation,
+   * you should make sure to link the supplemental product data source into one or
+   * more primary product data sources.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.SupplementalProductDataSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.SupplementalProductDataSource) + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.class, + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + feedLabel_ = ""; + contentLanguage_ = ""; + if (referencingPrimaryDataSourcesBuilder_ == null) { + referencingPrimaryDataSources_ = java.util.Collections.emptyList(); + } else { + referencingPrimaryDataSources_ = null; + referencingPrimaryDataSourcesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.datasources.v1.DatasourcetypesProto + .internal_static_google_shopping_merchant_datasources_v1_SupplementalProductDataSource_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource build() { + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + buildPartial() { + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource result = + new com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource result) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + referencingPrimaryDataSources_ = + java.util.Collections.unmodifiableList(referencingPrimaryDataSources_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.referencingPrimaryDataSources_ = referencingPrimaryDataSources_; + } else { + result.referencingPrimaryDataSources_ = referencingPrimaryDataSourcesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.feedLabel_ = feedLabel_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.contentLanguage_ = contentLanguage_; + 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.datasources.v1.SupplementalProductDataSource) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource other) { + if (other + == com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + .getDefaultInstance()) return this; + if (other.hasFeedLabel()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasContentLanguage()) { + contentLanguage_ = other.contentLanguage_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (referencingPrimaryDataSourcesBuilder_ == null) { + if (!other.referencingPrimaryDataSources_.isEmpty()) { + if (referencingPrimaryDataSources_.isEmpty()) { + referencingPrimaryDataSources_ = other.referencingPrimaryDataSources_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.addAll(other.referencingPrimaryDataSources_); + } + onChanged(); + } + } else { + if (!other.referencingPrimaryDataSources_.isEmpty()) { + if (referencingPrimaryDataSourcesBuilder_.isEmpty()) { + referencingPrimaryDataSourcesBuilder_.dispose(); + referencingPrimaryDataSourcesBuilder_ = null; + referencingPrimaryDataSources_ = other.referencingPrimaryDataSources_; + bitField0_ = (bitField0_ & ~0x00000004); + referencingPrimaryDataSourcesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReferencingPrimaryDataSourcesFieldBuilder() + : null; + } else { + referencingPrimaryDataSourcesBuilder_.addAllMessages( + other.referencingPrimaryDataSources_); + } + } + } + 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 34: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 34 + case 42: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 42 + case 58: + { + com.google.shopping.merchant.datasources.v1.DataSourceReference m = + input.readMessage( + com.google.shopping.merchant.datasources.v1.DataSourceReference.parser(), + extensionRegistry); + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.add(m); + } else { + referencingPrimaryDataSourcesBuilder_.addMessage(m); + } + break; + } // case 58 + 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 feedLabel_ = ""; + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + public boolean hasFeedLabel() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + public java.lang.String getFeedLabel() { + java.lang.Object ref = feedLabel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + feedLabel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + public com.google.protobuf.ByteString getFeedLabelBytes() { + java.lang.Object ref = feedLabel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + feedLabel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The feed label that is specified on the data source
+     * level.
+     *
+     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+     * and dashes (-).
+     *
+     * See also [migration to feed
+     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset for data
+     * sources with product content type.
+     *
+     * They must be set for data sources with a [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     * The fields must be unset for data sources without [file
+     * input][google.shopping.merchant.datasources.v1.FileInput].
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for feedLabel to set. + * @return This builder for chaining. + */ + public Builder setFeedLabelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + feedLabel_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + public boolean hasContentLanguage() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentLanguage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+     * data source.
+     *
+     * `feedLabel` and `contentLanguage` must be either both set or unset.
+     * The fields can only be unset for data sources without file input.
+     *
+     * If set, the data source will only accept products matching this
+     * combination. If unset, the data source will accept produts without that
+     * restriction.
+     * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentLanguage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List + referencingPrimaryDataSources_ = java.util.Collections.emptyList(); + + private void ensureReferencingPrimaryDataSourcesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + referencingPrimaryDataSources_ = + new java.util.ArrayList< + com.google.shopping.merchant.datasources.v1.DataSourceReference>( + referencingPrimaryDataSources_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + referencingPrimaryDataSourcesBuilder_; + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getReferencingPrimaryDataSourcesList() { + if (referencingPrimaryDataSourcesBuilder_ == null) { + return java.util.Collections.unmodifiableList(referencingPrimaryDataSources_); + } else { + return referencingPrimaryDataSourcesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getReferencingPrimaryDataSourcesCount() { + if (referencingPrimaryDataSourcesBuilder_ == null) { + return referencingPrimaryDataSources_.size(); + } else { + return referencingPrimaryDataSourcesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference + getReferencingPrimaryDataSources(int index) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + return referencingPrimaryDataSources_.get(index); + } else { + return referencingPrimaryDataSourcesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReferencingPrimaryDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.set(index, value); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReferencingPrimaryDataSources( + int index, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.set(index, builderForValue.build()); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReferencingPrimaryDataSources( + com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.add(value); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReferencingPrimaryDataSources( + int index, com.google.shopping.merchant.datasources.v1.DataSourceReference value) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.add(index, value); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReferencingPrimaryDataSources( + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.add(builderForValue.build()); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReferencingPrimaryDataSources( + int index, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder builderForValue) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.add(index, builderForValue.build()); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllReferencingPrimaryDataSources( + java.lang.Iterable< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReference> + values) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, referencingPrimaryDataSources_); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearReferencingPrimaryDataSources() { + if (referencingPrimaryDataSourcesBuilder_ == null) { + referencingPrimaryDataSources_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeReferencingPrimaryDataSources(int index) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + ensureReferencingPrimaryDataSourcesIsMutable(); + referencingPrimaryDataSources_.remove(index); + onChanged(); + } else { + referencingPrimaryDataSourcesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + getReferencingPrimaryDataSourcesBuilder(int index) { + return getReferencingPrimaryDataSourcesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getReferencingPrimaryDataSourcesOrBuilder(int index) { + if (referencingPrimaryDataSourcesBuilder_ == null) { + return referencingPrimaryDataSources_.get(index); + } else { + return referencingPrimaryDataSourcesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getReferencingPrimaryDataSourcesOrBuilderList() { + if (referencingPrimaryDataSourcesBuilder_ != null) { + return referencingPrimaryDataSourcesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(referencingPrimaryDataSources_); + } + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + addReferencingPrimaryDataSourcesBuilder() { + return getReferencingPrimaryDataSourcesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.datasources.v1.DataSourceReference.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder + addReferencingPrimaryDataSourcesBuilder(int index) { + return getReferencingPrimaryDataSourcesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.datasources.v1.DataSourceReference.getDefaultInstance()); + } + + /** + * + * + *
+     * Output only. The (unordered and deduplicated) list of all primary data
+     * sources linked to this data source in either default or custom rules.
+     * Supplemental data source cannot be deleted before all links are removed.
+     * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getReferencingPrimaryDataSourcesBuilderList() { + return getReferencingPrimaryDataSourcesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder> + getReferencingPrimaryDataSourcesFieldBuilder() { + if (referencingPrimaryDataSourcesBuilder_ == null) { + referencingPrimaryDataSourcesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSourceReference, + com.google.shopping.merchant.datasources.v1.DataSourceReference.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder>( + referencingPrimaryDataSources_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + referencingPrimaryDataSources_ = null; + } + return referencingPrimaryDataSourcesBuilder_; + } + + @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.datasources.v1.SupplementalProductDataSource) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.SupplementalProductDataSource) + private static final com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource(); + } + + public static com.google.shopping.merchant.datasources.v1.SupplementalProductDataSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SupplementalProductDataSource 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.datasources.v1.SupplementalProductDataSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSourceOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSourceOrBuilder.java new file mode 100644 index 000000000000..41c1d8d06292 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/SupplementalProductDataSourceOrBuilder.java @@ -0,0 +1,276 @@ +/* + * 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/datasources/v1/datasourcetypes.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface SupplementalProductDataSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.SupplementalProductDataSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the feedLabel field is set. + */ + boolean hasFeedLabel(); + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + + /** + * + * + *
+   * Optional. Immutable. The feed label that is specified on the data source
+   * level.
+   *
+   * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
+   * and dashes (-).
+   *
+   * See also [migration to feed
+   * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset for data
+   * sources with product content type.
+   *
+   * They must be set for data sources with a [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   * The fields must be unset for data sources without [file
+   * input][google.shopping.merchant.datasources.v1.FileInput].
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the contentLanguage field is set. + */ + boolean hasContentLanguage(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + + /** + * + * + *
+   * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
+   * data source.
+   *
+   * `feedLabel` and `contentLanguage` must be either both set or unset.
+   * The fields can only be unset for data sources without file input.
+   *
+   * If set, the data source will only accept products matching this
+   * combination. If unset, the data source will accept produts without that
+   * restriction.
+   * 
+ * + * + * optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getReferencingPrimaryDataSourcesList(); + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceReference getReferencingPrimaryDataSources( + int index); + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getReferencingPrimaryDataSourcesCount(); + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getReferencingPrimaryDataSourcesOrBuilderList(); + + /** + * + * + *
+   * Output only. The (unordered and deduplicated) list of all primary data
+   * sources linked to this data source in either default or custom rules.
+   * Supplemental data source cannot be deleted before all links are removed.
+   * 
+ * + * + * repeated .google.shopping.merchant.datasources.v1.DataSourceReference referencing_primary_data_sources = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceReferenceOrBuilder + getReferencingPrimaryDataSourcesOrBuilder(int index); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequest.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequest.java new file mode 100644 index 000000000000..7da03d5d5b1f --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequest.java @@ -0,0 +1,1170 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +/** + * + * + *
+ * Request message for the UpdateDataSource method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.UpdateDataSourceRequest} + */ +public final class UpdateDataSourceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) + UpdateDataSourceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateDataSourceRequest.newBuilder() to construct. + private UpdateDataSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateDataSourceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateDataSourceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.Builder.class); + } + + private int bitField0_; + public static final int DATA_SOURCE_FIELD_NUMBER = 1; + private com.google.shopping.merchant.datasources.v1.DataSource dataSource_; + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + @java.lang.Override + public boolean hasDataSource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource() { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourceOrBuilder() { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getDataSource()); + } + 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, getDataSource()); + } + 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.datasources.v1.UpdateDataSourceRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest other = + (com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) obj; + + if (hasDataSource() != other.hasDataSource()) return false; + if (hasDataSource()) { + if (!getDataSource().equals(other.getDataSource())) 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 (hasDataSource()) { + hash = (37 * hash) + DATA_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getDataSource().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.datasources.v1.UpdateDataSourceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest 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.datasources.v1.UpdateDataSourceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest 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.datasources.v1.UpdateDataSourceRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest 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.datasources.v1.UpdateDataSourceRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + 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.datasources.v1.UpdateDataSourceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest 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.datasources.v1.UpdateDataSourceRequest 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 UpdateDataSource method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.datasources.v1.UpdateDataSourceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.class, + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDataSourceFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataSource_ = null; + if (dataSourceBuilder_ != null) { + dataSourceBuilder_.dispose(); + dataSourceBuilder_ = 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.datasources.v1.DataSourcesProto + .internal_static_google_shopping_merchant_datasources_v1_UpdateDataSourceRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest build() { + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest buildPartial() { + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest result = + new com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dataSource_ = dataSourceBuilder_ == null ? dataSource_ : dataSourceBuilder_.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.datasources.v1.UpdateDataSourceRequest) { + return mergeFrom( + (com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest other) { + if (other + == com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + .getDefaultInstance()) return this; + if (other.hasDataSource()) { + mergeDataSource(other.getDataSource()); + } + 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(getDataSourceFieldBuilder().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.datasources.v1.DataSource dataSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + dataSourceBuilder_; + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + public boolean hasDataSource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + public com.google.shopping.merchant.datasources.v1.DataSource getDataSource() { + if (dataSourceBuilder_ == null) { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } else { + return dataSourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataSource(com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dataSource_ = value; + } else { + dataSourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setDataSource( + com.google.shopping.merchant.datasources.v1.DataSource.Builder builderForValue) { + if (dataSourceBuilder_ == null) { + dataSource_ = builderForValue.build(); + } else { + dataSourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeDataSource(com.google.shopping.merchant.datasources.v1.DataSource value) { + if (dataSourceBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && dataSource_ != null + && dataSource_ + != com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance()) { + getDataSourceBuilder().mergeFrom(value); + } else { + dataSource_ = value; + } + } else { + dataSourceBuilder_.mergeFrom(value); + } + if (dataSource_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearDataSource() { + bitField0_ = (bitField0_ & ~0x00000001); + dataSource_ = null; + if (dataSourceBuilder_ != null) { + dataSourceBuilder_.dispose(); + dataSourceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSource.Builder getDataSourceBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDataSourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder + getDataSourceOrBuilder() { + if (dataSourceBuilder_ != null) { + return dataSourceBuilder_.getMessageOrBuilder(); + } else { + return dataSource_ == null + ? com.google.shopping.merchant.datasources.v1.DataSource.getDefaultInstance() + : dataSource_; + } + } + + /** + * + * + *
+     * Required. The data source resource to update.
+     * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder> + getDataSourceFieldBuilder() { + if (dataSourceBuilder_ == null) { + dataSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.datasources.v1.DataSource, + com.google.shopping.merchant.datasources.v1.DataSource.Builder, + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder>( + getDataSource(), getParentForChildren(), isClean()); + dataSource_ = null; + } + return dataSourceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. The list of data source fields to be updated.
+     *
+     * Fields specified in the update mask without a value specified in the
+     * body will be deleted from the data source.
+     *
+     * Providing special "*" value for full data source replacement is not
+     * supported.
+     *
+     * For example, If you insert `updateMask=displayName` in the request, it will
+     * only update the `displayName` leaving all other fields untouched.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) + private static final com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest(); + } + + public static com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateDataSourceRequest 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.datasources.v1.UpdateDataSourceRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequestOrBuilder.java b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequestOrBuilder.java new file mode 100644 index 000000000000..42fc74f6d898 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/java/com/google/shopping/merchant/datasources/v1/UpdateDataSourceRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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/datasources/v1/datasources.proto + +// Protobuf Java Version: 3.25.8 +package com.google.shopping.merchant.datasources.v1; + +public interface UpdateDataSourceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.datasources.v1.UpdateDataSourceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the dataSource field is set. + */ + boolean hasDataSource(); + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The dataSource. + */ + com.google.shopping.merchant.datasources.v1.DataSource getDataSource(); + + /** + * + * + *
+   * Required. The data source resource to update.
+   * 
+ * + * + * .google.shopping.merchant.datasources.v1.DataSource data_source = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.datasources.v1.DataSourceOrBuilder getDataSourceOrBuilder(); + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. The list of data source fields to be updated.
+   *
+   * Fields specified in the update mask without a value specified in the
+   * body will be deleted from the data source.
+   *
+   * Providing special "*" value for full data source replacement is not
+   * supported.
+   *
+   * For example, If you insert `updateMask=displayName` in the request, it will
+   * only update the `displayName` leaving all other fields untouched.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasources.proto b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasources.proto new file mode 100644 index 000000000000..92c8c9946a5a --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasources.proto @@ -0,0 +1,312 @@ +// 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.datasources.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/shopping/merchant/datasources/v1/datasourcetypes.proto"; +import "google/shopping/merchant/datasources/v1/fileinputs.proto"; + +option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;datasourcespb"; +option java_multiple_files = true; +option java_outer_classname = "DataSourcesProto"; +option java_package = "com.google.shopping.merchant.datasources.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\DataSources\\V1"; +option ruby_package = "Google::Shopping::Merchant::DataSources::V1"; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" +}; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Datasource" + pattern: "accounts/{account}/dataSources/{datasource}" +}; + +// Service to manage primary, supplemental, inventory and other data sources. +// See more in the [Merchant +// Center](https://support.google.com/merchants/answer/7439058) help article. +service DataSourcesService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the data source configuration for the given account. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/datasources/v1/{name=accounts/*/dataSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the configurations for data sources for the given account. + rpc ListDataSources(ListDataSourcesRequest) + returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/datasources/v1/{parent=accounts/*}/dataSources" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates the new data source configuration for the given account. + // This method always creates a new data source. + rpc CreateDataSource(CreateDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + post: "/datasources/v1/{parent=accounts/*}/dataSources" + body: "data_source" + }; + option (google.api.method_signature) = "parent,data_source"; + } + + // Updates the existing data source configuration. The fields that are + // set in the update mask but not provided in the resource will be deleted. + rpc UpdateDataSource(UpdateDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + patch: "/datasources/v1/{data_source.name=accounts/*/dataSources/*}" + body: "data_source" + }; + option (google.api.method_signature) = "data_source,update_mask"; + } + + // Deletes a data source from your Merchant Center account. + rpc DeleteDataSource(DeleteDataSourceRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/datasources/v1/{name=accounts/*/dataSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Performs the data fetch immediately (even outside fetch schedule) on a + // data source from your Merchant Center Account. If you need to call + // this method more than once per day, you should use the Products service to + // update your product data instead. + // This method only works on data sources with a file input set. + rpc FetchDataSource(FetchDataSourceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/datasources/v1/{name=accounts/*/dataSources/*}:fetch" + body: "*" + }; + } +} + +// The [data source](/merchant/api/guides/data-sources/overview) for +// the Merchant Center account. +message DataSource { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/DataSource" + pattern: "accounts/{account}/dataSources/{datasource}" + plural: "dataSources" + singular: "dataSource" + }; + + // Determines the type of input to the data source. Based on the input some + // settings might not be supported. + enum Input { + // Input unspecified. + INPUT_UNSPECIFIED = 0; + + // Represents data sources for which the data is primarily provided through + // the API. + API = 1; + + // Represents data sources for which the data is primarily provided through + // file input. Data can still be provided through the API. + FILE = 2; + + // The data source for products added directly in Merchant Center. + // + // This type of data source can not be created or updated through this API, + // only by Merchant Center UI. + // + // This type of data source is read only. + UI = 3; + + // This is also known as + // [Automated feeds](https://support.google.com/merchants/answer/12158480) + // used to automatically build your product data. This type of data source + // can be enabled or disabled through the Accounts sub-API. + AUTOFEED = 4; + } + + // Required. The data source type. + oneof Type { + // The [primary data + // source](https://support.google.com/merchants/answer/7439058) for local + // and online products. + PrimaryProductDataSource primary_product_data_source = 4; + + // The [supplemental data + // source](https://support.google.com/merchants/answer/7439058) for local + // and online products. + SupplementalProductDataSource supplemental_product_data_source = 5; + + // The [local + // inventory](https://support.google.com/merchants/answer/7023001) data + // source. + LocalInventoryDataSource local_inventory_data_source = 6; + + // The [regional + // inventory](https://support.google.com/merchants/answer/7439058) data + // source. + RegionalInventoryDataSource regional_inventory_data_source = 7; + + // The [promotion](https://support.google.com/merchants/answer/2906014) + // data source. + PromotionDataSource promotion_data_source = 8; + + // The [product + // review](https://support.google.com/merchants/answer/7045996) + // data source. + ProductReviewDataSource product_review_data_source = 9; + + // The [merchant + // review](https://support.google.com/merchants/answer/7045996) + // data source. + MerchantReviewDataSource merchant_review_data_source = 12; + } + + // Required. Identifier. The name of the data source. + // Format: + // `accounts/{account}/dataSources/{datasource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The data source id. + int64 data_source_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The displayed data source name in the Merchant Center UI. + string display_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Determines the type of input to the data source. Based on the + // input some settings might not work. Only generic data sources can be + // created through the API. + Input input = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The field is used only when data is managed through a file. + FileInput file_input = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the GetDataSource method. +message GetDataSourceRequest { + // Required. The name of the data source to retrieve. + // Format: `accounts/{account}/dataSources/{datasource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/DataSource" + } + ]; +} + +// Request message for the ListDataSources method. +message ListDataSourcesRequest { + // Required. The account to list data sources for. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/DataSource" + } + ]; + + // Optional. The maximum number of data sources to return. The service may + // return fewer than this value. The maximum value is 1000; values above 1000 + // will be coerced to 1000. If unspecified, the maximum number of data sources + // will be returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDataSources` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDataSources` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListDataSources method. +message ListDataSourcesResponse { + // The data sources from the specified account. + repeated DataSource data_sources = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the CreateDataSource method. +message CreateDataSourceRequest { + // Required. The account where this data source will be created. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/DataSource" + } + ]; + + // Required. The data source to create. + DataSource data_source = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the UpdateDataSource method. +message UpdateDataSourceRequest { + // Required. The data source resource to update. + DataSource data_source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of data source fields to be updated. + // + // Fields specified in the update mask without a value specified in the + // body will be deleted from the data source. + // + // Providing special "*" value for full data source replacement is not + // supported. + // + // For example, If you insert `updateMask=displayName` in the request, it will + // only update the `displayName` leaving all other fields untouched. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the FetchDataSource method. +message FetchDataSourceRequest { + // Required. The name of the data source resource to fetch. + // Format: `accounts/{account}/dataSources/{datasource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/DataSource" + } + ]; +} + +// Request message for the DeleteDataSource method. +message DeleteDataSourceRequest { + // Required. The name of the data source to delete. + // Format: `accounts/{account}/dataSources/{datasource}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/DataSource" + } + ]; +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasourcetypes.proto b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasourcetypes.proto new file mode 100644 index 000000000000..1ab359db0ddd --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/datasourcetypes.proto @@ -0,0 +1,302 @@ +// 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.datasources.v1; + +import "google/api/field_behavior.proto"; +import "google/shopping/type/types.proto"; + +option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;datasourcespb"; +option java_multiple_files = true; +option java_outer_classname = "DatasourcetypesProto"; +option java_package = "com.google.shopping.merchant.datasources.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\DataSources\\V1"; +option ruby_package = "Google::Shopping::Merchant::DataSources::V1"; + +// The primary data source for local and online products. +message PrimaryProductDataSource { + // Default rule management of the data source. + message DefaultRule { + // Required. The list of data sources linked in the [default + // rule](https://support.google.com/merchants/answer/7450276). + // This list is ordered by the default rule priority of joining the data. + // It might include none or multiple references to `self` and supplemental + // data sources. + // + // The list must not be empty. + // + // To link the data source to the default rule, you need to add a + // new reference to this list (in sequential order). + // + // To unlink the data source from the default rule, you need to + // remove the given reference from this list. + // + // Changing the order of this list will result in changing the priority of + // data sources in the default rule. + // + // For example, providing the following list: [`1001`, `self`] will + // take attribute values from supplemental data source `1001`, and fallback + // to `self` if the attribute is not set in `1001`. + repeated DataSourceReference take_from_data_sources = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Destinations also known as [Marketing + // methods](https://support.google.com/merchants/answer/15130232) selections. + message Destination { + // The state of the destination. + enum State { + // Not specified. + STATE_UNSPECIFIED = 0; + + // Indicates that the destination is enabled. + ENABLED = 1; + + // Indicates that the destination is disabled. + DISABLED = 2; + } + + // [Marketing methods](https://support.google.com/merchants/answer/15130232) + // (also known as destination) selections. + google.shopping.type.Destination.DestinationEnum destination = 1; + + // The state of the destination. + State state = 2; + } + + // Optional. Immutable. Determines whether the products of this data source + // are **only** targeting local destinations. Legacy local products are + // prefixed with `local~` in the product resource ID. For example, + // `accounts/123/products/local~en~US~sku123`. + bool legacy_local = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The feed label that is specified on the data source + // level. + // + // Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + // and dashes (-). + // + // See also [migration to feed + // labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + // + // `feedLabel` and `contentLanguage` must be either both set or unset for data + // sources with product content type. + // They must be set for data sources with a file input. + // + // If set, the data source will only accept products matching this + // combination. If unset, the data source will accept products without that + // restriction. + optional string feed_label = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The two-letter ISO 639-1 language of the items in the + // data source. + // + // `feedLabel` and `contentLanguage` must be either both set or unset. + // The fields can only be unset for data sources without file input. + // + // If set, the data source will only accept products matching this + // combination. If unset, the data source will accept products without that + // restriction. + optional string content_language = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The countries where the items may be displayed. Represented as a + // [CLDR territory + // code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + repeated string countries = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default rule management of the data source. If set, the linked + // data sources will be replaced. + DefaultRule default_rule = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The existing data source setup contains at least one custom + // (non-default) rule and therefore its management through the + // `default_rule_data_sources` field should be treated with caution. + bool contains_custom_rules = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A list of destinations describing where products of the data + // source can be shown. + // + // When retrieving the data source, the list contains all the destinations + // that can be used for the data source, including the ones that are disabled + // for the data source but enabled for the account. + // + // Only destinations that are enabled on the account, for example through + // program participation, can be enabled on the data source. + // + // If unset, during creation, the destinations will be inherited based on the + // account level program participation. + // + // If set, during creation or update, the data source will be set only for the + // specified destinations. + // + // Updating this field requires at least one destination. + repeated Destination destinations = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The supplemental data source for local and online products. After creation, +// you should make sure to link the supplemental product data source into one or +// more primary product data sources. +message SupplementalProductDataSource { + // Optional. Immutable. The feed label that is specified on the data source + // level. + // + // Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + // and dashes (-). + // + // See also [migration to feed + // labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + // + // `feedLabel` and `contentLanguage` must be either both set or unset for data + // sources with product content type. + // + // They must be set for data sources with a [file + // input][google.shopping.merchant.datasources.v1.FileInput]. + // The fields must be unset for data sources without [file + // input][google.shopping.merchant.datasources.v1.FileInput]. + // + // If set, the data source will only accept products matching this + // combination. If unset, the data source will accept produts without that + // restriction. + optional string feed_label = 4 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The two-letter ISO 639-1 language of the items in the + // data source. + // + // `feedLabel` and `contentLanguage` must be either both set or unset. + // The fields can only be unset for data sources without file input. + // + // If set, the data source will only accept products matching this + // combination. If unset, the data source will accept produts without that + // restriction. + optional string content_language = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The (unordered and deduplicated) list of all primary data + // sources linked to this data source in either default or custom rules. + // Supplemental data source cannot be deleted before all links are removed. + repeated DataSourceReference referencing_primary_data_sources = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The local inventory data source type is only available for file inputs and +// can't be used to create API local inventory data sources. +message LocalInventoryDataSource { + // Required. Immutable. The feed label of the offers to which the local + // inventory is provided. + // + // Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + // and dashes (-). + // + // See also [migration to feed + // labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + string feed_label = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The two-letter ISO 639-1 language of the items to + // which the local inventory is provided. + string content_language = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +message RegionalInventoryDataSource { + // Required. Immutable. The feed label of the offers to which the regional + // inventory is provided. + // + // Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9), + // and dashes (-). + // + // See also [migration to feed + // labels](https://developers.google.com/shopping-content/guides/products/feed-labels). + string feed_label = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The two-letter ISO 639-1 language of the items to + // which the regional inventory is provided. + string content_language = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// The promotion data source. +message PromotionDataSource { + // Required. Immutable. The target country used as part of the unique + // identifier. Represented as a [CLDR territory + // code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml). + // + // Promotions are only available in selected + // [countries](https://support.google.com/merchants/answer/4588460). + string target_country = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Immutable. The two-letter ISO 639-1 language of the items in the + // data source. + string content_language = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// The product review data source. +message ProductReviewDataSource {} + +// The merchant review data source. +message MerchantReviewDataSource {} + +// Data source reference can be used to manage related data sources within the +// data source service. +message DataSourceReference { + oneof data_source_id { + // Self should be used to reference the primary data source itself. + bool self = 1; + + // Optional. The name of the primary data source. + // Format: + // `accounts/{account}/dataSources/{datasource}` + string primary_data_source_name = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the supplemental data source. + // Format: + // `accounts/{account}/dataSources/{datasource}` + string supplemental_data_source_name = 2 + [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileinputs.proto b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileinputs.proto new file mode 100644 index 000000000000..6be5866f8bd5 --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileinputs.proto @@ -0,0 +1,142 @@ +// 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.datasources.v1; + +import "google/api/field_behavior.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;datasourcespb"; +option java_multiple_files = true; +option java_outer_classname = "FileInputsProto"; +option java_package = "com.google.shopping.merchant.datasources.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\DataSources\\V1"; +option ruby_package = "Google::Shopping::Merchant::DataSources::V1"; + +// The data specific for file data sources. This field is empty for other +// data source inputs. +message FileInput { + // Fetch details to deliver the data source. + message FetchSettings { + // The required fields vary based on the frequency of fetching. For a + // monthly + // fetch schedule, + // `day of + // month` + // and + // [hour of + // day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday] + // are required. For a weekly fetch schedule, + // [day of + // week][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#dayofweek] + // and [hour of + // day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday] + // are required. For a daily fetch schedule, only an [hour of + // day][https://developers.google.com/merchant/api/reference/rest/datasources_v1beta/accounts.dataSources#timeofday] + // is required. + enum Frequency { + // Frequency unspecified. + FREQUENCY_UNSPECIFIED = 0; + + // The fetch happens every day. + FREQUENCY_DAILY = 1; + + // The fetch happens every week. + FREQUENCY_WEEKLY = 2; + + // The fetch happens every month. + FREQUENCY_MONTHLY = 3; + } + + // Optional. Enables or pauses the fetch schedule. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The day of the month when the data source file should be + // fetched (1-31). This field can only be set for monthly frequency. + int32 day_of_month = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The hour of the day when the data source file should be + // fetched. Minutes and seconds are not supported and will be ignored. + google.type.TimeOfDay time_of_day = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The day of the week when the data source file should be + // fetched. This field can only be set for weekly frequency. + google.type.DayOfWeek day_of_week = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. [Time zone](https://cldr.unicode.org) used for schedule. UTC by + // default. For example, "America/Los_Angeles". + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The frequency describing fetch schedule. + Frequency frequency = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The URL where the data source file can be fetched. Google + // Merchant Center supports automatic scheduled uploads using the HTTP, + // HTTPS or SFTP protocols, so the value will need to be a valid link using + // one of those three protocols. Immutable for Google Sheets files. + string fetch_uri = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional user name for + // [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. + // Used for [submitting data sources through + // SFTP](https://support.google.com/merchants/answer/13813117). + string username = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional password for + // [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. + // Used for [submitting data sources through + // SFTP](https://support.google.com/merchants/answer/13813117). + string password = 9 [(google.api.field_behavior) = OPTIONAL]; + } + + // The method of file delivery. + enum FileInputType { + // File input type unspecified. + FILE_INPUT_TYPE_UNSPECIFIED = 0; + + // The file is uploaded through SFTP, Google Cloud Storage or manually in + // the Merchant Center. + UPLOAD = 1; + + // The file is fetched from the configured + // [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. + FETCH = 2; + + // The file is fetched from Google Sheets specified in the + // [fetch_uri][google.shopping.merchant.datasources.v1.FileInput.FetchSettings.fetch_uri]. + // However, you can't set up `GOOGLE_SHEETS` as a data source through the + // API. To add `GOOGLE_SHEETS` as a data source through the Merchant Center, + // see [Add products to Merchant + // Center](https://support.google.com/merchants/answer/12158053). + GOOGLE_SHEETS = 3; + } + + // Optional. Fetch details to deliver the data source. It contains settings + // for `FETCH` and `GOOGLE_SHEETS` file input types. The required fields vary + // based on the frequency of fetching. + FetchSettings fetch_settings = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The file name of the data source. Required for `UPLOAD` file + // input type. + string file_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The type of file input. + FileInputType file_input_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileuploads.proto b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileuploads.proto new file mode 100644 index 000000000000..77c0d3a997ee --- /dev/null +++ b/java-shopping-merchant-datasources/proto-google-shopping-merchant-datasources-v1/src/main/proto/google/shopping/merchant/datasources/v1/fileuploads.proto @@ -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 +// +// 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.datasources.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/timestamp.proto"; + +option csharp_namespace = "Google.Shopping.Merchant.DataSources.V1"; +option go_package = "cloud.google.com/go/shopping/merchant/datasources/apiv1/datasourcespb;datasourcespb"; +option java_multiple_files = true; +option java_outer_classname = "FileUploadsProto"; +option java_package = "com.google.shopping.merchant.datasources.v1"; +option php_namespace = "Google\\Shopping\\Merchant\\DataSources\\V1"; +option ruby_package = "Google::Shopping::Merchant::DataSources::V1"; + +// Service to manage data source file uploads. +service FileUploadsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Gets the latest data source file upload. Only the `latest` alias is + // accepted for a file upload. + rpc GetFileUpload(GetFileUploadRequest) returns (FileUpload) { + option (google.api.http) = { + get: "/datasources/v1/{name=accounts/*/dataSources/*/fileUploads/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The file upload of a specific data source, that is, the result of the +// retrieval of the data source at a certain timestamp computed asynchronously +// when the data source processing is finished. Only applicable to file data +// sources. +message FileUpload { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/FileUpload" + pattern: "accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}" + plural: "fileUploads" + singular: "fileUpload" + }; + + // An error occurring in the data source, like "invalid price". + message Issue { + // The severity of the issue. + enum Severity { + // Severity unspecified. + SEVERITY_UNSPECIFIED = 0; + + // The issue is the warning. + WARNING = 1; + + // The issue is an error. + ERROR = 2; + } + + // Output only. The title of the issue, for example, "Item too big". + string title = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error description, for example, "Your data source + // contains items which have too many attributes, or are too big. These + // items will be dropped". + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The code of the error, for example, + // "validation/invalid_value". Returns + // "?" if the code is unknown. + string code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of occurrences of the error in the file upload. + int64 count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The severity of the issue. + Severity severity = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to the documentation explaining the issue in more + // details, if available. + string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The processing state of the data source. + enum ProcessingState { + // Processing state unspecified. + PROCESSING_STATE_UNSPECIFIED = 0; + + // The data source could not be processed or all the items had errors. + FAILED = 1; + + // The data source is being processed. + IN_PROGRESS = 2; + + // The data source was processed successfully, though some items might have + // had errors. + SUCCEEDED = 3; + } + + // Identifier. The name of the data source file upload. + // Format: + // `{datasource.name=accounts/{account}/dataSources/{datasource}/fileUploads/{fileupload}}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The data source id. + int64 data_source_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The processing state of the data source. + ProcessingState processing_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of issues occurring in the data source. + repeated Issue issues = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of items in the data source that were processed. + int64 items_total = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of items in the data source that were created. + int64 items_created = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of items in the data source that were updated. + int64 items_updated = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The date at which the file of the data source was uploaded. + google.protobuf.Timestamp upload_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the GetFileUploadRequest method. +message GetFileUploadRequest { + // Required. The name of the data source file upload to retrieve. + // Format: + // `accounts/{account}/dataSources/{datasource}/fileUploads/latest` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/FileUpload" + } + ]; +} diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..a040916e7bc7 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings; +import com.google.shopping.merchant.datasources.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 + DataSourcesServiceSettings dataSourcesServiceSettings = + DataSourcesServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + DataSourcesServiceClient dataSourcesServiceClient = + DataSourcesServiceClient.create(dataSourcesServiceSettings); + } +} +// [END merchantapi_v1_generated_DataSourcesService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..aae7fd99b9e1 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings; +import com.google.shopping.merchant.datasources.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 + DataSourcesServiceSettings dataSourcesServiceSettings = + DataSourcesServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + DataSourcesServiceClient dataSourcesServiceClient = + DataSourcesServiceClient.create(dataSourcesServiceSettings); + } +} +// [END merchantapi_v1_generated_DataSourcesService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateUseHttpJsonTransport.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..7d9e611d40a7 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_Create_UseHttpJsonTransport_sync] +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings; + +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 + DataSourcesServiceSettings dataSourcesServiceSettings = + DataSourcesServiceSettings.newHttpJsonBuilder().build(); + DataSourcesServiceClient dataSourcesServiceClient = + DataSourcesServiceClient.create(dataSourcesServiceSettings); + } +} +// [END merchantapi_v1_generated_DataSourcesService_Create_UseHttpJsonTransport_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/AsyncCreateDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/AsyncCreateDataSource.java new file mode 100644 index 000000000000..9435df51d98b --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/AsyncCreateDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_CreateDataSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class AsyncCreateDataSource { + + public static void main(String[] args) throws Exception { + asyncCreateDataSource(); + } + + public static void asyncCreateDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + CreateDataSourceRequest request = + CreateDataSourceRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setDataSource(DataSource.newBuilder().build()) + .build(); + ApiFuture future = + dataSourcesServiceClient.createDataSourceCallable().futureCall(request); + // Do something. + DataSource response = future.get(); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_CreateDataSource_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSource.java new file mode 100644 index 000000000000..f195231bd6f1 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_CreateDataSource_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.CreateDataSourceRequest; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncCreateDataSource { + + public static void main(String[] args) throws Exception { + syncCreateDataSource(); + } + + public static void syncCreateDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + CreateDataSourceRequest request = + CreateDataSourceRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setDataSource(DataSource.newBuilder().build()) + .build(); + DataSource response = dataSourcesServiceClient.createDataSource(request); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_CreateDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceAccountnameDatasource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceAccountnameDatasource.java new file mode 100644 index 000000000000..a7f0519cf016 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceAccountnameDatasource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_CreateDataSource_AccountnameDatasource_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncCreateDataSourceAccountnameDatasource { + + public static void main(String[] args) throws Exception { + syncCreateDataSourceAccountnameDatasource(); + } + + public static void syncCreateDataSourceAccountnameDatasource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + DataSource dataSource = DataSource.newBuilder().build(); + DataSource response = dataSourcesServiceClient.createDataSource(parent, dataSource); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_CreateDataSource_AccountnameDatasource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceStringDatasource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceStringDatasource.java new file mode 100644 index 000000000000..f8a21f373363 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/createdatasource/SyncCreateDataSourceStringDatasource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_CreateDataSource_StringDatasource_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncCreateDataSourceStringDatasource { + + public static void main(String[] args) throws Exception { + syncCreateDataSourceStringDatasource(); + } + + public static void syncCreateDataSourceStringDatasource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + DataSource dataSource = DataSource.newBuilder().build(); + DataSource response = dataSourcesServiceClient.createDataSource(parent, dataSource); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_CreateDataSource_StringDatasource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/AsyncDeleteDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/AsyncDeleteDataSource.java new file mode 100644 index 000000000000..0a6a51f2ae62 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/AsyncDeleteDataSource.java @@ -0,0 +1,50 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_DeleteDataSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; + +public class AsyncDeleteDataSource { + + public static void main(String[] args) throws Exception { + asyncDeleteDataSource(); + } + + public static void asyncDeleteDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + DeleteDataSourceRequest request = + DeleteDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + ApiFuture future = + dataSourcesServiceClient.deleteDataSourceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_DeleteDataSource_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSource.java new file mode 100644 index 000000000000..2f158ed3873d --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_DeleteDataSource_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.DeleteDataSourceRequest; + +public class SyncDeleteDataSource { + + public static void main(String[] args) throws Exception { + syncDeleteDataSource(); + } + + public static void syncDeleteDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + DeleteDataSourceRequest request = + DeleteDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + dataSourcesServiceClient.deleteDataSource(request); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_DeleteDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceDatasourcename.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceDatasourcename.java new file mode 100644 index 000000000000..244a7b2ac44e --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceDatasourcename.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_DeleteDataSource_Datasourcename_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncDeleteDataSourceDatasourcename { + + public static void main(String[] args) throws Exception { + syncDeleteDataSourceDatasourcename(); + } + + public static void syncDeleteDataSourceDatasourcename() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + dataSourcesServiceClient.deleteDataSource(name); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_DeleteDataSource_Datasourcename_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceString.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceString.java new file mode 100644 index 000000000000..962cb784f493 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/deletedatasource/SyncDeleteDataSourceString.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_DeleteDataSource_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncDeleteDataSourceString { + + public static void main(String[] args) throws Exception { + syncDeleteDataSourceString(); + } + + public static void syncDeleteDataSourceString() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + String name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString(); + dataSourcesServiceClient.deleteDataSource(name); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_DeleteDataSource_String_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/AsyncFetchDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/AsyncFetchDataSource.java new file mode 100644 index 000000000000..c307efc431c4 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/AsyncFetchDataSource.java @@ -0,0 +1,50 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_FetchDataSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; + +public class AsyncFetchDataSource { + + public static void main(String[] args) throws Exception { + asyncFetchDataSource(); + } + + public static void asyncFetchDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + ApiFuture future = + dataSourcesServiceClient.fetchDataSourceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_FetchDataSource_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/SyncFetchDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/SyncFetchDataSource.java new file mode 100644 index 000000000000..7c1bc43876a0 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/fetchdatasource/SyncFetchDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_FetchDataSource_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.FetchDataSourceRequest; + +public class SyncFetchDataSource { + + public static void main(String[] args) throws Exception { + syncFetchDataSource(); + } + + public static void syncFetchDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + FetchDataSourceRequest request = + FetchDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + dataSourcesServiceClient.fetchDataSource(request); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_FetchDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/AsyncGetDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/AsyncGetDataSource.java new file mode 100644 index 000000000000..729b096322c0 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/AsyncGetDataSource.java @@ -0,0 +1,50 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_GetDataSource_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; + +public class AsyncGetDataSource { + + public static void main(String[] args) throws Exception { + asyncGetDataSource(); + } + + public static void asyncGetDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + GetDataSourceRequest request = + GetDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + ApiFuture future = + dataSourcesServiceClient.getDataSourceCallable().futureCall(request); + // Do something. + DataSource response = future.get(); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_GetDataSource_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSource.java new file mode 100644 index 000000000000..6730fb0889f0 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_GetDataSource_sync] +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.GetDataSourceRequest; + +public class SyncGetDataSource { + + public static void main(String[] args) throws Exception { + syncGetDataSource(); + } + + public static void syncGetDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + GetDataSourceRequest request = + GetDataSourceRequest.newBuilder() + .setName(DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString()) + .build(); + DataSource response = dataSourcesServiceClient.getDataSource(request); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_GetDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceDatasourcename.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceDatasourcename.java new file mode 100644 index 000000000000..df3ffc3acb4c --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceDatasourcename.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_GetDataSource_Datasourcename_sync] +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncGetDataSourceDatasourcename { + + public static void main(String[] args) throws Exception { + syncGetDataSourceDatasourcename(); + } + + public static void syncGetDataSourceDatasourcename() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + DataSourceName name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]"); + DataSource response = dataSourcesServiceClient.getDataSource(name); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_GetDataSource_Datasourcename_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceString.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceString.java new file mode 100644 index 000000000000..cfbb3e8a9b1d --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/getdatasource/SyncGetDataSourceString.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_GetDataSource_String_sync] +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourceName; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncGetDataSourceString { + + public static void main(String[] args) throws Exception { + syncGetDataSourceString(); + } + + public static void syncGetDataSourceString() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + String name = DataSourceName.of("[ACCOUNT]", "[DATASOURCE]").toString(); + DataSource response = dataSourcesServiceClient.getDataSource(name); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_GetDataSource_String_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSources.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSources.java new file mode 100644 index 000000000000..68c585baf214 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSources.java @@ -0,0 +1,54 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_ListDataSources_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; + +public class AsyncListDataSources { + + public static void main(String[] args) throws Exception { + asyncListDataSources(); + } + + public static void asyncListDataSources() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + ListDataSourcesRequest request = + ListDataSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + dataSourcesServiceClient.listDataSourcesPagedCallable().futureCall(request); + // Do something. + for (DataSource element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_ListDataSources_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSourcesPaged.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSourcesPaged.java new file mode 100644 index 000000000000..da8561a12c5f --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/AsyncListDataSourcesPaged.java @@ -0,0 +1,62 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_ListDataSources_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesResponse; + +public class AsyncListDataSourcesPaged { + + public static void main(String[] args) throws Exception { + asyncListDataSourcesPaged(); + } + + public static void asyncListDataSourcesPaged() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + ListDataSourcesRequest request = + ListDataSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListDataSourcesResponse response = + dataSourcesServiceClient.listDataSourcesCallable().call(request); + for (DataSource element : response.getDataSourcesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_ListDataSources_Paged_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSources.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSources.java new file mode 100644 index 000000000000..62a1b8b7a6fa --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSources.java @@ -0,0 +1,50 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_ListDataSources_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.ListDataSourcesRequest; + +public class SyncListDataSources { + + public static void main(String[] args) throws Exception { + syncListDataSources(); + } + + public static void syncListDataSources() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + ListDataSourcesRequest request = + ListDataSourcesRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (DataSource element : dataSourcesServiceClient.listDataSources(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_ListDataSources_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesAccountname.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesAccountname.java new file mode 100644 index 000000000000..a4579b87d0c2 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesAccountname.java @@ -0,0 +1,44 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_ListDataSources_Accountname_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncListDataSourcesAccountname { + + public static void main(String[] args) throws Exception { + syncListDataSourcesAccountname(); + } + + public static void syncListDataSourcesAccountname() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (DataSource element : dataSourcesServiceClient.listDataSources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_ListDataSources_Accountname_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesString.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesString.java new file mode 100644 index 000000000000..3960e83ea3af --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/listdatasources/SyncListDataSourcesString.java @@ -0,0 +1,44 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_ListDataSources_String_sync] +import com.google.shopping.merchant.datasources.v1.AccountName; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncListDataSourcesString { + + public static void main(String[] args) throws Exception { + syncListDataSourcesString(); + } + + public static void syncListDataSourcesString() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (DataSource element : dataSourcesServiceClient.listDataSources(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_ListDataSources_String_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/AsyncUpdateDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/AsyncUpdateDataSource.java new file mode 100644 index 000000000000..55f62deda11d --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/AsyncUpdateDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_UpdateDataSource_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; + +public class AsyncUpdateDataSource { + + public static void main(String[] args) throws Exception { + asyncUpdateDataSource(); + } + + public static void asyncUpdateDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + UpdateDataSourceRequest request = + UpdateDataSourceRequest.newBuilder() + .setDataSource(DataSource.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + dataSourcesServiceClient.updateDataSourceCallable().futureCall(request); + // Do something. + DataSource response = future.get(); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_UpdateDataSource_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSource.java new file mode 100644 index 000000000000..d6523255cc08 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_UpdateDataSource_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; +import com.google.shopping.merchant.datasources.v1.UpdateDataSourceRequest; + +public class SyncUpdateDataSource { + + public static void main(String[] args) throws Exception { + syncUpdateDataSource(); + } + + public static void syncUpdateDataSource() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + UpdateDataSourceRequest request = + UpdateDataSourceRequest.newBuilder() + .setDataSource(DataSource.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + DataSource response = dataSourcesServiceClient.updateDataSource(request); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_UpdateDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSourceDatasourceFieldmask.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSourceDatasourceFieldmask.java new file mode 100644 index 000000000000..54b5b624881f --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservice/updatedatasource/SyncUpdateDataSourceDatasourceFieldmask.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesService_UpdateDataSource_DatasourceFieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.shopping.merchant.datasources.v1.DataSource; +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceClient; + +public class SyncUpdateDataSourceDatasourceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateDataSourceDatasourceFieldmask(); + } + + public static void syncUpdateDataSourceDatasourceFieldmask() 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 (DataSourcesServiceClient dataSourcesServiceClient = DataSourcesServiceClient.create()) { + DataSource dataSource = DataSource.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + DataSource response = dataSourcesServiceClient.updateDataSource(dataSource, updateMask); + } + } +} +// [END merchantapi_v1_generated_DataSourcesService_UpdateDataSource_DatasourceFieldmask_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservicesettings/getdatasource/SyncGetDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservicesettings/getdatasource/SyncGetDataSource.java new file mode 100644 index 000000000000..89fe314d096b --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/datasourcesservicesettings/getdatasource/SyncGetDataSource.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_DataSourcesServiceSettings_GetDataSource_sync] +import com.google.shopping.merchant.datasources.v1.DataSourcesServiceSettings; +import java.time.Duration; + +public class SyncGetDataSource { + + public static void main(String[] args) throws Exception { + syncGetDataSource(); + } + + public static void syncGetDataSource() 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 + DataSourcesServiceSettings.Builder dataSourcesServiceSettingsBuilder = + DataSourcesServiceSettings.newBuilder(); + dataSourcesServiceSettingsBuilder + .getDataSourceSettings() + .setRetrySettings( + dataSourcesServiceSettingsBuilder + .getDataSourceSettings() + .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()); + DataSourcesServiceSettings dataSourcesServiceSettings = + dataSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_DataSourcesServiceSettings_GetDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..29b4e11c6e34 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceSettings; +import com.google.shopping.merchant.datasources.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 + FileUploadsServiceSettings fileUploadsServiceSettings = + FileUploadsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + FileUploadsServiceClient fileUploadsServiceClient = + FileUploadsServiceClient.create(fileUploadsServiceSettings); + } +} +// [END merchantapi_v1_generated_FileUploadsService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..1833742b704f --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceSettings; +import com.google.shopping.merchant.datasources.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 + FileUploadsServiceSettings fileUploadsServiceSettings = + FileUploadsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + FileUploadsServiceClient fileUploadsServiceClient = + FileUploadsServiceClient.create(fileUploadsServiceSettings); + } +} +// [END merchantapi_v1_generated_FileUploadsService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateUseHttpJsonTransport.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/create/SyncCreateUseHttpJsonTransport.java new file mode 100644 index 000000000000..3a241f71a8ed --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_Create_UseHttpJsonTransport_sync] +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceSettings; + +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 + FileUploadsServiceSettings fileUploadsServiceSettings = + FileUploadsServiceSettings.newHttpJsonBuilder().build(); + FileUploadsServiceClient fileUploadsServiceClient = + FileUploadsServiceClient.create(fileUploadsServiceSettings); + } +} +// [END merchantapi_v1_generated_FileUploadsService_Create_UseHttpJsonTransport_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/AsyncGetFileUpload.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/AsyncGetFileUpload.java new file mode 100644 index 000000000000..cabf12cd3015 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/AsyncGetFileUpload.java @@ -0,0 +1,50 @@ +/* + * 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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_GetFileUpload_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.FileUploadName; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; + +public class AsyncGetFileUpload { + + public static void main(String[] args) throws Exception { + asyncGetFileUpload(); + } + + public static void asyncGetFileUpload() 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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) { + GetFileUploadRequest request = + GetFileUploadRequest.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .build(); + ApiFuture future = + fileUploadsServiceClient.getFileUploadCallable().futureCall(request); + // Do something. + FileUpload response = future.get(); + } + } +} +// [END merchantapi_v1_generated_FileUploadsService_GetFileUpload_async] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUpload.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUpload.java new file mode 100644 index 000000000000..86be7ff19aca --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUpload.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_GetFileUpload_sync] +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.FileUploadName; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; +import com.google.shopping.merchant.datasources.v1.GetFileUploadRequest; + +public class SyncGetFileUpload { + + public static void main(String[] args) throws Exception { + syncGetFileUpload(); + } + + public static void syncGetFileUpload() 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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) { + GetFileUploadRequest request = + GetFileUploadRequest.newBuilder() + .setName(FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString()) + .build(); + FileUpload response = fileUploadsServiceClient.getFileUpload(request); + } + } +} +// [END merchantapi_v1_generated_FileUploadsService_GetFileUpload_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadFileuploadname.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadFileuploadname.java new file mode 100644 index 000000000000..0a24fbb52645 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadFileuploadname.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_GetFileUpload_Fileuploadname_sync] +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.FileUploadName; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; + +public class SyncGetFileUploadFileuploadname { + + public static void main(String[] args) throws Exception { + syncGetFileUploadFileuploadname(); + } + + public static void syncGetFileUploadFileuploadname() 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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) { + FileUploadName name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]"); + FileUpload response = fileUploadsServiceClient.getFileUpload(name); + } + } +} +// [END merchantapi_v1_generated_FileUploadsService_GetFileUpload_Fileuploadname_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadString.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadString.java new file mode 100644 index 000000000000..0cca6fb96409 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservice/getfileupload/SyncGetFileUploadString.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsService_GetFileUpload_String_sync] +import com.google.shopping.merchant.datasources.v1.FileUpload; +import com.google.shopping.merchant.datasources.v1.FileUploadName; +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceClient; + +public class SyncGetFileUploadString { + + public static void main(String[] args) throws Exception { + syncGetFileUploadString(); + } + + public static void syncGetFileUploadString() 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 (FileUploadsServiceClient fileUploadsServiceClient = FileUploadsServiceClient.create()) { + String name = FileUploadName.of("[ACCOUNT]", "[DATASOURCE]", "[FILEUPLOAD]").toString(); + FileUpload response = fileUploadsServiceClient.getFileUpload(name); + } + } +} +// [END merchantapi_v1_generated_FileUploadsService_GetFileUpload_String_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservicesettings/getfileupload/SyncGetFileUpload.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservicesettings/getfileupload/SyncGetFileUpload.java new file mode 100644 index 000000000000..791304c24629 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/fileuploadsservicesettings/getfileupload/SyncGetFileUpload.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.datasources.v1.samples; + +// [START merchantapi_v1_generated_FileUploadsServiceSettings_GetFileUpload_sync] +import com.google.shopping.merchant.datasources.v1.FileUploadsServiceSettings; +import java.time.Duration; + +public class SyncGetFileUpload { + + public static void main(String[] args) throws Exception { + syncGetFileUpload(); + } + + public static void syncGetFileUpload() 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 + FileUploadsServiceSettings.Builder fileUploadsServiceSettingsBuilder = + FileUploadsServiceSettings.newBuilder(); + fileUploadsServiceSettingsBuilder + .getFileUploadSettings() + .setRetrySettings( + fileUploadsServiceSettingsBuilder + .getFileUploadSettings() + .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()); + FileUploadsServiceSettings fileUploadsServiceSettings = + fileUploadsServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_FileUploadsServiceSettings_GetFileUpload_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/datasourcesservicestubsettings/getdatasource/SyncGetDataSource.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/datasourcesservicestubsettings/getdatasource/SyncGetDataSource.java new file mode 100644 index 000000000000..0061314e4e8d --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/datasourcesservicestubsettings/getdatasource/SyncGetDataSource.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.datasources.v1.stub.samples; + +// [START merchantapi_v1_generated_DataSourcesServiceStubSettings_GetDataSource_sync] +import com.google.shopping.merchant.datasources.v1.stub.DataSourcesServiceStubSettings; +import java.time.Duration; + +public class SyncGetDataSource { + + public static void main(String[] args) throws Exception { + syncGetDataSource(); + } + + public static void syncGetDataSource() 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 + DataSourcesServiceStubSettings.Builder dataSourcesServiceSettingsBuilder = + DataSourcesServiceStubSettings.newBuilder(); + dataSourcesServiceSettingsBuilder + .getDataSourceSettings() + .setRetrySettings( + dataSourcesServiceSettingsBuilder + .getDataSourceSettings() + .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()); + DataSourcesServiceStubSettings dataSourcesServiceSettings = + dataSourcesServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_DataSourcesServiceStubSettings_GetDataSource_sync] diff --git a/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/fileuploadsservicestubsettings/getfileupload/SyncGetFileUpload.java b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/fileuploadsservicestubsettings/getfileupload/SyncGetFileUpload.java new file mode 100644 index 000000000000..637d70bdf011 --- /dev/null +++ b/java-shopping-merchant-datasources/samples/snippets/generated/com/google/shopping/merchant/datasources/v1/stub/fileuploadsservicestubsettings/getfileupload/SyncGetFileUpload.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.datasources.v1.stub.samples; + +// [START merchantapi_v1_generated_FileUploadsServiceStubSettings_GetFileUpload_sync] +import com.google.shopping.merchant.datasources.v1.stub.FileUploadsServiceStubSettings; +import java.time.Duration; + +public class SyncGetFileUpload { + + public static void main(String[] args) throws Exception { + syncGetFileUpload(); + } + + public static void syncGetFileUpload() 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 + FileUploadsServiceStubSettings.Builder fileUploadsServiceSettingsBuilder = + FileUploadsServiceStubSettings.newBuilder(); + fileUploadsServiceSettingsBuilder + .getFileUploadSettings() + .setRetrySettings( + fileUploadsServiceSettingsBuilder + .getFileUploadSettings() + .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()); + FileUploadsServiceStubSettings fileUploadsServiceSettings = + fileUploadsServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1_generated_FileUploadsServiceStubSettings_GetFileUpload_sync] diff --git a/versions.txt b/versions.txt index b4df23cae2cf..5359b80dc203 100644 --- a/versions.txt +++ b/versions.txt @@ -878,6 +878,8 @@ 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-datasources-v1:0.26.0:0.27.0-SNAPSHOT +grpc-google-shopping-merchant-datasources-v1:0.26.0:0.27.0-SNAPSHOT proto-google-shopping-merchant-inventories-v1:0.46.0:0.47.0-SNAPSHOT grpc-google-shopping-merchant-inventories-v1:0.46.0:0.47.0-SNAPSHOT proto-google-shopping-merchant-conversions-v1:0.29.0:0.30.0-SNAPSHOT