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(). + * + *
| Method | + *Description | + *Method 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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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 UnaryCallableSample 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 UnaryCallableSample 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 UnaryCallableSample 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 UnaryCallableSample 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 UnaryCallableSample 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 UnaryCallableSample 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 UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the + * [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 ClientSettingsNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * 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().
+ *
+ * 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:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * 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:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getFileUpload:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * ======================= FileUploadsServiceClient =======================
+ *
+ * Service Description: Service to manage data source file uploads.
+ *
+ * Sample for FileUploadsServiceClient:
+ *
+ * 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 The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getDataSource:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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 The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getFileUpload:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcDataSourcesServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public 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 This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcFileUploadsServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public 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 This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class HttpJsonDataSourcesServiceCallableFactory
+ implements HttpJsonStubCallableFactory 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{@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);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@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);
+ * }
+ *
+ * {@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);
+ * }
+ *
+ * {@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);
+ * }
+ *
+ * {@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.
+ *
+ * {@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.
+ *
+ * {@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.
+ *
+ * {@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
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@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{@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);
+ * }
+ * }
+ *
+ * {@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.
+ *
+ *
+ *
+ *
+ * {@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
+ *
+ *
+ * {@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