diff --git a/java-shopping-css/.OwlBot.yaml b/java-shopping-css/.OwlBot.yaml new file mode 100644 index 000000000000..ee0891140016 --- /dev/null +++ b/java-shopping-css/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-shopping-css/grpc-google-.*/src" +- "/java-shopping-css/proto-google-.*/src" +- "/java-shopping-css/google-.*/src" +- "/java-shopping-css/samples/snippets/generated" + +deep-preserve-regex: +- "/java-shopping-css/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/shopping/css/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-shopping-css/$1/proto-google-shopping-css-$1/src" +- source: "/google/shopping/css/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-shopping-css/$1/grpc-google-shopping-css-$1/src" +- source: "/google/shopping/css/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-shopping-css/$1/google-shopping-css/src" +- source: "/google/shopping/css/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-shopping-css/$1/samples/snippets/generated" + + +api-name: css \ No newline at end of file diff --git a/java-shopping-css/.repo-metadata.json b/java-shopping-css/.repo-metadata.json new file mode 100644 index 000000000000..829cfa5e13c7 --- /dev/null +++ b/java-shopping-css/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "css", + "name_pretty": "CSS API", + "product_documentation": "https://developers.google.com/comparison-shopping-services/api", + "api_description": "The CSS API is used to manage your CSS and control your CSS Products portfolio", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-shopping-css/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-shopping-css", + "repo_short": "java-shopping-css", + "distribution_name": "com.google.shopping:google-shopping-css", + "api_id": "css.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-shopping-css/README.md b/java-shopping-css/README.md new file mode 100644 index 000000000000..34422ca4d56d --- /dev/null +++ b/java-shopping-css/README.md @@ -0,0 +1,225 @@ +# Google CSS API Client for Java + +Java idiomatic client for [CSS API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.29.0 + pom + import + + + + + + + com.google.shopping + google-shopping-css + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.shopping + google-shopping-css + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.shopping:google-shopping-css:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.shopping" % "google-shopping-css" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired CSS API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the CSS API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the CSS API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google CSS API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-shopping-css` library. See the [Quickstart](#quickstart) section +to add `google-shopping-css` as a dependency in your code. + +## About CSS API + + +[CSS API][product-docs] The CSS API is used to manage your CSS and control your CSS Products portfolio + +See the [CSS API client library docs][javadocs] to learn how to +use this CSS API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +CSS API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://developers.google.com/comparison-shopping-services/api +[javadocs]: https://cloud.google.com/java/docs/reference/google-shopping-css/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-shopping-css/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.shopping/google-shopping-css.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.shopping/google-shopping-css/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-shopping-css/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-shopping-css/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-shopping-css/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=css.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-shopping-css/google-shopping-css-bom/pom.xml b/java-shopping-css/google-shopping-css-bom/pom.xml new file mode 100644 index 000000000000..85c314177345 --- /dev/null +++ b/java-shopping-css/google-shopping-css-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.shopping + google-shopping-css-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.27.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google CSS API BOM + + BOM for CSS API + + + + true + + + + + + com.google.shopping + google-shopping-css + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-css-v1 + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-css-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-shopping-css/google-shopping-css/pom.xml b/java-shopping-css/google-shopping-css/pom.xml new file mode 100644 index 000000000000..76bc73099fe6 --- /dev/null +++ b/java-shopping-css/google-shopping-css/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.shopping + google-shopping-css + 0.0.1-SNAPSHOT + jar + Google CSS API + CSS API The CSS API is used to manage your CSS and control your CSS Products portfolio + + com.google.shopping + google-shopping-css-parent + 0.0.1-SNAPSHOT + + + google-shopping-css + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.shopping.api.grpc + proto-google-shopping-css-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.shopping.api.grpc + grpc-google-shopping-css-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceClient.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceClient.java new file mode 100644 index 000000000000..f4eafc2b5159 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceClient.java @@ -0,0 +1,863 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.shopping.css.v1.stub.AccountLabelsServiceStub; +import com.google.shopping.css.v1.stub.AccountLabelsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages Merchant Center and CSS accounts labels. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+ *     AccountLabelsServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   AccountLabel accountLabel = AccountLabel.newBuilder().build();
+ *   AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel);
+ * }
+ * }
+ * + *

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

Lists the labels assigned to an account.

+ *

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

+ *
    + *
  • listAccountLabels(ListAccountLabelsRequest request) + *
+ *

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

+ *
    + *
  • listAccountLabels(AccountName parent) + *
  • listAccountLabels(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.

+ *
    + *
  • listAccountLabelsPagedCallable() + *
  • listAccountLabelsCallable() + *
+ *
CreateAccountLabel

Creates a new label, not assigned to any account.

+ *

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

+ *
    + *
  • createAccountLabel(CreateAccountLabelRequest request) + *
+ *

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

+ *
    + *
  • createAccountLabel(AccountName parent, AccountLabel accountLabel) + *
  • createAccountLabel(String parent, AccountLabel accountLabel) + *
+ *

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

+ *
    + *
  • createAccountLabelCallable() + *
+ *
UpdateAccountLabel

Updates a label.

+ *

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

+ *
    + *
  • updateAccountLabel(UpdateAccountLabelRequest request) + *
+ *

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

+ *
    + *
  • updateAccountLabel(AccountLabel accountLabel) + *
+ *

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

+ *
    + *
  • updateAccountLabelCallable() + *
+ *
DeleteAccountLabel

Deletes a label and removes it from all accounts to which it was assigned.

+ *

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

+ *
    + *
  • deleteAccountLabel(DeleteAccountLabelRequest request) + *
+ *

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

+ *
    + *
  • deleteAccountLabel(AccountLabelName name) + *
  • deleteAccountLabel(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.

+ *
    + *
  • deleteAccountLabelCallable() + *
+ *
+ * + *

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 AccountLabelsServiceSettings + * 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
+ * AccountLabelsServiceSettings accountLabelsServiceSettings =
+ *     AccountLabelsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AccountLabelsServiceClient accountLabelsServiceClient =
+ *     AccountLabelsServiceClient.create(accountLabelsServiceSettings);
+ * }
+ * + *

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
+ * AccountLabelsServiceSettings accountLabelsServiceSettings =
+ *     AccountLabelsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AccountLabelsServiceClient accountLabelsServiceClient =
+ *     AccountLabelsServiceClient.create(accountLabelsServiceSettings);
+ * }
+ * + *

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
+ * AccountLabelsServiceSettings accountLabelsServiceSettings =
+ *     AccountLabelsServiceSettings.newHttpJsonBuilder().build();
+ * AccountLabelsServiceClient accountLabelsServiceClient =
+ *     AccountLabelsServiceClient.create(accountLabelsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AccountLabelsServiceClient implements BackgroundResource { + private final AccountLabelsServiceSettings settings; + private final AccountLabelsServiceStub stub; + + /** Constructs an instance of AccountLabelsServiceClient with default settings. */ + public static final AccountLabelsServiceClient create() throws IOException { + return create(AccountLabelsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AccountLabelsServiceClient, 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 AccountLabelsServiceClient create(AccountLabelsServiceSettings settings) + throws IOException { + return new AccountLabelsServiceClient(settings); + } + + /** + * Constructs an instance of AccountLabelsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(AccountLabelsServiceSettings). + */ + public static final AccountLabelsServiceClient create(AccountLabelsServiceStub stub) { + return new AccountLabelsServiceClient(stub); + } + + /** + * Constructs an instance of AccountLabelsServiceClient, 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 AccountLabelsServiceClient(AccountLabelsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AccountLabelsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected AccountLabelsServiceClient(AccountLabelsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AccountLabelsServiceSettings getSettings() { + return settings; + } + + public AccountLabelsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the labels assigned to an 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (AccountLabel element :
+   *       accountLabelsServiceClient.listAccountLabels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent account. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccountLabelsPagedResponse listAccountLabels(AccountName parent) { + ListAccountLabelsRequest request = + ListAccountLabelsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAccountLabels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the labels assigned to an 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (AccountLabel element :
+   *       accountLabelsServiceClient.listAccountLabels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent account. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccountLabelsPagedResponse listAccountLabels(String parent) { + ListAccountLabelsRequest request = + ListAccountLabelsRequest.newBuilder().setParent(parent).build(); + return listAccountLabels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the labels assigned to an 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   ListAccountLabelsRequest request =
+   *       ListAccountLabelsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AccountLabel element :
+   *       accountLabelsServiceClient.listAccountLabels(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 ListAccountLabelsPagedResponse listAccountLabels(ListAccountLabelsRequest request) { + return listAccountLabelsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the labels assigned to an 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   ListAccountLabelsRequest request =
+   *       ListAccountLabelsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       accountLabelsServiceClient.listAccountLabelsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AccountLabel element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAccountLabelsPagedCallable() { + return stub.listAccountLabelsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the labels assigned to an 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   ListAccountLabelsRequest request =
+   *       ListAccountLabelsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListAccountLabelsResponse response =
+   *         accountLabelsServiceClient.listAccountLabelsCallable().call(request);
+   *     for (AccountLabel element : response.getAccountLabelsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAccountLabelsCallable() { + return stub.listAccountLabelsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new label, not assigned to any 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   AccountLabel accountLabel = AccountLabel.newBuilder().build();
+   *   AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel);
+   * }
+   * }
+ * + * @param parent Required. The parent account. Format: accounts/{account} + * @param accountLabel Required. The label to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AccountLabel createAccountLabel(AccountName parent, AccountLabel accountLabel) { + CreateAccountLabelRequest request = + CreateAccountLabelRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAccountLabel(accountLabel) + .build(); + return createAccountLabel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new label, not assigned to any 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   AccountLabel accountLabel = AccountLabel.newBuilder().build();
+   *   AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel);
+   * }
+   * }
+ * + * @param parent Required. The parent account. Format: accounts/{account} + * @param accountLabel Required. The label to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AccountLabel createAccountLabel(String parent, AccountLabel accountLabel) { + CreateAccountLabelRequest request = + CreateAccountLabelRequest.newBuilder() + .setParent(parent) + .setAccountLabel(accountLabel) + .build(); + return createAccountLabel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new label, not assigned to any 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   CreateAccountLabelRequest request =
+   *       CreateAccountLabelRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setAccountLabel(AccountLabel.newBuilder().build())
+   *           .build();
+   *   AccountLabel response = accountLabelsServiceClient.createAccountLabel(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 AccountLabel createAccountLabel(CreateAccountLabelRequest request) { + return createAccountLabelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new label, not assigned to any 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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   CreateAccountLabelRequest request =
+   *       CreateAccountLabelRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setAccountLabel(AccountLabel.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       accountLabelsServiceClient.createAccountLabelCallable().futureCall(request);
+   *   // Do something.
+   *   AccountLabel response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createAccountLabelCallable() { + return stub.createAccountLabelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a label. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   AccountLabel accountLabel = AccountLabel.newBuilder().build();
+   *   AccountLabel response = accountLabelsServiceClient.updateAccountLabel(accountLabel);
+   * }
+   * }
+ * + * @param accountLabel Required. The updated label. All fields must be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AccountLabel updateAccountLabel(AccountLabel accountLabel) { + UpdateAccountLabelRequest request = + UpdateAccountLabelRequest.newBuilder().setAccountLabel(accountLabel).build(); + return updateAccountLabel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a label. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   UpdateAccountLabelRequest request =
+   *       UpdateAccountLabelRequest.newBuilder()
+   *           .setAccountLabel(AccountLabel.newBuilder().build())
+   *           .build();
+   *   AccountLabel response = accountLabelsServiceClient.updateAccountLabel(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 AccountLabel updateAccountLabel(UpdateAccountLabelRequest request) { + return updateAccountLabelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a label. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   UpdateAccountLabelRequest request =
+   *       UpdateAccountLabelRequest.newBuilder()
+   *           .setAccountLabel(AccountLabel.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       accountLabelsServiceClient.updateAccountLabelCallable().futureCall(request);
+   *   // Do something.
+   *   AccountLabel response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateAccountLabelCallable() { + return stub.updateAccountLabelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a label and removes it from all accounts to which it was assigned. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]");
+   *   accountLabelsServiceClient.deleteAccountLabel(name);
+   * }
+   * }
+ * + * @param name Required. The name of the label to delete. Format: + * accounts/{account}/labels/{label} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAccountLabel(AccountLabelName name) { + DeleteAccountLabelRequest request = + DeleteAccountLabelRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAccountLabel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a label and removes it from all accounts to which it was assigned. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   String name = AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString();
+   *   accountLabelsServiceClient.deleteAccountLabel(name);
+   * }
+   * }
+ * + * @param name Required. The name of the label to delete. Format: + * accounts/{account}/labels/{label} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAccountLabel(String name) { + DeleteAccountLabelRequest request = + DeleteAccountLabelRequest.newBuilder().setName(name).build(); + deleteAccountLabel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a label and removes it from all accounts to which it was assigned. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   DeleteAccountLabelRequest request =
+   *       DeleteAccountLabelRequest.newBuilder()
+   *           .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString())
+   *           .build();
+   *   accountLabelsServiceClient.deleteAccountLabel(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 deleteAccountLabel(DeleteAccountLabelRequest request) { + deleteAccountLabelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a label and removes it from all accounts to which it was assigned. + * + *

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 (AccountLabelsServiceClient accountLabelsServiceClient =
+   *     AccountLabelsServiceClient.create()) {
+   *   DeleteAccountLabelRequest request =
+   *       DeleteAccountLabelRequest.newBuilder()
+   *           .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       accountLabelsServiceClient.deleteAccountLabelCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteAccountLabelCallable() { + return stub.deleteAccountLabelCallable(); + } + + @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 ListAccountLabelsPagedResponse + extends AbstractPagedListResponse< + ListAccountLabelsRequest, + ListAccountLabelsResponse, + AccountLabel, + ListAccountLabelsPage, + ListAccountLabelsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAccountLabelsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAccountLabelsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAccountLabelsPagedResponse(ListAccountLabelsPage page) { + super(page, ListAccountLabelsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAccountLabelsPage + extends AbstractPage< + ListAccountLabelsRequest, + ListAccountLabelsResponse, + AccountLabel, + ListAccountLabelsPage> { + + private ListAccountLabelsPage( + PageContext context, + ListAccountLabelsResponse response) { + super(context, response); + } + + private static ListAccountLabelsPage createEmptyPage() { + return new ListAccountLabelsPage(null, null); + } + + @Override + protected ListAccountLabelsPage createPage( + PageContext context, + ListAccountLabelsResponse response) { + return new ListAccountLabelsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAccountLabelsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAccountLabelsRequest, + ListAccountLabelsResponse, + AccountLabel, + ListAccountLabelsPage, + ListAccountLabelsFixedSizeCollection> { + + private ListAccountLabelsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAccountLabelsFixedSizeCollection createEmptyCollection() { + return new ListAccountLabelsFixedSizeCollection(null, 0); + } + + @Override + protected ListAccountLabelsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAccountLabelsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceSettings.java new file mode 100644 index 000000000000..64b7e44e3c8b --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceSettings.java @@ -0,0 +1,248 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +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.css.v1.stub.AccountLabelsServiceStubSettings; +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 AccountLabelsServiceClient}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createAccountLabel to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AccountLabelsServiceSettings.Builder accountLabelsServiceSettingsBuilder =
+ *     AccountLabelsServiceSettings.newBuilder();
+ * accountLabelsServiceSettingsBuilder
+ *     .createAccountLabelSettings()
+ *     .setRetrySettings(
+ *         accountLabelsServiceSettingsBuilder
+ *             .createAccountLabelSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AccountLabelsServiceSettings accountLabelsServiceSettings =
+ *     accountLabelsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AccountLabelsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listAccountLabels. */ + public PagedCallSettings< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings() { + return ((AccountLabelsServiceStubSettings) getStubSettings()).listAccountLabelsSettings(); + } + + /** Returns the object with the settings used for calls to createAccountLabel. */ + public UnaryCallSettings createAccountLabelSettings() { + return ((AccountLabelsServiceStubSettings) getStubSettings()).createAccountLabelSettings(); + } + + /** Returns the object with the settings used for calls to updateAccountLabel. */ + public UnaryCallSettings updateAccountLabelSettings() { + return ((AccountLabelsServiceStubSettings) getStubSettings()).updateAccountLabelSettings(); + } + + /** Returns the object with the settings used for calls to deleteAccountLabel. */ + public UnaryCallSettings deleteAccountLabelSettings() { + return ((AccountLabelsServiceStubSettings) getStubSettings()).deleteAccountLabelSettings(); + } + + public static final AccountLabelsServiceSettings create(AccountLabelsServiceStubSettings stub) + throws IOException { + return new AccountLabelsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AccountLabelsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AccountLabelsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AccountLabelsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AccountLabelsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AccountLabelsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AccountLabelsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AccountLabelsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AccountLabelsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 AccountLabelsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AccountLabelsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AccountLabelsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AccountLabelsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AccountLabelsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AccountLabelsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AccountLabelsServiceStubSettings.newHttpJsonBuilder()); + } + + public AccountLabelsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AccountLabelsServiceStubSettings.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 listAccountLabels. */ + public PagedCallSettings.Builder< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings() { + return getStubSettingsBuilder().listAccountLabelsSettings(); + } + + /** Returns the builder for the settings used for calls to createAccountLabel. */ + public UnaryCallSettings.Builder + createAccountLabelSettings() { + return getStubSettingsBuilder().createAccountLabelSettings(); + } + + /** Returns the builder for the settings used for calls to updateAccountLabel. */ + public UnaryCallSettings.Builder + updateAccountLabelSettings() { + return getStubSettingsBuilder().updateAccountLabelSettings(); + } + + /** Returns the builder for the settings used for calls to deleteAccountLabel. */ + public UnaryCallSettings.Builder + deleteAccountLabelSettings() { + return getStubSettingsBuilder().deleteAccountLabelSettings(); + } + + @Override + public AccountLabelsServiceSettings build() throws IOException { + return new AccountLabelsServiceSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceClient.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceClient.java new file mode 100644 index 000000000000..da3a78457367 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceClient.java @@ -0,0 +1,739 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.shopping.css.v1.stub.AccountsServiceStub; +import com.google.shopping.css.v1.stub.AccountsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing CSS/MC account information. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+ *   AccountName name = AccountName.of("[ACCOUNT]");
+ *   Account response = accountsServiceClient.getAccount(name);
+ * }
+ * }
+ * + *

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

Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name.

+ *

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

+ *
    + *
  • listChildAccounts(ListChildAccountsRequest request) + *
+ *

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

+ *
    + *
  • listChildAccounts(AccountName parent) + *
  • listChildAccounts(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.

+ *
    + *
  • listChildAccountsPagedCallable() + *
  • listChildAccountsCallable() + *
+ *
GetAccount

Retrieves a single CSS/MC account by ID.

+ *

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

+ *
    + *
  • getAccount(GetAccountRequest request) + *
+ *

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

+ *
    + *
  • getAccount(AccountName name) + *
  • getAccount(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.

+ *
    + *
  • getAccountCallable() + *
+ *
UpdateLabels

Updates labels assigned to CSS/MC accounts by a CSS domain.

+ *

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

+ *
    + *
  • updateLabels(UpdateAccountLabelsRequest request) + *
+ *

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

+ *
    + *
  • updateLabels(AccountName name) + *
  • updateLabels(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.

+ *
    + *
  • updateLabelsCallable() + *
+ *
+ * + *

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 AccountsServiceSettings 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
+ * AccountsServiceSettings accountsServiceSettings =
+ *     AccountsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AccountsServiceClient accountsServiceClient =
+ *     AccountsServiceClient.create(accountsServiceSettings);
+ * }
+ * + *

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
+ * AccountsServiceSettings accountsServiceSettings =
+ *     AccountsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AccountsServiceClient accountsServiceClient =
+ *     AccountsServiceClient.create(accountsServiceSettings);
+ * }
+ * + *

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
+ * AccountsServiceSettings accountsServiceSettings =
+ *     AccountsServiceSettings.newHttpJsonBuilder().build();
+ * AccountsServiceClient accountsServiceClient =
+ *     AccountsServiceClient.create(accountsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AccountsServiceClient implements BackgroundResource { + private final AccountsServiceSettings settings; + private final AccountsServiceStub stub; + + /** Constructs an instance of AccountsServiceClient with default settings. */ + public static final AccountsServiceClient create() throws IOException { + return create(AccountsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AccountsServiceClient, 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 AccountsServiceClient create(AccountsServiceSettings settings) + throws IOException { + return new AccountsServiceClient(settings); + } + + /** + * Constructs an instance of AccountsServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AccountsServiceSettings). + */ + public static final AccountsServiceClient create(AccountsServiceStub stub) { + return new AccountsServiceClient(stub); + } + + /** + * Constructs an instance of AccountsServiceClient, 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 AccountsServiceClient(AccountsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AccountsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected AccountsServiceClient(AccountsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AccountsServiceSettings getSettings() { + return settings; + } + + public AccountsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the accounts under the specified CSS account ID, and optionally filters by label ID + * and account name. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (Account element : accountsServiceClient.listChildAccounts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent account. Must be a CSS group or domain. Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListChildAccountsPagedResponse listChildAccounts(AccountName parent) { + ListChildAccountsRequest request = + ListChildAccountsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listChildAccounts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the accounts under the specified CSS account ID, and optionally filters by label ID + * and account name. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (Account element : accountsServiceClient.listChildAccounts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent account. Must be a CSS group or domain. Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListChildAccountsPagedResponse listChildAccounts(String parent) { + ListChildAccountsRequest request = + ListChildAccountsRequest.newBuilder().setParent(parent).build(); + return listChildAccounts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the accounts under the specified CSS account ID, and optionally filters by label ID + * and account name. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   ListChildAccountsRequest request =
+   *       ListChildAccountsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setLabelId(-1959256506)
+   *           .setFullName("fullName1330852282")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Account element : accountsServiceClient.listChildAccounts(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 ListChildAccountsPagedResponse listChildAccounts(ListChildAccountsRequest request) { + return listChildAccountsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the accounts under the specified CSS account ID, and optionally filters by label ID + * and account name. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   ListChildAccountsRequest request =
+   *       ListChildAccountsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setLabelId(-1959256506)
+   *           .setFullName("fullName1330852282")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       accountsServiceClient.listChildAccountsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Account element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listChildAccountsPagedCallable() { + return stub.listChildAccountsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the accounts under the specified CSS account ID, and optionally filters by label ID + * and account name. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   ListChildAccountsRequest request =
+   *       ListChildAccountsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setLabelId(-1959256506)
+   *           .setFullName("fullName1330852282")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListChildAccountsResponse response =
+   *         accountsServiceClient.listChildAccountsCallable().call(request);
+   *     for (Account element : response.getAccountsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listChildAccountsCallable() { + return stub.listChildAccountsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a single CSS/MC account by ID. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   AccountName name = AccountName.of("[ACCOUNT]");
+   *   Account response = accountsServiceClient.getAccount(name);
+   * }
+   * }
+ * + * @param name Required. The name of the managed CSS/MC account. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Account getAccount(AccountName name) { + GetAccountRequest request = + GetAccountRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getAccount(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a single CSS/MC account by ID. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   String name = AccountName.of("[ACCOUNT]").toString();
+   *   Account response = accountsServiceClient.getAccount(name);
+   * }
+   * }
+ * + * @param name Required. The name of the managed CSS/MC account. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Account getAccount(String name) { + GetAccountRequest request = GetAccountRequest.newBuilder().setName(name).build(); + return getAccount(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a single CSS/MC account by ID. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   GetAccountRequest request =
+   *       GetAccountRequest.newBuilder()
+   *           .setName(AccountName.of("[ACCOUNT]").toString())
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .build();
+   *   Account response = accountsServiceClient.getAccount(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 Account getAccount(GetAccountRequest request) { + return getAccountCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a single CSS/MC account by ID. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   GetAccountRequest request =
+   *       GetAccountRequest.newBuilder()
+   *           .setName(AccountName.of("[ACCOUNT]").toString())
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .build();
+   *   ApiFuture future = accountsServiceClient.getAccountCallable().futureCall(request);
+   *   // Do something.
+   *   Account response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getAccountCallable() { + return stub.getAccountCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates labels assigned to CSS/MC accounts by a CSS domain. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   AccountName name = AccountName.of("[ACCOUNT]");
+   *   Account response = accountsServiceClient.updateLabels(name);
+   * }
+   * }
+ * + * @param name Required. The label resource name. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Account updateLabels(AccountName name) { + UpdateAccountLabelsRequest request = + UpdateAccountLabelsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return updateLabels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates labels assigned to CSS/MC accounts by a CSS domain. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   String name = AccountName.of("[ACCOUNT]").toString();
+   *   Account response = accountsServiceClient.updateLabels(name);
+   * }
+   * }
+ * + * @param name Required. The label resource name. Format: accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Account updateLabels(String name) { + UpdateAccountLabelsRequest request = + UpdateAccountLabelsRequest.newBuilder().setName(name).build(); + return updateLabels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates labels assigned to CSS/MC accounts by a CSS domain. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   UpdateAccountLabelsRequest request =
+   *       UpdateAccountLabelsRequest.newBuilder()
+   *           .setName(AccountName.of("[ACCOUNT]").toString())
+   *           .addAllLabelIds(new ArrayList())
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .build();
+   *   Account response = accountsServiceClient.updateLabels(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 Account updateLabels(UpdateAccountLabelsRequest request) { + return updateLabelsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates labels assigned to CSS/MC accounts by a CSS domain. + * + *

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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+   *   UpdateAccountLabelsRequest request =
+   *       UpdateAccountLabelsRequest.newBuilder()
+   *           .setName(AccountName.of("[ACCOUNT]").toString())
+   *           .addAllLabelIds(new ArrayList())
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .build();
+   *   ApiFuture future = accountsServiceClient.updateLabelsCallable().futureCall(request);
+   *   // Do something.
+   *   Account response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateLabelsCallable() { + return stub.updateLabelsCallable(); + } + + @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 ListChildAccountsPagedResponse + extends AbstractPagedListResponse< + ListChildAccountsRequest, + ListChildAccountsResponse, + Account, + ListChildAccountsPage, + ListChildAccountsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListChildAccountsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListChildAccountsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListChildAccountsPagedResponse(ListChildAccountsPage page) { + super(page, ListChildAccountsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListChildAccountsPage + extends AbstractPage< + ListChildAccountsRequest, ListChildAccountsResponse, Account, ListChildAccountsPage> { + + private ListChildAccountsPage( + PageContext context, + ListChildAccountsResponse response) { + super(context, response); + } + + private static ListChildAccountsPage createEmptyPage() { + return new ListChildAccountsPage(null, null); + } + + @Override + protected ListChildAccountsPage createPage( + PageContext context, + ListChildAccountsResponse response) { + return new ListChildAccountsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListChildAccountsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListChildAccountsRequest, + ListChildAccountsResponse, + Account, + ListChildAccountsPage, + ListChildAccountsFixedSizeCollection> { + + private ListChildAccountsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListChildAccountsFixedSizeCollection createEmptyCollection() { + return new ListChildAccountsFixedSizeCollection(null, 0); + } + + @Override + protected ListChildAccountsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListChildAccountsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceSettings.java new file mode 100644 index 000000000000..fe11751e13d2 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/AccountsServiceSettings.java @@ -0,0 +1,232 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +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.shopping.css.v1.stub.AccountsServiceStubSettings; +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 AccountsServiceClient}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getAccount to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AccountsServiceSettings.Builder accountsServiceSettingsBuilder =
+ *     AccountsServiceSettings.newBuilder();
+ * accountsServiceSettingsBuilder
+ *     .getAccountSettings()
+ *     .setRetrySettings(
+ *         accountsServiceSettingsBuilder
+ *             .getAccountSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AccountsServiceSettings accountsServiceSettings = accountsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AccountsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listChildAccounts. */ + public PagedCallSettings< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings() { + return ((AccountsServiceStubSettings) getStubSettings()).listChildAccountsSettings(); + } + + /** Returns the object with the settings used for calls to getAccount. */ + public UnaryCallSettings getAccountSettings() { + return ((AccountsServiceStubSettings) getStubSettings()).getAccountSettings(); + } + + /** Returns the object with the settings used for calls to updateLabels. */ + public UnaryCallSettings updateLabelsSettings() { + return ((AccountsServiceStubSettings) getStubSettings()).updateLabelsSettings(); + } + + public static final AccountsServiceSettings create(AccountsServiceStubSettings stub) + throws IOException { + return new AccountsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AccountsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AccountsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AccountsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AccountsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AccountsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AccountsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AccountsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AccountsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 AccountsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AccountsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AccountsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AccountsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AccountsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AccountsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AccountsServiceStubSettings.newHttpJsonBuilder()); + } + + public AccountsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AccountsServiceStubSettings.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 listChildAccounts. */ + public PagedCallSettings.Builder< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings() { + return getStubSettingsBuilder().listChildAccountsSettings(); + } + + /** Returns the builder for the settings used for calls to getAccount. */ + public UnaryCallSettings.Builder getAccountSettings() { + return getStubSettingsBuilder().getAccountSettings(); + } + + /** Returns the builder for the settings used for calls to updateLabels. */ + public UnaryCallSettings.Builder updateLabelsSettings() { + return getStubSettingsBuilder().updateLabelsSettings(); + } + + @Override + public AccountsServiceSettings build() throws IOException { + return new AccountsServiceSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceClient.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceClient.java new file mode 100644 index 000000000000..ac85b7b5b518 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceClient.java @@ -0,0 +1,438 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.stub.CssProductInputsServiceStub; +import com.google.shopping.css.v1.stub.CssProductInputsServiceStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to use CssProductInput resource. This service helps to + * insert/update/delete CSS Products. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+ *     CssProductInputsServiceClient.create()) {
+ *   InsertCssProductInputRequest request =
+ *       InsertCssProductInputRequest.newBuilder()
+ *           .setParent(AccountName.of("[ACCOUNT]").toString())
+ *           .setCssProductInput(CssProductInput.newBuilder().build())
+ *           .setFeedId(-976011428)
+ *           .build();
+ *   CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(request);
+ * }
+ * }
+ * + *

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

Uploads a CssProductInput to your CSS Center account. If an input with the same contentLanguage, identity, feedLabel and feedId already exists, this method replaces that entry. + *

After inserting, updating, or deleting a CSS Product input, it may take several minutes before the processed CSS Product can be retrieved.

+ *

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

+ *
    + *
  • insertCssProductInput(InsertCssProductInputRequest request) + *
+ *

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

+ *
    + *
  • insertCssProductInputCallable() + *
+ *
DeleteCssProductInput

Deletes a CSS Product input from your CSS Center account. + *

After a delete it may take several minutes until the input is no longer available.

+ *

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

+ *
    + *
  • deleteCssProductInput(DeleteCssProductInputRequest request) + *
+ *

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

+ *
    + *
  • deleteCssProductInput(CssProductInputName name) + *
  • deleteCssProductInput(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.

+ *
    + *
  • deleteCssProductInputCallable() + *
+ *
+ * + *

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 + * CssProductInputsServiceSettings 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
+ * CssProductInputsServiceSettings cssProductInputsServiceSettings =
+ *     CssProductInputsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CssProductInputsServiceClient cssProductInputsServiceClient =
+ *     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
+ * }
+ * + *

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
+ * CssProductInputsServiceSettings cssProductInputsServiceSettings =
+ *     CssProductInputsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CssProductInputsServiceClient cssProductInputsServiceClient =
+ *     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
+ * }
+ * + *

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
+ * CssProductInputsServiceSettings cssProductInputsServiceSettings =
+ *     CssProductInputsServiceSettings.newHttpJsonBuilder().build();
+ * CssProductInputsServiceClient cssProductInputsServiceClient =
+ *     CssProductInputsServiceClient.create(cssProductInputsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CssProductInputsServiceClient implements BackgroundResource { + private final CssProductInputsServiceSettings settings; + private final CssProductInputsServiceStub stub; + + /** Constructs an instance of CssProductInputsServiceClient with default settings. */ + public static final CssProductInputsServiceClient create() throws IOException { + return create(CssProductInputsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CssProductInputsServiceClient, 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 CssProductInputsServiceClient create(CssProductInputsServiceSettings settings) + throws IOException { + return new CssProductInputsServiceClient(settings); + } + + /** + * Constructs an instance of CssProductInputsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(CssProductInputsServiceSettings). + */ + public static final CssProductInputsServiceClient create(CssProductInputsServiceStub stub) { + return new CssProductInputsServiceClient(stub); + } + + /** + * Constructs an instance of CssProductInputsServiceClient, 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 CssProductInputsServiceClient(CssProductInputsServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((CssProductInputsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected CssProductInputsServiceClient(CssProductInputsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CssProductInputsServiceSettings getSettings() { + return settings; + } + + public CssProductInputsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Uploads a CssProductInput to your CSS Center account. If an input with the same + * contentLanguage, identity, feedLabel and feedId already exists, this method replaces that + * entry. + * + *

After inserting, updating, or deleting a CSS Product input, it may take several minutes + * before the processed CSS Product can be retrieved. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   InsertCssProductInputRequest request =
+   *       InsertCssProductInputRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setCssProductInput(CssProductInput.newBuilder().build())
+   *           .setFeedId(-976011428)
+   *           .build();
+   *   CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(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 CssProductInput insertCssProductInput(InsertCssProductInputRequest request) { + return insertCssProductInputCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Uploads a CssProductInput to your CSS Center account. If an input with the same + * contentLanguage, identity, feedLabel and feedId already exists, this method replaces that + * entry. + * + *

After inserting, updating, or deleting a CSS Product input, it may take several minutes + * before the processed CSS Product can be retrieved. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   InsertCssProductInputRequest request =
+   *       InsertCssProductInputRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setCssProductInput(CssProductInput.newBuilder().build())
+   *           .setFeedId(-976011428)
+   *           .build();
+   *   ApiFuture future =
+   *       cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
+   *   // Do something.
+   *   CssProductInput response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + insertCssProductInputCallable() { + return stub.insertCssProductInputCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a CSS Product input from your CSS Center account. + * + *

After a delete it may take several minutes until the input is no longer available. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]");
+   *   cssProductInputsServiceClient.deleteCssProductInput(name);
+   * }
+   * }
+ * + * @param name Required. The name of the CSS product input resource to delete. Format: + * accounts/{account}/cssProductInputs/{css_product_input} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCssProductInput(CssProductInputName name) { + DeleteCssProductInputRequest request = + DeleteCssProductInputRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteCssProductInput(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a CSS Product input from your CSS Center account. + * + *

After a delete it may take several minutes until the input is no longer available. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   String name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString();
+   *   cssProductInputsServiceClient.deleteCssProductInput(name);
+   * }
+   * }
+ * + * @param name Required. The name of the CSS product input resource to delete. Format: + * accounts/{account}/cssProductInputs/{css_product_input} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCssProductInput(String name) { + DeleteCssProductInputRequest request = + DeleteCssProductInputRequest.newBuilder().setName(name).build(); + deleteCssProductInput(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a CSS Product input from your CSS Center account. + * + *

After a delete it may take several minutes until the input is no longer available. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   DeleteCssProductInputRequest request =
+   *       DeleteCssProductInputRequest.newBuilder()
+   *           .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString())
+   *           .setSupplementalFeedId(1845271745)
+   *           .build();
+   *   cssProductInputsServiceClient.deleteCssProductInput(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 deleteCssProductInput(DeleteCssProductInputRequest request) { + deleteCssProductInputCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a CSS Product input from your CSS Center account. + * + *

After a delete it may take several minutes until the input is no longer available. + * + *

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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+   *     CssProductInputsServiceClient.create()) {
+   *   DeleteCssProductInputRequest request =
+   *       DeleteCssProductInputRequest.newBuilder()
+   *           .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString())
+   *           .setSupplementalFeedId(1845271745)
+   *           .build();
+   *   ApiFuture future =
+   *       cssProductInputsServiceClient.deleteCssProductInputCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCssProductInputCallable() { + return stub.deleteCssProductInputCallable(); + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceSettings.java new file mode 100644 index 000000000000..928622413cd6 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceSettings.java @@ -0,0 +1,224 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.protobuf.Empty; +import com.google.shopping.css.v1.stub.CssProductInputsServiceStubSettings; +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 CssProductInputsServiceClient}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertCssProductInput to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CssProductInputsServiceSettings.Builder cssProductInputsServiceSettingsBuilder =
+ *     CssProductInputsServiceSettings.newBuilder();
+ * cssProductInputsServiceSettingsBuilder
+ *     .insertCssProductInputSettings()
+ *     .setRetrySettings(
+ *         cssProductInputsServiceSettingsBuilder
+ *             .insertCssProductInputSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CssProductInputsServiceSettings cssProductInputsServiceSettings =
+ *     cssProductInputsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CssProductInputsServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to insertCssProductInput. */ + public UnaryCallSettings + insertCssProductInputSettings() { + return ((CssProductInputsServiceStubSettings) getStubSettings()) + .insertCssProductInputSettings(); + } + + /** Returns the object with the settings used for calls to deleteCssProductInput. */ + public UnaryCallSettings deleteCssProductInputSettings() { + return ((CssProductInputsServiceStubSettings) getStubSettings()) + .deleteCssProductInputSettings(); + } + + public static final CssProductInputsServiceSettings create( + CssProductInputsServiceStubSettings stub) throws IOException { + return new CssProductInputsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CssProductInputsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CssProductInputsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CssProductInputsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CssProductInputsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CssProductInputsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CssProductInputsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CssProductInputsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CssProductInputsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 CssProductInputsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CssProductInputsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CssProductInputsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CssProductInputsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CssProductInputsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CssProductInputsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CssProductInputsServiceStubSettings.newHttpJsonBuilder()); + } + + public CssProductInputsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CssProductInputsServiceStubSettings.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 insertCssProductInput. */ + public UnaryCallSettings.Builder + insertCssProductInputSettings() { + return getStubSettingsBuilder().insertCssProductInputSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCssProductInput. */ + public UnaryCallSettings.Builder + deleteCssProductInputSettings() { + return getStubSettingsBuilder().deleteCssProductInputSettings(); + } + + @Override + public CssProductInputsServiceSettings build() throws IOException { + return new CssProductInputsServiceSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceClient.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceClient.java new file mode 100644 index 000000000000..96dde34110a1 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceClient.java @@ -0,0 +1,627 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.shopping.css.v1.stub.CssProductsServiceStub; +import com.google.shopping.css.v1.stub.CssProductsServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for doing get and list on Css Products(a.k.a Aggregate Offers + * internally). + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+ *   CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]");
+ *   CssProduct response = cssProductsServiceClient.getCssProduct(name);
+ * }
+ * }
+ * + *

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

Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.

+ *

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

+ *
    + *
  • getCssProduct(GetCssProductRequest request) + *
+ *

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

+ *
    + *
  • getCssProduct(CssProductName name) + *
  • getCssProduct(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.

+ *
    + *
  • getCssProductCallable() + *
+ *
ListCssProducts

Lists the processed CSS Products in your CSS Center account. The response might contain fewer items than specified by pageSize. Rely on pageToken to determine if there are more items to be requested. + *

After inserting, updating, or deleting a CSS product input, it may take several minutes before the updated processed CSS product can be retrieved.

+ *

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

+ *
    + *
  • listCssProducts(ListCssProductsRequest request) + *
+ *

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

+ *
    + *
  • listCssProducts(AccountName parent) + *
  • listCssProducts(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.

+ *
    + *
  • listCssProductsPagedCallable() + *
  • listCssProductsCallable() + *
+ *
+ * + *

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 CssProductsServiceSettings 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
+ * CssProductsServiceSettings cssProductsServiceSettings =
+ *     CssProductsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CssProductsServiceClient cssProductsServiceClient =
+ *     CssProductsServiceClient.create(cssProductsServiceSettings);
+ * }
+ * + *

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
+ * CssProductsServiceSettings cssProductsServiceSettings =
+ *     CssProductsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CssProductsServiceClient cssProductsServiceClient =
+ *     CssProductsServiceClient.create(cssProductsServiceSettings);
+ * }
+ * + *

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
+ * CssProductsServiceSettings cssProductsServiceSettings =
+ *     CssProductsServiceSettings.newHttpJsonBuilder().build();
+ * CssProductsServiceClient cssProductsServiceClient =
+ *     CssProductsServiceClient.create(cssProductsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CssProductsServiceClient implements BackgroundResource { + private final CssProductsServiceSettings settings; + private final CssProductsServiceStub stub; + + /** Constructs an instance of CssProductsServiceClient with default settings. */ + public static final CssProductsServiceClient create() throws IOException { + return create(CssProductsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CssProductsServiceClient, 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 CssProductsServiceClient create(CssProductsServiceSettings settings) + throws IOException { + return new CssProductsServiceClient(settings); + } + + /** + * Constructs an instance of CssProductsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CssProductsServiceSettings). + */ + public static final CssProductsServiceClient create(CssProductsServiceStub stub) { + return new CssProductsServiceClient(stub); + } + + /** + * Constructs an instance of CssProductsServiceClient, 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 CssProductsServiceClient(CssProductsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CssProductsServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected CssProductsServiceClient(CssProductsServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CssProductsServiceSettings getSettings() { + return settings; + } + + public CssProductsServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or + * deleting a product input, it may take several minutes before the updated final product can be + * retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]");
+   *   CssProduct response = cssProductsServiceClient.getCssProduct(name);
+   * }
+   * }
+ * + * @param name Required. The name of the CSS product to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CssProduct getCssProduct(CssProductName name) { + GetCssProductRequest request = + GetCssProductRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCssProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or + * deleting a product input, it may take several minutes before the updated final product can be + * retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   String name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString();
+   *   CssProduct response = cssProductsServiceClient.getCssProduct(name);
+   * }
+   * }
+ * + * @param name Required. The name of the CSS product to retrieve. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CssProduct getCssProduct(String name) { + GetCssProductRequest request = GetCssProductRequest.newBuilder().setName(name).build(); + return getCssProduct(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or + * deleting a product input, it may take several minutes before the updated final product can be + * retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   GetCssProductRequest request =
+   *       GetCssProductRequest.newBuilder()
+   *           .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString())
+   *           .build();
+   *   CssProduct response = cssProductsServiceClient.getCssProduct(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 CssProduct getCssProduct(GetCssProductRequest request) { + return getCssProductCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the processed CSS Product from your CSS Center account. After inserting, updating, or + * deleting a product input, it may take several minutes before the updated final product can be + * retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   GetCssProductRequest request =
+   *       GetCssProductRequest.newBuilder()
+   *           .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cssProductsServiceClient.getCssProductCallable().futureCall(request);
+   *   // Do something.
+   *   CssProduct response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCssProductCallable() { + return stub.getCssProductCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processed CSS Products in your CSS Center account. The response might contain fewer + * items than specified by pageSize. Rely on pageToken to determine if there are more items to be + * requested. + * + *

After inserting, updating, or deleting a CSS product input, it may take several minutes + * before the updated processed CSS product can be retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (CssProduct element : cssProductsServiceClient.listCssProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account/domain to list processed CSS Products for. Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCssProductsPagedResponse listCssProducts(AccountName parent) { + ListCssProductsRequest request = + ListCssProductsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCssProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processed CSS Products in your CSS Center account. The response might contain fewer + * items than specified by pageSize. Rely on pageToken to determine if there are more items to be + * requested. + * + *

After inserting, updating, or deleting a CSS product input, it may take several minutes + * before the updated processed CSS product can be retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (CssProduct element : cssProductsServiceClient.listCssProducts(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The account/domain to list processed CSS Products for. Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCssProductsPagedResponse listCssProducts(String parent) { + ListCssProductsRequest request = ListCssProductsRequest.newBuilder().setParent(parent).build(); + return listCssProducts(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processed CSS Products in your CSS Center account. The response might contain fewer + * items than specified by pageSize. Rely on pageToken to determine if there are more items to be + * requested. + * + *

After inserting, updating, or deleting a CSS product input, it may take several minutes + * before the updated processed CSS product can be retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   ListCssProductsRequest request =
+   *       ListCssProductsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (CssProduct element : cssProductsServiceClient.listCssProducts(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 ListCssProductsPagedResponse listCssProducts(ListCssProductsRequest request) { + return listCssProductsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processed CSS Products in your CSS Center account. The response might contain fewer + * items than specified by pageSize. Rely on pageToken to determine if there are more items to be + * requested. + * + *

After inserting, updating, or deleting a CSS product input, it may take several minutes + * before the updated processed CSS product can be retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   ListCssProductsRequest request =
+   *       ListCssProductsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cssProductsServiceClient.listCssProductsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (CssProduct element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCssProductsPagedCallable() { + return stub.listCssProductsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the processed CSS Products in your CSS Center account. The response might contain fewer + * items than specified by pageSize. Rely on pageToken to determine if there are more items to be + * requested. + * + *

After inserting, updating, or deleting a CSS product input, it may take several minutes + * before the updated processed CSS product can be retrieved. + * + *

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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+   *   ListCssProductsRequest request =
+   *       ListCssProductsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListCssProductsResponse response =
+   *         cssProductsServiceClient.listCssProductsCallable().call(request);
+   *     for (CssProduct element : response.getCssProductsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCssProductsCallable() { + return stub.listCssProductsCallable(); + } + + @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 ListCssProductsPagedResponse + extends AbstractPagedListResponse< + ListCssProductsRequest, + ListCssProductsResponse, + CssProduct, + ListCssProductsPage, + ListCssProductsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCssProductsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCssProductsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCssProductsPagedResponse(ListCssProductsPage page) { + super(page, ListCssProductsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCssProductsPage + extends AbstractPage< + ListCssProductsRequest, ListCssProductsResponse, CssProduct, ListCssProductsPage> { + + private ListCssProductsPage( + PageContext context, + ListCssProductsResponse response) { + super(context, response); + } + + private static ListCssProductsPage createEmptyPage() { + return new ListCssProductsPage(null, null); + } + + @Override + protected ListCssProductsPage createPage( + PageContext context, + ListCssProductsResponse response) { + return new ListCssProductsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCssProductsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCssProductsRequest, + ListCssProductsResponse, + CssProduct, + ListCssProductsPage, + ListCssProductsFixedSizeCollection> { + + private ListCssProductsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCssProductsFixedSizeCollection createEmptyCollection() { + return new ListCssProductsFixedSizeCollection(null, 0); + } + + @Override + protected ListCssProductsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCssProductsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceSettings.java new file mode 100644 index 000000000000..381f56957a31 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/CssProductsServiceSettings.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +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.shopping.css.v1.stub.CssProductsServiceStubSettings; +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 CssProductsServiceClient}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getCssProduct to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CssProductsServiceSettings.Builder cssProductsServiceSettingsBuilder =
+ *     CssProductsServiceSettings.newBuilder();
+ * cssProductsServiceSettingsBuilder
+ *     .getCssProductSettings()
+ *     .setRetrySettings(
+ *         cssProductsServiceSettingsBuilder
+ *             .getCssProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CssProductsServiceSettings cssProductsServiceSettings =
+ *     cssProductsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CssProductsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getCssProduct. */ + public UnaryCallSettings getCssProductSettings() { + return ((CssProductsServiceStubSettings) getStubSettings()).getCssProductSettings(); + } + + /** Returns the object with the settings used for calls to listCssProducts. */ + public PagedCallSettings< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings() { + return ((CssProductsServiceStubSettings) getStubSettings()).listCssProductsSettings(); + } + + public static final CssProductsServiceSettings create(CssProductsServiceStubSettings stub) + throws IOException { + return new CssProductsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CssProductsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CssProductsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CssProductsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CssProductsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CssProductsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CssProductsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CssProductsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CssProductsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + 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 CssProductsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CssProductsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CssProductsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(CssProductsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CssProductsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CssProductsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CssProductsServiceStubSettings.newHttpJsonBuilder()); + } + + public CssProductsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CssProductsServiceStubSettings.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 getCssProduct. */ + public UnaryCallSettings.Builder getCssProductSettings() { + return getStubSettingsBuilder().getCssProductSettings(); + } + + /** Returns the builder for the settings used for calls to listCssProducts. */ + public PagedCallSettings.Builder< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings() { + return getStubSettingsBuilder().listCssProductsSettings(); + } + + @Override + public CssProductsServiceSettings build() throws IOException { + return new CssProductsServiceSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/gapic_metadata.json b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/gapic_metadata.json new file mode 100644 index 000000000000..c98a17f3490b --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/gapic_metadata.json @@ -0,0 +1,78 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.css.v1", + "libraryPackage": "com.google.shopping.css.v1", + "services": { + "AccountsService": { + "clients": { + "grpc": { + "libraryClient": "AccountsServiceClient", + "rpcs": { + "GetAccount": { + "methods": ["getAccount", "getAccount", "getAccount", "getAccountCallable"] + }, + "ListChildAccounts": { + "methods": ["listChildAccounts", "listChildAccounts", "listChildAccounts", "listChildAccountsPagedCallable", "listChildAccountsCallable"] + }, + "UpdateLabels": { + "methods": ["updateLabels", "updateLabels", "updateLabels", "updateLabelsCallable"] + } + } + } + } + }, + "AccountLabelsService": { + "clients": { + "grpc": { + "libraryClient": "AccountLabelsServiceClient", + "rpcs": { + "CreateAccountLabel": { + "methods": ["createAccountLabel", "createAccountLabel", "createAccountLabel", "createAccountLabelCallable"] + }, + "DeleteAccountLabel": { + "methods": ["deleteAccountLabel", "deleteAccountLabel", "deleteAccountLabel", "deleteAccountLabelCallable"] + }, + "ListAccountLabels": { + "methods": ["listAccountLabels", "listAccountLabels", "listAccountLabels", "listAccountLabelsPagedCallable", "listAccountLabelsCallable"] + }, + "UpdateAccountLabel": { + "methods": ["updateAccountLabel", "updateAccountLabel", "updateAccountLabelCallable"] + } + } + } + } + }, + "CssProductInputsService": { + "clients": { + "grpc": { + "libraryClient": "CssProductInputsServiceClient", + "rpcs": { + "DeleteCssProductInput": { + "methods": ["deleteCssProductInput", "deleteCssProductInput", "deleteCssProductInput", "deleteCssProductInputCallable"] + }, + "InsertCssProductInput": { + "methods": ["insertCssProductInput", "insertCssProductInputCallable"] + } + } + } + } + }, + "CssProductsService": { + "clients": { + "grpc": { + "libraryClient": "CssProductsServiceClient", + "rpcs": { + "GetCssProduct": { + "methods": ["getCssProduct", "getCssProduct", "getCssProduct", "getCssProductCallable"] + }, + "ListCssProducts": { + "methods": ["listCssProducts", "listCssProducts", "listCssProducts", "listCssProductsPagedCallable", "listCssProductsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/package-info.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/package-info.java new file mode 100644 index 000000000000..7750f87712dc --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/package-info.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 CSS API + * + *

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

======================= AccountsServiceClient ======================= + * + *

Service Description: Service for managing CSS/MC account information. + * + *

Sample for AccountsServiceClient: + * + *

{@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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) {
+ *   AccountName name = AccountName.of("[ACCOUNT]");
+ *   Account response = accountsServiceClient.getAccount(name);
+ * }
+ * }
+ * + *

======================= AccountLabelsServiceClient ======================= + * + *

Service Description: Manages Merchant Center and CSS accounts labels. + * + *

Sample for AccountLabelsServiceClient: + * + *

{@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 (AccountLabelsServiceClient accountLabelsServiceClient =
+ *     AccountLabelsServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   AccountLabel accountLabel = AccountLabel.newBuilder().build();
+ *   AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel);
+ * }
+ * }
+ * + *

======================= CssProductInputsServiceClient ======================= + * + *

Service Description: Service to use CssProductInput resource. This service helps to + * insert/update/delete CSS Products. + * + *

Sample for CssProductInputsServiceClient: + * + *

{@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 (CssProductInputsServiceClient cssProductInputsServiceClient =
+ *     CssProductInputsServiceClient.create()) {
+ *   InsertCssProductInputRequest request =
+ *       InsertCssProductInputRequest.newBuilder()
+ *           .setParent(AccountName.of("[ACCOUNT]").toString())
+ *           .setCssProductInput(CssProductInput.newBuilder().build())
+ *           .setFeedId(-976011428)
+ *           .build();
+ *   CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(request);
+ * }
+ * }
+ * + *

======================= CssProductsServiceClient ======================= + * + *

Service Description: Service for doing get and list on Css Products(a.k.a Aggregate Offers + * internally). + * + *

Sample for CssProductsServiceClient: + * + *

{@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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) {
+ *   CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]");
+ *   CssProduct response = cssProductsServiceClient.getCssProduct(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.css.v1; + +import javax.annotation.Generated; diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStub.java new file mode 100644 index 000000000000..a4ef5d89be73 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStub.java @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.CreateAccountLabelRequest; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; +import com.google.shopping.css.v1.ListAccountLabelsRequest; +import com.google.shopping.css.v1.ListAccountLabelsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AccountLabelsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AccountLabelsServiceStub implements BackgroundResource { + + public UnaryCallable + listAccountLabelsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAccountLabelsPagedCallable()"); + } + + public UnaryCallable + listAccountLabelsCallable() { + throw new UnsupportedOperationException("Not implemented: listAccountLabelsCallable()"); + } + + public UnaryCallable createAccountLabelCallable() { + throw new UnsupportedOperationException("Not implemented: createAccountLabelCallable()"); + } + + public UnaryCallable updateAccountLabelCallable() { + throw new UnsupportedOperationException("Not implemented: updateAccountLabelCallable()"); + } + + public UnaryCallable deleteAccountLabelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAccountLabelCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStubSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStubSettings.java new file mode 100644 index 000000000000..e376c209509d --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountLabelsServiceStubSettings.java @@ -0,0 +1,503 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.CreateAccountLabelRequest; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; +import com.google.shopping.css.v1.ListAccountLabelsRequest; +import com.google.shopping.css.v1.ListAccountLabelsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AccountLabelsServiceStub}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createAccountLabel to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AccountLabelsServiceStubSettings.Builder accountLabelsServiceSettingsBuilder =
+ *     AccountLabelsServiceStubSettings.newBuilder();
+ * accountLabelsServiceSettingsBuilder
+ *     .createAccountLabelSettings()
+ *     .setRetrySettings(
+ *         accountLabelsServiceSettingsBuilder
+ *             .createAccountLabelSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AccountLabelsServiceStubSettings accountLabelsServiceSettings =
+ *     accountLabelsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AccountLabelsServiceStubSettings + 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 PagedCallSettings< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings; + private final UnaryCallSettings + createAccountLabelSettings; + private final UnaryCallSettings + updateAccountLabelSettings; + private final UnaryCallSettings deleteAccountLabelSettings; + + private static final PagedListDescriptor< + ListAccountLabelsRequest, ListAccountLabelsResponse, AccountLabel> + LIST_ACCOUNT_LABELS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAccountLabelsRequest, ListAccountLabelsResponse, AccountLabel>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAccountLabelsRequest injectToken( + ListAccountLabelsRequest payload, String token) { + return ListAccountLabelsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAccountLabelsRequest injectPageSize( + ListAccountLabelsRequest payload, int pageSize) { + return ListAccountLabelsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAccountLabelsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAccountLabelsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAccountLabelsResponse payload) { + return payload.getAccountLabelsList() == null + ? ImmutableList.of() + : payload.getAccountLabelsList(); + } + }; + + private static final PagedListResponseFactory< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + LIST_ACCOUNT_LABELS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAccountLabelsRequest, + ListAccountLabelsResponse, + ListAccountLabelsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAccountLabelsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_ACCOUNT_LABELS_PAGE_STR_DESC, request, context); + return ListAccountLabelsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listAccountLabels. */ + public PagedCallSettings< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings() { + return listAccountLabelsSettings; + } + + /** Returns the object with the settings used for calls to createAccountLabel. */ + public UnaryCallSettings createAccountLabelSettings() { + return createAccountLabelSettings; + } + + /** Returns the object with the settings used for calls to updateAccountLabel. */ + public UnaryCallSettings updateAccountLabelSettings() { + return updateAccountLabelSettings; + } + + /** Returns the object with the settings used for calls to deleteAccountLabel. */ + public UnaryCallSettings deleteAccountLabelSettings() { + return deleteAccountLabelSettings; + } + + public AccountLabelsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAccountLabelsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAccountLabelsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "css"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "css.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "css.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AccountLabelsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AccountLabelsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AccountLabelsServiceStubSettings.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 AccountLabelsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listAccountLabelsSettings = settingsBuilder.listAccountLabelsSettings().build(); + createAccountLabelSettings = settingsBuilder.createAccountLabelSettings().build(); + updateAccountLabelSettings = settingsBuilder.updateAccountLabelSettings().build(); + deleteAccountLabelSettings = settingsBuilder.deleteAccountLabelSettings().build(); + } + + /** Builder for AccountLabelsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings; + private final UnaryCallSettings.Builder + createAccountLabelSettings; + private final UnaryCallSettings.Builder + updateAccountLabelSettings; + private final UnaryCallSettings.Builder + deleteAccountLabelSettings; + 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))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAccountLabelsSettings = PagedCallSettings.newBuilder(LIST_ACCOUNT_LABELS_PAGE_STR_FACT); + createAccountLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateAccountLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteAccountLabelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAccountLabelsSettings, + createAccountLabelSettings, + updateAccountLabelSettings, + deleteAccountLabelSettings); + initDefaults(this); + } + + protected Builder(AccountLabelsServiceStubSettings settings) { + super(settings); + + listAccountLabelsSettings = settings.listAccountLabelsSettings.toBuilder(); + createAccountLabelSettings = settings.createAccountLabelSettings.toBuilder(); + updateAccountLabelSettings = settings.updateAccountLabelSettings.toBuilder(); + deleteAccountLabelSettings = settings.deleteAccountLabelSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listAccountLabelsSettings, + createAccountLabelSettings, + updateAccountLabelSettings, + deleteAccountLabelSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listAccountLabelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createAccountLabelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateAccountLabelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteAccountLabelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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 listAccountLabels. */ + public PagedCallSettings.Builder< + ListAccountLabelsRequest, ListAccountLabelsResponse, ListAccountLabelsPagedResponse> + listAccountLabelsSettings() { + return listAccountLabelsSettings; + } + + /** Returns the builder for the settings used for calls to createAccountLabel. */ + public UnaryCallSettings.Builder + createAccountLabelSettings() { + return createAccountLabelSettings; + } + + /** Returns the builder for the settings used for calls to updateAccountLabel. */ + public UnaryCallSettings.Builder + updateAccountLabelSettings() { + return updateAccountLabelSettings; + } + + /** Returns the builder for the settings used for calls to deleteAccountLabel. */ + public UnaryCallSettings.Builder + deleteAccountLabelSettings() { + return deleteAccountLabelSettings; + } + + @Override + public AccountLabelsServiceStubSettings build() throws IOException { + return new AccountLabelsServiceStubSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStub.java new file mode 100644 index 000000000000..9294591400ed --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStub.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.GetAccountRequest; +import com.google.shopping.css.v1.ListChildAccountsRequest; +import com.google.shopping.css.v1.ListChildAccountsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AccountsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AccountsServiceStub implements BackgroundResource { + + public UnaryCallable + listChildAccountsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listChildAccountsPagedCallable()"); + } + + public UnaryCallable + listChildAccountsCallable() { + throw new UnsupportedOperationException("Not implemented: listChildAccountsCallable()"); + } + + public UnaryCallable getAccountCallable() { + throw new UnsupportedOperationException("Not implemented: getAccountCallable()"); + } + + public UnaryCallable updateLabelsCallable() { + throw new UnsupportedOperationException("Not implemented: updateLabelsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStubSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStubSettings.java new file mode 100644 index 000000000000..3da7cbf7cf6d --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/AccountsServiceStubSettings.java @@ -0,0 +1,464 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.GetAccountRequest; +import com.google.shopping.css.v1.ListChildAccountsRequest; +import com.google.shopping.css.v1.ListChildAccountsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AccountsServiceStub}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getAccount to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AccountsServiceStubSettings.Builder accountsServiceSettingsBuilder =
+ *     AccountsServiceStubSettings.newBuilder();
+ * accountsServiceSettingsBuilder
+ *     .getAccountSettings()
+ *     .setRetrySettings(
+ *         accountsServiceSettingsBuilder
+ *             .getAccountSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AccountsServiceStubSettings accountsServiceSettings = accountsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AccountsServiceStubSettings 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 PagedCallSettings< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings; + private final UnaryCallSettings getAccountSettings; + private final UnaryCallSettings updateLabelsSettings; + + private static final PagedListDescriptor< + ListChildAccountsRequest, ListChildAccountsResponse, Account> + LIST_CHILD_ACCOUNTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListChildAccountsRequest injectToken( + ListChildAccountsRequest payload, String token) { + return ListChildAccountsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListChildAccountsRequest injectPageSize( + ListChildAccountsRequest payload, int pageSize) { + return ListChildAccountsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListChildAccountsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListChildAccountsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListChildAccountsResponse payload) { + return payload.getAccountsList() == null + ? ImmutableList.of() + : payload.getAccountsList(); + } + }; + + private static final PagedListResponseFactory< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + LIST_CHILD_ACCOUNTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListChildAccountsRequest, + ListChildAccountsResponse, + ListChildAccountsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListChildAccountsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CHILD_ACCOUNTS_PAGE_STR_DESC, request, context); + return ListChildAccountsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listChildAccounts. */ + public PagedCallSettings< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings() { + return listChildAccountsSettings; + } + + /** Returns the object with the settings used for calls to getAccount. */ + public UnaryCallSettings getAccountSettings() { + return getAccountSettings; + } + + /** Returns the object with the settings used for calls to updateLabels. */ + public UnaryCallSettings updateLabelsSettings() { + return updateLabelsSettings; + } + + public AccountsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAccountsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAccountsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "css"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "css.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "css.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AccountsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AccountsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AccountsServiceStubSettings.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 AccountsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listChildAccountsSettings = settingsBuilder.listChildAccountsSettings().build(); + getAccountSettings = settingsBuilder.getAccountSettings().build(); + updateLabelsSettings = settingsBuilder.updateLabelsSettings().build(); + } + + /** Builder for AccountsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings; + private final UnaryCallSettings.Builder getAccountSettings; + private final UnaryCallSettings.Builder + updateLabelsSettings; + 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))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listChildAccountsSettings = PagedCallSettings.newBuilder(LIST_CHILD_ACCOUNTS_PAGE_STR_FACT); + getAccountSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateLabelsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listChildAccountsSettings, getAccountSettings, updateLabelsSettings); + initDefaults(this); + } + + protected Builder(AccountsServiceStubSettings settings) { + super(settings); + + listChildAccountsSettings = settings.listChildAccountsSettings.toBuilder(); + getAccountSettings = settings.getAccountSettings.toBuilder(); + updateLabelsSettings = settings.updateLabelsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listChildAccountsSettings, getAccountSettings, updateLabelsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listChildAccountsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getAccountSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateLabelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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 listChildAccounts. */ + public PagedCallSettings.Builder< + ListChildAccountsRequest, ListChildAccountsResponse, ListChildAccountsPagedResponse> + listChildAccountsSettings() { + return listChildAccountsSettings; + } + + /** Returns the builder for the settings used for calls to getAccount. */ + public UnaryCallSettings.Builder getAccountSettings() { + return getAccountSettings; + } + + /** Returns the builder for the settings used for calls to updateLabels. */ + public UnaryCallSettings.Builder updateLabelsSettings() { + return updateLabelsSettings; + } + + @Override + public AccountsServiceStubSettings build() throws IOException { + return new AccountsServiceStubSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStub.java new file mode 100644 index 000000000000..849bde9f1c44 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStub.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; +import com.google.shopping.css.v1.InsertCssProductInputRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CssProductInputsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CssProductInputsServiceStub implements BackgroundResource { + + public UnaryCallable + insertCssProductInputCallable() { + throw new UnsupportedOperationException("Not implemented: insertCssProductInputCallable()"); + } + + public UnaryCallable deleteCssProductInputCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCssProductInputCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStubSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStubSettings.java new file mode 100644 index 000000000000..491918e696a7 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductInputsServiceStubSettings.java @@ -0,0 +1,361 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.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.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; +import com.google.shopping.css.v1.InsertCssProductInputRequest; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CssProductInputsServiceStub}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertCssProductInput to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CssProductInputsServiceStubSettings.Builder cssProductInputsServiceSettingsBuilder =
+ *     CssProductInputsServiceStubSettings.newBuilder();
+ * cssProductInputsServiceSettingsBuilder
+ *     .insertCssProductInputSettings()
+ *     .setRetrySettings(
+ *         cssProductInputsServiceSettingsBuilder
+ *             .insertCssProductInputSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CssProductInputsServiceStubSettings cssProductInputsServiceSettings =
+ *     cssProductInputsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CssProductInputsServiceStubSettings + 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 + insertCssProductInputSettings; + private final UnaryCallSettings + deleteCssProductInputSettings; + + /** Returns the object with the settings used for calls to insertCssProductInput. */ + public UnaryCallSettings + insertCssProductInputSettings() { + return insertCssProductInputSettings; + } + + /** Returns the object with the settings used for calls to deleteCssProductInput. */ + public UnaryCallSettings deleteCssProductInputSettings() { + return deleteCssProductInputSettings; + } + + public CssProductInputsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCssProductInputsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCssProductInputsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "css"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "css.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "css.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CssProductInputsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CssProductInputsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CssProductInputsServiceStubSettings.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 CssProductInputsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + insertCssProductInputSettings = settingsBuilder.insertCssProductInputSettings().build(); + deleteCssProductInputSettings = settingsBuilder.deleteCssProductInputSettings().build(); + } + + /** Builder for CssProductInputsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + insertCssProductInputSettings; + private final UnaryCallSettings.Builder + deleteCssProductInputSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + insertCssProductInputSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteCssProductInputSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + insertCssProductInputSettings, deleteCssProductInputSettings); + initDefaults(this); + } + + protected Builder(CssProductInputsServiceStubSettings settings) { + super(settings); + + insertCssProductInputSettings = settings.insertCssProductInputSettings.toBuilder(); + deleteCssProductInputSettings = settings.deleteCssProductInputSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + insertCssProductInputSettings, deleteCssProductInputSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .insertCssProductInputSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteCssProductInputSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_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 insertCssProductInput. */ + public UnaryCallSettings.Builder + insertCssProductInputSettings() { + return insertCssProductInputSettings; + } + + /** Returns the builder for the settings used for calls to deleteCssProductInput. */ + public UnaryCallSettings.Builder + deleteCssProductInputSettings() { + return deleteCssProductInputSettings; + } + + @Override + public CssProductInputsServiceStubSettings build() throws IOException { + return new CssProductInputsServiceStubSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStub.java new file mode 100644 index 000000000000..a02c4299128b --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStub.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.GetCssProductRequest; +import com.google.shopping.css.v1.ListCssProductsRequest; +import com.google.shopping.css.v1.ListCssProductsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CssProductsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CssProductsServiceStub implements BackgroundResource { + + public UnaryCallable getCssProductCallable() { + throw new UnsupportedOperationException("Not implemented: getCssProductCallable()"); + } + + public UnaryCallable + listCssProductsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCssProductsPagedCallable()"); + } + + public UnaryCallable listCssProductsCallable() { + throw new UnsupportedOperationException("Not implemented: listCssProductsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStubSettings.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStubSettings.java new file mode 100644 index 000000000000..7e1e7e57b91e --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/CssProductsServiceStubSettings.java @@ -0,0 +1,430 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.GetCssProductRequest; +import com.google.shopping.css.v1.ListCssProductsRequest; +import com.google.shopping.css.v1.ListCssProductsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CssProductsServiceStub}. + * + *

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

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

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of getCssProduct to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * CssProductsServiceStubSettings.Builder cssProductsServiceSettingsBuilder =
+ *     CssProductsServiceStubSettings.newBuilder();
+ * cssProductsServiceSettingsBuilder
+ *     .getCssProductSettings()
+ *     .setRetrySettings(
+ *         cssProductsServiceSettingsBuilder
+ *             .getCssProductSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CssProductsServiceStubSettings cssProductsServiceSettings =
+ *     cssProductsServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CssProductsServiceStubSettings 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 getCssProductSettings; + private final PagedCallSettings< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings; + + private static final PagedListDescriptor< + ListCssProductsRequest, ListCssProductsResponse, CssProduct> + LIST_CSS_PRODUCTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCssProductsRequest injectToken( + ListCssProductsRequest payload, String token) { + return ListCssProductsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCssProductsRequest injectPageSize( + ListCssProductsRequest payload, int pageSize) { + return ListCssProductsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCssProductsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCssProductsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCssProductsResponse payload) { + return payload.getCssProductsList() == null + ? ImmutableList.of() + : payload.getCssProductsList(); + } + }; + + private static final PagedListResponseFactory< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + LIST_CSS_PRODUCTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCssProductsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CSS_PRODUCTS_PAGE_STR_DESC, request, context); + return ListCssProductsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getCssProduct. */ + public UnaryCallSettings getCssProductSettings() { + return getCssProductSettings; + } + + /** Returns the object with the settings used for calls to listCssProducts. */ + public PagedCallSettings< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings() { + return listCssProductsSettings; + } + + public CssProductsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCssProductsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCssProductsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "css"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "css.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "css.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(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CssProductsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CssProductsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CssProductsServiceStubSettings.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 CssProductsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getCssProductSettings = settingsBuilder.getCssProductSettings().build(); + listCssProductsSettings = settingsBuilder.listCssProductsSettings().build(); + } + + /** Builder for CssProductsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getCssProductSettings; + private final PagedCallSettings.Builder< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getCssProductSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCssProductsSettings = PagedCallSettings.newBuilder(LIST_CSS_PRODUCTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getCssProductSettings, listCssProductsSettings); + initDefaults(this); + } + + protected Builder(CssProductsServiceStubSettings settings) { + super(settings); + + getCssProductSettings = settings.getCssProductSettings.toBuilder(); + listCssProductsSettings = settings.listCssProductsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getCssProductSettings, listCssProductsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getCssProductSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listCssProductsSettings() + .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 getCssProduct. */ + public UnaryCallSettings.Builder getCssProductSettings() { + return getCssProductSettings; + } + + /** Returns the builder for the settings used for calls to listCssProducts. */ + public PagedCallSettings.Builder< + ListCssProductsRequest, ListCssProductsResponse, ListCssProductsPagedResponse> + listCssProductsSettings() { + return listCssProductsSettings; + } + + @Override + public CssProductsServiceStubSettings build() throws IOException { + return new CssProductsServiceStubSettings(this); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceCallableFactory.java new file mode 100644 index 000000000000..1c72065bbb65 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 AccountLabelsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAccountLabelsServiceCallableFactory 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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceStub.java new file mode 100644 index 000000000000..cfc07b3577eb --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountLabelsServiceStub.java @@ -0,0 +1,282 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +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.css.v1.AccountLabel; +import com.google.shopping.css.v1.CreateAccountLabelRequest; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; +import com.google.shopping.css.v1.ListAccountLabelsRequest; +import com.google.shopping.css.v1.ListAccountLabelsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; +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 AccountLabelsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAccountLabelsServiceStub extends AccountLabelsServiceStub { + private static final MethodDescriptor + listAccountLabelsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/ListAccountLabels") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAccountLabelsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAccountLabelsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createAccountLabelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/CreateAccountLabel") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAccountLabelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AccountLabel.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateAccountLabelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/UpdateAccountLabel") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAccountLabelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(AccountLabel.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteAccountLabelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/DeleteAccountLabel") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteAccountLabelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable + listAccountLabelsCallable; + private final UnaryCallable + listAccountLabelsPagedCallable; + private final UnaryCallable createAccountLabelCallable; + private final UnaryCallable updateAccountLabelCallable; + private final UnaryCallable deleteAccountLabelCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAccountLabelsServiceStub create(AccountLabelsServiceStubSettings settings) + throws IOException { + return new GrpcAccountLabelsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAccountLabelsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAccountLabelsServiceStub( + AccountLabelsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAccountLabelsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAccountLabelsServiceStub( + AccountLabelsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAccountLabelsServiceStub, 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 GrpcAccountLabelsServiceStub( + AccountLabelsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAccountLabelsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAccountLabelsServiceStub, 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 GrpcAccountLabelsServiceStub( + AccountLabelsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listAccountLabelsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAccountLabelsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings createAccountLabelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAccountLabelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateAccountLabelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateAccountLabelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "account_label.name", String.valueOf(request.getAccountLabel().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteAccountLabelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteAccountLabelMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listAccountLabelsCallable = + callableFactory.createUnaryCallable( + listAccountLabelsTransportSettings, + settings.listAccountLabelsSettings(), + clientContext); + this.listAccountLabelsPagedCallable = + callableFactory.createPagedCallable( + listAccountLabelsTransportSettings, + settings.listAccountLabelsSettings(), + clientContext); + this.createAccountLabelCallable = + callableFactory.createUnaryCallable( + createAccountLabelTransportSettings, + settings.createAccountLabelSettings(), + clientContext); + this.updateAccountLabelCallable = + callableFactory.createUnaryCallable( + updateAccountLabelTransportSettings, + settings.updateAccountLabelSettings(), + clientContext); + this.deleteAccountLabelCallable = + callableFactory.createUnaryCallable( + deleteAccountLabelTransportSettings, + settings.deleteAccountLabelSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listAccountLabelsCallable() { + return listAccountLabelsCallable; + } + + @Override + public UnaryCallable + listAccountLabelsPagedCallable() { + return listAccountLabelsPagedCallable; + } + + @Override + public UnaryCallable createAccountLabelCallable() { + return createAccountLabelCallable; + } + + @Override + public UnaryCallable updateAccountLabelCallable() { + return updateAccountLabelCallable; + } + + @Override + public UnaryCallable deleteAccountLabelCallable() { + return deleteAccountLabelCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceCallableFactory.java new file mode 100644 index 000000000000..23c7e4fac240 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 AccountsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAccountsServiceCallableFactory 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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceStub.java new file mode 100644 index 000000000000..26c14f43edb1 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcAccountsServiceStub.java @@ -0,0 +1,242 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +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.css.v1.Account; +import com.google.shopping.css.v1.GetAccountRequest; +import com.google.shopping.css.v1.ListChildAccountsRequest; +import com.google.shopping.css.v1.ListChildAccountsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +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 AccountsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAccountsServiceStub extends AccountsServiceStub { + private static final MethodDescriptor + listChildAccountsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountsService/ListChildAccounts") + .setRequestMarshaller( + ProtoUtils.marshaller(ListChildAccountsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListChildAccountsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getAccountMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountsService/GetAccount") + .setRequestMarshaller(ProtoUtils.marshaller(GetAccountRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Account.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateLabelsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.AccountsService/UpdateLabels") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateAccountLabelsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Account.getDefaultInstance())) + .build(); + + private final UnaryCallable + listChildAccountsCallable; + private final UnaryCallable + listChildAccountsPagedCallable; + private final UnaryCallable getAccountCallable; + private final UnaryCallable updateLabelsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAccountsServiceStub create(AccountsServiceStubSettings settings) + throws IOException { + return new GrpcAccountsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAccountsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAccountsServiceStub( + AccountsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAccountsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAccountsServiceStub( + AccountsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAccountsServiceStub, 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 GrpcAccountsServiceStub( + AccountsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAccountsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAccountsServiceStub, 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 GrpcAccountsServiceStub( + AccountsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listChildAccountsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listChildAccountsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getAccountTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAccountMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateLabelsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateLabelsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listChildAccountsCallable = + callableFactory.createUnaryCallable( + listChildAccountsTransportSettings, + settings.listChildAccountsSettings(), + clientContext); + this.listChildAccountsPagedCallable = + callableFactory.createPagedCallable( + listChildAccountsTransportSettings, + settings.listChildAccountsSettings(), + clientContext); + this.getAccountCallable = + callableFactory.createUnaryCallable( + getAccountTransportSettings, settings.getAccountSettings(), clientContext); + this.updateLabelsCallable = + callableFactory.createUnaryCallable( + updateLabelsTransportSettings, settings.updateLabelsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listChildAccountsCallable() { + return listChildAccountsCallable; + } + + @Override + public UnaryCallable + listChildAccountsPagedCallable() { + return listChildAccountsPagedCallable; + } + + @Override + public UnaryCallable getAccountCallable() { + return getAccountCallable; + } + + @Override + public UnaryCallable updateLabelsCallable() { + return updateLabelsCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceCallableFactory.java new file mode 100644 index 000000000000..78cf518e8fae --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 CssProductInputsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCssProductInputsServiceCallableFactory 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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceStub.java new file mode 100644 index 000000000000..1e72b29cadb4 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductInputsServiceStub.java @@ -0,0 +1,203 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; +import com.google.shopping.css.v1.InsertCssProductInputRequest; +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 CssProductInputsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCssProductInputsServiceStub extends CssProductInputsServiceStub { + private static final MethodDescriptor + insertCssProductInputMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.css.v1.CssProductInputsService/InsertCssProductInput") + .setRequestMarshaller( + ProtoUtils.marshaller(InsertCssProductInputRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CssProductInput.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteCssProductInputMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.css.v1.CssProductInputsService/DeleteCssProductInput") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCssProductInputRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable + insertCssProductInputCallable; + private final UnaryCallable deleteCssProductInputCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCssProductInputsServiceStub create( + CssProductInputsServiceStubSettings settings) throws IOException { + return new GrpcCssProductInputsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCssProductInputsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCssProductInputsServiceStub( + CssProductInputsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCssProductInputsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCssProductInputsServiceStub( + CssProductInputsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCssProductInputsServiceStub, 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 GrpcCssProductInputsServiceStub( + CssProductInputsServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCssProductInputsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCssProductInputsServiceStub, 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 GrpcCssProductInputsServiceStub( + CssProductInputsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + insertCssProductInputTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertCssProductInputMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteCssProductInputTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCssProductInputMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.insertCssProductInputCallable = + callableFactory.createUnaryCallable( + insertCssProductInputTransportSettings, + settings.insertCssProductInputSettings(), + clientContext); + this.deleteCssProductInputCallable = + callableFactory.createUnaryCallable( + deleteCssProductInputTransportSettings, + settings.deleteCssProductInputSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + insertCssProductInputCallable() { + return insertCssProductInputCallable; + } + + @Override + public UnaryCallable deleteCssProductInputCallable() { + return deleteCssProductInputCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceCallableFactory.java new file mode 100644 index 000000000000..1751692c8756 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 CssProductsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCssProductsServiceCallableFactory 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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceStub.java new file mode 100644 index 000000000000..c48b89df6d4b --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/GrpcCssProductsServiceStub.java @@ -0,0 +1,209 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +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.css.v1.CssProduct; +import com.google.shopping.css.v1.GetCssProductRequest; +import com.google.shopping.css.v1.ListCssProductsRequest; +import com.google.shopping.css.v1.ListCssProductsResponse; +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 CssProductsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCssProductsServiceStub extends CssProductsServiceStub { + private static final MethodDescriptor + getCssProductMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.CssProductsService/GetCssProduct") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCssProductRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CssProduct.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCssProductsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.shopping.css.v1.CssProductsService/ListCssProducts") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCssProductsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCssProductsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getCssProductCallable; + private final UnaryCallable + listCssProductsCallable; + private final UnaryCallable + listCssProductsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCssProductsServiceStub create(CssProductsServiceStubSettings settings) + throws IOException { + return new GrpcCssProductsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCssProductsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCssProductsServiceStub( + CssProductsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCssProductsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCssProductsServiceStub( + CssProductsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCssProductsServiceStub, 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 GrpcCssProductsServiceStub( + CssProductsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCssProductsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCssProductsServiceStub, 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 GrpcCssProductsServiceStub( + CssProductsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getCssProductTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCssProductMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listCssProductsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCssProductsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getCssProductCallable = + callableFactory.createUnaryCallable( + getCssProductTransportSettings, settings.getCssProductSettings(), clientContext); + this.listCssProductsCallable = + callableFactory.createUnaryCallable( + listCssProductsTransportSettings, settings.listCssProductsSettings(), clientContext); + this.listCssProductsPagedCallable = + callableFactory.createPagedCallable( + listCssProductsTransportSettings, settings.listCssProductsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getCssProductCallable() { + return getCssProductCallable; + } + + @Override + public UnaryCallable listCssProductsCallable() { + return listCssProductsCallable; + } + + @Override + public UnaryCallable + listCssProductsPagedCallable() { + return listCssProductsPagedCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceCallableFactory.java new file mode 100644 index 000000000000..af6bd5d2c447 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AccountLabelsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAccountLabelsServiceCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceStub.java new file mode 100644 index 000000000000..fc961530bce4 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountLabelsServiceStub.java @@ -0,0 +1,410 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.CreateAccountLabelRequest; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; +import com.google.shopping.css.v1.ListAccountLabelsRequest; +import com.google.shopping.css.v1.ListAccountLabelsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; +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 AccountLabelsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAccountLabelsServiceStub extends AccountLabelsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listAccountLabelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/ListAccountLabels") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=accounts/*}/labels", + 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(ListAccountLabelsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createAccountLabelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/CreateAccountLabel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=accounts/*}/labels", + 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("accountLabel", request.getAccountLabel(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AccountLabel.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateAccountLabelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/UpdateAccountLabel") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{accountLabel.name=accounts/*/labels/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "accountLabel.name", request.getAccountLabel().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("accountLabel", request.getAccountLabel(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AccountLabel.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteAccountLabelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountLabelsService/DeleteAccountLabel") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=accounts/*/labels/*}", + 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 final UnaryCallable + listAccountLabelsCallable; + private final UnaryCallable + listAccountLabelsPagedCallable; + private final UnaryCallable createAccountLabelCallable; + private final UnaryCallable updateAccountLabelCallable; + private final UnaryCallable deleteAccountLabelCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAccountLabelsServiceStub create( + AccountLabelsServiceStubSettings settings) throws IOException { + return new HttpJsonAccountLabelsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAccountLabelsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAccountLabelsServiceStub( + AccountLabelsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAccountLabelsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAccountLabelsServiceStub( + AccountLabelsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonAccountLabelsServiceStub, 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 HttpJsonAccountLabelsServiceStub( + AccountLabelsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAccountLabelsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAccountLabelsServiceStub, 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 HttpJsonAccountLabelsServiceStub( + AccountLabelsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listAccountLabelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listAccountLabelsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createAccountLabelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAccountLabelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateAccountLabelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAccountLabelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "account_label.name", + String.valueOf(request.getAccountLabel().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteAccountLabelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAccountLabelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listAccountLabelsCallable = + callableFactory.createUnaryCallable( + listAccountLabelsTransportSettings, + settings.listAccountLabelsSettings(), + clientContext); + this.listAccountLabelsPagedCallable = + callableFactory.createPagedCallable( + listAccountLabelsTransportSettings, + settings.listAccountLabelsSettings(), + clientContext); + this.createAccountLabelCallable = + callableFactory.createUnaryCallable( + createAccountLabelTransportSettings, + settings.createAccountLabelSettings(), + clientContext); + this.updateAccountLabelCallable = + callableFactory.createUnaryCallable( + updateAccountLabelTransportSettings, + settings.updateAccountLabelSettings(), + clientContext); + this.deleteAccountLabelCallable = + callableFactory.createUnaryCallable( + deleteAccountLabelTransportSettings, + settings.deleteAccountLabelSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listAccountLabelsMethodDescriptor); + methodDescriptors.add(createAccountLabelMethodDescriptor); + methodDescriptors.add(updateAccountLabelMethodDescriptor); + methodDescriptors.add(deleteAccountLabelMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listAccountLabelsCallable() { + return listAccountLabelsCallable; + } + + @Override + public UnaryCallable + listAccountLabelsPagedCallable() { + return listAccountLabelsPagedCallable; + } + + @Override + public UnaryCallable createAccountLabelCallable() { + return createAccountLabelCallable; + } + + @Override + public UnaryCallable updateAccountLabelCallable() { + return updateAccountLabelCallable; + } + + @Override + public UnaryCallable deleteAccountLabelCallable() { + return deleteAccountLabelCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceCallableFactory.java new file mode 100644 index 000000000000..76f7320408a8 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AccountsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAccountsServiceCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceStub.java new file mode 100644 index 000000000000..0d2a2978079f --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonAccountsServiceStub.java @@ -0,0 +1,345 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.GetAccountRequest; +import com.google.shopping.css.v1.ListChildAccountsRequest; +import com.google.shopping.css.v1.ListChildAccountsResponse; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +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 AccountsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAccountsServiceStub extends AccountsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listChildAccountsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountsService/ListChildAccounts") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=accounts/*}:listChildAccounts", + 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(); + if (request.hasFullName()) { + serializer.putQueryParam(fields, "fullName", request.getFullName()); + } + if (request.hasLabelId()) { + serializer.putQueryParam(fields, "labelId", request.getLabelId()); + } + 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(ListChildAccountsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getAccountMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountsService/GetAccount") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=accounts/*}", + 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(); + if (request.hasParent()) { + serializer.putQueryParam(fields, "parent", request.getParent()); + } + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Account.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateLabelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.AccountsService/UpdateLabels") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=accounts/*}:updateLabels", + 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(Account.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listChildAccountsCallable; + private final UnaryCallable + listChildAccountsPagedCallable; + private final UnaryCallable getAccountCallable; + private final UnaryCallable updateLabelsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAccountsServiceStub create(AccountsServiceStubSettings settings) + throws IOException { + return new HttpJsonAccountsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAccountsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAccountsServiceStub( + AccountsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAccountsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAccountsServiceStub( + AccountsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAccountsServiceStub, 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 HttpJsonAccountsServiceStub( + AccountsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAccountsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAccountsServiceStub, 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 HttpJsonAccountsServiceStub( + AccountsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listChildAccountsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listChildAccountsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getAccountTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAccountMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateLabelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateLabelsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listChildAccountsCallable = + callableFactory.createUnaryCallable( + listChildAccountsTransportSettings, + settings.listChildAccountsSettings(), + clientContext); + this.listChildAccountsPagedCallable = + callableFactory.createPagedCallable( + listChildAccountsTransportSettings, + settings.listChildAccountsSettings(), + clientContext); + this.getAccountCallable = + callableFactory.createUnaryCallable( + getAccountTransportSettings, settings.getAccountSettings(), clientContext); + this.updateLabelsCallable = + callableFactory.createUnaryCallable( + updateLabelsTransportSettings, settings.updateLabelsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listChildAccountsMethodDescriptor); + methodDescriptors.add(getAccountMethodDescriptor); + methodDescriptors.add(updateLabelsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listChildAccountsCallable() { + return listChildAccountsCallable; + } + + @Override + public UnaryCallable + listChildAccountsPagedCallable() { + return listChildAccountsPagedCallable; + } + + @Override + public UnaryCallable getAccountCallable() { + return getAccountCallable; + } + + @Override + public UnaryCallable updateLabelsCallable() { + return updateLabelsCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceCallableFactory.java new file mode 100644 index 000000000000..ea1fd3931f04 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CssProductInputsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCssProductInputsServiceCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceStub.java new file mode 100644 index 000000000000..a24c1938885a --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductInputsServiceStub.java @@ -0,0 +1,277 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; +import com.google.shopping.css.v1.InsertCssProductInputRequest; +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 CssProductInputsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCssProductInputsServiceStub extends CssProductInputsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + insertCssProductInputMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.css.v1.CssProductInputsService/InsertCssProductInput") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=accounts/*}/cssProductInputs:insert", + 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, "feedId", request.getFeedId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("cssProductInput", request.getCssProductInput(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CssProductInput.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteCssProductInputMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.css.v1.CssProductInputsService/DeleteCssProductInput") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=accounts/*/cssProductInputs/*}", + 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(); + if (request.hasSupplementalFeedId()) { + serializer.putQueryParam( + fields, "supplementalFeedId", request.getSupplementalFeedId()); + } + 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 final UnaryCallable + insertCssProductInputCallable; + private final UnaryCallable deleteCssProductInputCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCssProductInputsServiceStub create( + CssProductInputsServiceStubSettings settings) throws IOException { + return new HttpJsonCssProductInputsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCssProductInputsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCssProductInputsServiceStub( + CssProductInputsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCssProductInputsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCssProductInputsServiceStub( + CssProductInputsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCssProductInputsServiceStub, 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 HttpJsonCssProductInputsServiceStub( + CssProductInputsServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCssProductInputsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCssProductInputsServiceStub, 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 HttpJsonCssProductInputsServiceStub( + CssProductInputsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + insertCssProductInputTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertCssProductInputMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteCssProductInputTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteCssProductInputMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.insertCssProductInputCallable = + callableFactory.createUnaryCallable( + insertCssProductInputTransportSettings, + settings.insertCssProductInputSettings(), + clientContext); + this.deleteCssProductInputCallable = + callableFactory.createUnaryCallable( + deleteCssProductInputTransportSettings, + settings.deleteCssProductInputSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(insertCssProductInputMethodDescriptor); + methodDescriptors.add(deleteCssProductInputMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + insertCssProductInputCallable() { + return insertCssProductInputCallable; + } + + @Override + public UnaryCallable deleteCssProductInputCallable() { + return deleteCssProductInputCallable; + } + + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceCallableFactory.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceCallableFactory.java new file mode 100644 index 000000000000..b7bf8a2d6b83 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CssProductsService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCssProductsServiceCallableFactory + 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); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @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-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceStub.java b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceStub.java new file mode 100644 index 000000000000..7d3b834ced27 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/java/com/google/shopping/css/v1/stub/HttpJsonCssProductsServiceStub.java @@ -0,0 +1,275 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.GetCssProductRequest; +import com.google.shopping.css.v1.ListCssProductsRequest; +import com.google.shopping.css.v1.ListCssProductsResponse; +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 CssProductsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCssProductsServiceStub extends CssProductsServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getCssProductMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.CssProductsService/GetCssProduct") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=accounts/*/cssProducts/*}", + 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(CssProduct.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCssProductsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.shopping.css.v1.CssProductsService/ListCssProducts") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=accounts/*}/cssProducts", + 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(ListCssProductsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getCssProductCallable; + private final UnaryCallable + listCssProductsCallable; + private final UnaryCallable + listCssProductsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCssProductsServiceStub create(CssProductsServiceStubSettings settings) + throws IOException { + return new HttpJsonCssProductsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCssProductsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCssProductsServiceStub( + CssProductsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCssProductsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCssProductsServiceStub( + CssProductsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCssProductsServiceStub, 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 HttpJsonCssProductsServiceStub( + CssProductsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCssProductsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCssProductsServiceStub, 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 HttpJsonCssProductsServiceStub( + CssProductsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getCssProductTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCssProductMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listCssProductsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCssProductsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.getCssProductCallable = + callableFactory.createUnaryCallable( + getCssProductTransportSettings, settings.getCssProductSettings(), clientContext); + this.listCssProductsCallable = + callableFactory.createUnaryCallable( + listCssProductsTransportSettings, settings.listCssProductsSettings(), clientContext); + this.listCssProductsPagedCallable = + callableFactory.createPagedCallable( + listCssProductsTransportSettings, settings.listCssProductsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getCssProductMethodDescriptor); + methodDescriptors.add(listCssProductsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getCssProductCallable() { + return getCssProductCallable; + } + + @Override + public UnaryCallable listCssProductsCallable() { + return listCssProductsCallable; + } + + @Override + public UnaryCallable + listCssProductsPagedCallable() { + return listCssProductsPagedCallable; + } + + @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-css/google-shopping-css/src/main/resources/META-INF/native-image/com.google.shopping.css.v1/reflect-config.json b/java-shopping-css/google-shopping-css/src/main/resources/META-INF/native-image/com.google.shopping.css.v1/reflect-config.json new file mode 100644 index 000000000000..a3f0ebc663a7 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/main/resources/META-INF/native-image/com.google.shopping.css.v1/reflect-config.json @@ -0,0 +1,1631 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$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$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$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.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.css.v1.Account", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Account$AccountType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Account$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.AccountLabel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.AccountLabel$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.AccountLabel$LabelType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Attributes", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Attributes$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Certification", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.Certification$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CreateAccountLabelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CreateAccountLabelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProduct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProduct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductInput", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductInput$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus$DestinationStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus$DestinationStatus$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus$ItemLevelIssue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.CssProductStatus$ItemLevelIssue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.DeleteAccountLabelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.DeleteAccountLabelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.DeleteCssProductInputRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.DeleteCssProductInputRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.GetAccountRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.GetAccountRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.GetCssProductRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.GetCssProductRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.InsertCssProductInputRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.InsertCssProductInputRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListAccountLabelsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListAccountLabelsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListAccountLabelsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListAccountLabelsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListChildAccountsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListChildAccountsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListChildAccountsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListChildAccountsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListCssProductsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListCssProductsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListCssProductsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ListCssProductsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductDimension", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductDimension$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductWeight", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.ProductWeight$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.UpdateAccountLabelRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.UpdateAccountLabelRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.UpdateAccountLabelsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.css.v1.UpdateAccountLabelsRequest$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 + } +] \ No newline at end of file diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientHttpJsonTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..a6516301a142 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientHttpJsonTest.java @@ -0,0 +1,420 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +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.shopping.css.v1.stub.HttpJsonAccountLabelsServiceStub; +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 AccountLabelsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AccountLabelsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAccountLabelsServiceStub.getMethodDescriptors(), + AccountLabelsServiceSettings.getDefaultEndpoint()); + AccountLabelsServiceSettings settings = + AccountLabelsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AccountLabelsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AccountLabelsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listAccountLabelsTest() throws Exception { + AccountLabel responsesElement = AccountLabel.newBuilder().build(); + ListAccountLabelsResponse expectedResponse = + ListAccountLabelsResponse.newBuilder() + .setNextPageToken("") + .addAllAccountLabels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListAccountLabelsPagedResponse pagedListResponse = client.listAccountLabels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountLabelsList().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 listAccountLabelsExceptionTest() 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.listAccountLabels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccountLabelsTest2() throws Exception { + AccountLabel responsesElement = AccountLabel.newBuilder().build(); + ListAccountLabelsResponse expectedResponse = + ListAccountLabelsResponse.newBuilder() + .setNextPageToken("") + .addAllAccountLabels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListAccountLabelsPagedResponse pagedListResponse = client.listAccountLabels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountLabelsList().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 listAccountLabelsExceptionTest2() 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.listAccountLabels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAccountLabelTest() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + + AccountLabel actualResponse = client.createAccountLabel(parent, accountLabel); + 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 createAccountLabelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + client.createAccountLabel(parent, accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAccountLabelTest2() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + + AccountLabel actualResponse = client.createAccountLabel(parent, accountLabel); + 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 createAccountLabelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + client.createAccountLabel(parent, accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAccountLabelTest() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockService.addResponse(expectedResponse); + + AccountLabel accountLabel = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + + AccountLabel actualResponse = client.updateAccountLabel(accountLabel); + 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 updateAccountLabelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountLabel accountLabel = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + client.updateAccountLabel(accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAccountLabelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]"); + + client.deleteAccountLabel(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 deleteAccountLabelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]"); + client.deleteAccountLabel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAccountLabelTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-9437/labels/label-9437"; + + client.deleteAccountLabel(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 deleteAccountLabelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-9437/labels/label-9437"; + client.deleteAccountLabel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientTest.java new file mode 100644 index 000000000000..3a4f2c7c1fc1 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountLabelsServiceClientTest.java @@ -0,0 +1,369 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountLabelsServiceClient.ListAccountLabelsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AccountLabelsServiceClientTest { + private static MockAccountLabelsService mockAccountLabelsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AccountLabelsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAccountLabelsService = new MockAccountLabelsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAccountLabelsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AccountLabelsServiceSettings settings = + AccountLabelsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AccountLabelsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listAccountLabelsTest() throws Exception { + AccountLabel responsesElement = AccountLabel.newBuilder().build(); + ListAccountLabelsResponse expectedResponse = + ListAccountLabelsResponse.newBuilder() + .setNextPageToken("") + .addAllAccountLabels(Arrays.asList(responsesElement)) + .build(); + mockAccountLabelsService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListAccountLabelsPagedResponse pagedListResponse = client.listAccountLabels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountLabelsList().get(0), resources.get(0)); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccountLabelsRequest actualRequest = ((ListAccountLabelsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccountLabelsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listAccountLabels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccountLabelsTest2() throws Exception { + AccountLabel responsesElement = AccountLabel.newBuilder().build(); + ListAccountLabelsResponse expectedResponse = + ListAccountLabelsResponse.newBuilder() + .setNextPageToken("") + .addAllAccountLabels(Arrays.asList(responsesElement)) + .build(); + mockAccountLabelsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAccountLabelsPagedResponse pagedListResponse = client.listAccountLabels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountLabelsList().get(0), resources.get(0)); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccountLabelsRequest actualRequest = ((ListAccountLabelsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccountLabelsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAccountLabels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAccountLabelTest() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockAccountLabelsService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + + AccountLabel actualResponse = client.createAccountLabel(parent, accountLabel); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAccountLabelRequest actualRequest = ((CreateAccountLabelRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(accountLabel, actualRequest.getAccountLabel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAccountLabelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + client.createAccountLabel(parent, accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createAccountLabelTest2() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockAccountLabelsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + + AccountLabel actualResponse = client.createAccountLabel(parent, accountLabel); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAccountLabelRequest actualRequest = ((CreateAccountLabelRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(accountLabel, actualRequest.getAccountLabel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAccountLabelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + String parent = "parent-995424086"; + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + client.createAccountLabel(parent, accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAccountLabelTest() throws Exception { + AccountLabel expectedResponse = + AccountLabel.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .setLabelId(-1959256506) + .setAccountId(-803333011) + .setDisplayName("displayName1714148973") + .setDescription("description-1724546052") + .build(); + mockAccountLabelsService.addResponse(expectedResponse); + + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + + AccountLabel actualResponse = client.updateAccountLabel(accountLabel); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAccountLabelRequest actualRequest = ((UpdateAccountLabelRequest) actualRequests.get(0)); + + Assert.assertEquals(accountLabel, actualRequest.getAccountLabel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAccountLabelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + client.updateAccountLabel(accountLabel); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAccountLabelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAccountLabelsService.addResponse(expectedResponse); + + AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]"); + + client.deleteAccountLabel(name); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAccountLabelRequest actualRequest = ((DeleteAccountLabelRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAccountLabelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]"); + client.deleteAccountLabel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAccountLabelTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAccountLabelsService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteAccountLabel(name); + + List actualRequests = mockAccountLabelsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAccountLabelRequest actualRequest = ((DeleteAccountLabelRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAccountLabelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountLabelsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteAccountLabel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientHttpJsonTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..e153956eb5f9 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientHttpJsonTest.java @@ -0,0 +1,378 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +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.shopping.css.v1.stub.HttpJsonAccountsServiceStub; +import java.io.IOException; +import java.util.ArrayList; +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 AccountsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AccountsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAccountsServiceStub.getMethodDescriptors(), + AccountsServiceSettings.getDefaultEndpoint()); + AccountsServiceSettings settings = + AccountsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AccountsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AccountsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listChildAccountsTest() throws Exception { + Account responsesElement = Account.newBuilder().build(); + ListChildAccountsResponse expectedResponse = + ListChildAccountsResponse.newBuilder() + .setNextPageToken("") + .addAllAccounts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListChildAccountsPagedResponse pagedListResponse = client.listChildAccounts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountsList().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 listChildAccountsExceptionTest() 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.listChildAccounts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChildAccountsTest2() throws Exception { + Account responsesElement = Account.newBuilder().build(); + ListChildAccountsResponse expectedResponse = + ListChildAccountsResponse.newBuilder() + .setNextPageToken("") + .addAllAccounts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListChildAccountsPagedResponse pagedListResponse = client.listChildAccounts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountsList().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 listChildAccountsExceptionTest2() 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.listChildAccounts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAccountTest() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + AccountName name = AccountName.of("[ACCOUNT]"); + + Account actualResponse = client.getAccount(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 getAccountExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName name = AccountName.of("[ACCOUNT]"); + client.getAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAccountTest2() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-3500"; + + Account actualResponse = client.getAccount(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 getAccountExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-3500"; + client.getAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLabelsTest() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + AccountName name = AccountName.of("[ACCOUNT]"); + + Account actualResponse = client.updateLabels(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 updateLabelsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName name = AccountName.of("[ACCOUNT]"); + client.updateLabels(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLabelsTest2() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-3500"; + + Account actualResponse = client.updateLabels(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 updateLabelsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-3500"; + client.updateLabels(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientTest.java new file mode 100644 index 000000000000..f12237331bb1 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/AccountsServiceClientTest.java @@ -0,0 +1,345 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.AccountsServiceClient.ListChildAccountsPagedResponse; + +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 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 AccountsServiceClientTest { + private static MockAccountsService mockAccountsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AccountsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAccountsService = new MockAccountsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAccountsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AccountsServiceSettings settings = + AccountsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AccountsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listChildAccountsTest() throws Exception { + Account responsesElement = Account.newBuilder().build(); + ListChildAccountsResponse expectedResponse = + ListChildAccountsResponse.newBuilder() + .setNextPageToken("") + .addAllAccounts(Arrays.asList(responsesElement)) + .build(); + mockAccountsService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListChildAccountsPagedResponse pagedListResponse = client.listChildAccounts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountsList().get(0), resources.get(0)); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListChildAccountsRequest actualRequest = ((ListChildAccountsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listChildAccountsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listChildAccounts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChildAccountsTest2() throws Exception { + Account responsesElement = Account.newBuilder().build(); + ListChildAccountsResponse expectedResponse = + ListChildAccountsResponse.newBuilder() + .setNextPageToken("") + .addAllAccounts(Arrays.asList(responsesElement)) + .build(); + mockAccountsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListChildAccountsPagedResponse pagedListResponse = client.listChildAccounts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccountsList().get(0), resources.get(0)); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListChildAccountsRequest actualRequest = ((ListChildAccountsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listChildAccountsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listChildAccounts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAccountTest() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockAccountsService.addResponse(expectedResponse); + + AccountName name = AccountName.of("[ACCOUNT]"); + + Account actualResponse = client.getAccount(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAccountRequest actualRequest = ((GetAccountRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAccountExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + AccountName name = AccountName.of("[ACCOUNT]"); + client.getAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAccountTest2() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockAccountsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Account actualResponse = client.getAccount(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAccountRequest actualRequest = ((GetAccountRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAccountExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + String name = "name3373707"; + client.getAccount(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLabelsTest() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockAccountsService.addResponse(expectedResponse); + + AccountName name = AccountName.of("[ACCOUNT]"); + + Account actualResponse = client.updateLabels(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAccountLabelsRequest actualRequest = ((UpdateAccountLabelsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateLabelsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + AccountName name = AccountName.of("[ACCOUNT]"); + client.updateLabels(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLabelsTest2() throws Exception { + Account expectedResponse = + Account.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setFullName("fullName1330852282") + .setDisplayName("displayName1714148973") + .setHomepageUri("homepageUri1440042654") + .setParent("parent-995424086") + .addAllLabelIds(new ArrayList()) + .addAllAutomaticLabelIds(new ArrayList()) + .build(); + mockAccountsService.addResponse(expectedResponse); + + String name = "name3373707"; + + Account actualResponse = client.updateLabels(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAccountsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAccountLabelsRequest actualRequest = ((UpdateAccountLabelsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateLabelsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAccountsService.addException(exception); + + try { + String name = "name3373707"; + client.updateLabels(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientHttpJsonTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..5d68b1c9991d --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientHttpJsonTest.java @@ -0,0 +1,218 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.Empty; +import com.google.protobuf.Timestamp; +import com.google.shopping.css.v1.stub.HttpJsonCssProductInputsServiceStub; +import com.google.shopping.type.CustomAttribute; +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 CssProductInputsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static CssProductInputsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCssProductInputsServiceStub.getMethodDescriptors(), + CssProductInputsServiceSettings.getDefaultEndpoint()); + CssProductInputsServiceSettings settings = + CssProductInputsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CssProductInputsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CssProductInputsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void insertCssProductInputTest() throws Exception { + CssProductInput expectedResponse = + CssProductInput.newBuilder() + .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString()) + .setFinalName("finalName355075361") + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setFreshnessTime(Timestamp.newBuilder().build()) + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + + CssProductInput actualResponse = client.insertCssProductInput(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void insertCssProductInputExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + client.insertCssProductInput(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCssProductInputTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]"); + + client.deleteCssProductInput(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 deleteCssProductInputExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]"); + client.deleteCssProductInput(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCssProductInputTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-861/cssProductInputs/cssProductInput-861"; + + client.deleteCssProductInput(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 deleteCssProductInputExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-861/cssProductInputs/cssProductInput-861"; + client.deleteCssProductInput(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientTest.java new file mode 100644 index 000000000000..c7a2a0627d12 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductInputsServiceClientTest.java @@ -0,0 +1,210 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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.Empty; +import com.google.protobuf.Timestamp; +import com.google.shopping.type.CustomAttribute; +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 CssProductInputsServiceClientTest { + private static MockCssProductInputsService mockCssProductInputsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CssProductInputsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCssProductInputsService = new MockCssProductInputsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCssProductInputsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CssProductInputsServiceSettings settings = + CssProductInputsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CssProductInputsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void insertCssProductInputTest() throws Exception { + CssProductInput expectedResponse = + CssProductInput.newBuilder() + .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString()) + .setFinalName("finalName355075361") + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setFreshnessTime(Timestamp.newBuilder().build()) + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .build(); + mockCssProductInputsService.addResponse(expectedResponse); + + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + + CssProductInput actualResponse = client.insertCssProductInput(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCssProductInputsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InsertCssProductInputRequest actualRequest = + ((InsertCssProductInputRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getCssProductInput(), actualRequest.getCssProductInput()); + Assert.assertEquals(request.getFeedId(), actualRequest.getFeedId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertCssProductInputExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductInputsService.addException(exception); + + try { + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + client.insertCssProductInput(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCssProductInputTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCssProductInputsService.addResponse(expectedResponse); + + CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]"); + + client.deleteCssProductInput(name); + + List actualRequests = mockCssProductInputsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCssProductInputRequest actualRequest = + ((DeleteCssProductInputRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCssProductInputExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductInputsService.addException(exception); + + try { + CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]"); + client.deleteCssProductInput(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCssProductInputTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockCssProductInputsService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteCssProductInput(name); + + List actualRequests = mockCssProductInputsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCssProductInputRequest actualRequest = + ((DeleteCssProductInputRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCssProductInputExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductInputsService.addException(exception); + + try { + String name = "name3373707"; + client.deleteCssProductInput(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientHttpJsonTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..b4809141a118 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientHttpJsonTest.java @@ -0,0 +1,279 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +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.shopping.css.v1.stub.HttpJsonCssProductsServiceStub; +import com.google.shopping.type.CustomAttribute; +import java.io.IOException; +import java.util.ArrayList; +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 CssProductsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static CssProductsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCssProductsServiceStub.getMethodDescriptors(), + CssProductsServiceSettings.getDefaultEndpoint()); + CssProductsServiceSettings settings = + CssProductsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CssProductsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CssProductsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getCssProductTest() throws Exception { + CssProduct expectedResponse = + CssProduct.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .setCssProductStatus(CssProductStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]"); + + CssProduct actualResponse = client.getCssProduct(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 getCssProductExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]"); + client.getCssProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCssProductTest2() throws Exception { + CssProduct expectedResponse = + CssProduct.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .setCssProductStatus(CssProductStatus.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "accounts/account-9295/cssProducts/cssProduct-9295"; + + CssProduct actualResponse = client.getCssProduct(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 getCssProductExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "accounts/account-9295/cssProducts/cssProduct-9295"; + client.getCssProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCssProductsTest() throws Exception { + CssProduct responsesElement = CssProduct.newBuilder().build(); + ListCssProductsResponse expectedResponse = + ListCssProductsResponse.newBuilder() + .setNextPageToken("") + .addAllCssProducts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListCssProductsPagedResponse pagedListResponse = client.listCssProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCssProductsList().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 listCssProductsExceptionTest() 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.listCssProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCssProductsTest2() throws Exception { + CssProduct responsesElement = CssProduct.newBuilder().build(); + ListCssProductsResponse expectedResponse = + ListCssProductsResponse.newBuilder() + .setNextPageToken("") + .addAllCssProducts(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListCssProductsPagedResponse pagedListResponse = client.listCssProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCssProductsList().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 listCssProductsExceptionTest2() 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.listCssProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientTest.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientTest.java new file mode 100644 index 000000000000..f44d2f15c1ed --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/CssProductsServiceClientTest.java @@ -0,0 +1,258 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static com.google.shopping.css.v1.CssProductsServiceClient.ListCssProductsPagedResponse; + +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.shopping.type.CustomAttribute; +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 CssProductsServiceClientTest { + private static MockCssProductsService mockCssProductsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CssProductsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCssProductsService = new MockCssProductsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCssProductsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CssProductsServiceSettings settings = + CssProductsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CssProductsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getCssProductTest() throws Exception { + CssProduct expectedResponse = + CssProduct.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .setCssProductStatus(CssProductStatus.newBuilder().build()) + .build(); + mockCssProductsService.addResponse(expectedResponse); + + CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]"); + + CssProduct actualResponse = client.getCssProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCssProductsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCssProductRequest actualRequest = ((GetCssProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCssProductExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductsService.addException(exception); + + try { + CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]"); + client.getCssProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCssProductTest2() throws Exception { + CssProduct expectedResponse = + CssProduct.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .setRawProvidedId("rawProvidedId-637295450") + .setContentLanguage("contentLanguage810066673") + .setFeedLabel("feedLabel-1661895690") + .setAttributes(Attributes.newBuilder().build()) + .addAllCustomAttributes(new ArrayList()) + .setCssProductStatus(CssProductStatus.newBuilder().build()) + .build(); + mockCssProductsService.addResponse(expectedResponse); + + String name = "name3373707"; + + CssProduct actualResponse = client.getCssProduct(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCssProductsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCssProductRequest actualRequest = ((GetCssProductRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCssProductExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductsService.addException(exception); + + try { + String name = "name3373707"; + client.getCssProduct(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCssProductsTest() throws Exception { + CssProduct responsesElement = CssProduct.newBuilder().build(); + ListCssProductsResponse expectedResponse = + ListCssProductsResponse.newBuilder() + .setNextPageToken("") + .addAllCssProducts(Arrays.asList(responsesElement)) + .build(); + mockCssProductsService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListCssProductsPagedResponse pagedListResponse = client.listCssProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCssProductsList().get(0), resources.get(0)); + + List actualRequests = mockCssProductsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCssProductsRequest actualRequest = ((ListCssProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCssProductsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductsService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listCssProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCssProductsTest2() throws Exception { + CssProduct responsesElement = CssProduct.newBuilder().build(); + ListCssProductsResponse expectedResponse = + ListCssProductsResponse.newBuilder() + .setNextPageToken("") + .addAllCssProducts(Arrays.asList(responsesElement)) + .build(); + mockCssProductsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCssProductsPagedResponse pagedListResponse = client.listCssProducts(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCssProductsList().get(0), resources.get(0)); + + List actualRequests = mockCssProductsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCssProductsRequest actualRequest = ((ListCssProductsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCssProductsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCssProductsService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCssProducts(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsService.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsService.java new file mode 100644 index 000000000000..482acff9012b --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 MockAccountLabelsService implements MockGrpcService { + private final MockAccountLabelsServiceImpl serviceImpl; + + public MockAccountLabelsService() { + serviceImpl = new MockAccountLabelsServiceImpl(); + } + + @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-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsServiceImpl.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsServiceImpl.java new file mode 100644 index 000000000000..b688cce09925 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountLabelsServiceImpl.java @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabelsServiceGrpc.AccountLabelsServiceImplBase; +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 MockAccountLabelsServiceImpl extends AccountLabelsServiceImplBase { + private List requests; + private Queue responses; + + public MockAccountLabelsServiceImpl() { + 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 listAccountLabels( + ListAccountLabelsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAccountLabelsResponse) { + requests.add(request); + responseObserver.onNext(((ListAccountLabelsResponse) 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 ListAccountLabels, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAccountLabelsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAccountLabel( + CreateAccountLabelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AccountLabel) { + requests.add(request); + responseObserver.onNext(((AccountLabel) 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 CreateAccountLabel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AccountLabel.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAccountLabel( + UpdateAccountLabelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AccountLabel) { + requests.add(request); + responseObserver.onNext(((AccountLabel) 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 UpdateAccountLabel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AccountLabel.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAccountLabel( + DeleteAccountLabelRequest 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 DeleteAccountLabel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsService.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsService.java new file mode 100644 index 000000000000..087018c4f2de --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 MockAccountsService implements MockGrpcService { + private final MockAccountsServiceImpl serviceImpl; + + public MockAccountsService() { + serviceImpl = new MockAccountsServiceImpl(); + } + + @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-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsServiceImpl.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsServiceImpl.java new file mode 100644 index 000000000000..1897f7ac8c1c --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockAccountsServiceImpl.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.shopping.css.v1.AccountsServiceGrpc.AccountsServiceImplBase; +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 MockAccountsServiceImpl extends AccountsServiceImplBase { + private List requests; + private Queue responses; + + public MockAccountsServiceImpl() { + 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 listChildAccounts( + ListChildAccountsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListChildAccountsResponse) { + requests.add(request); + responseObserver.onNext(((ListChildAccountsResponse) 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 ListChildAccounts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListChildAccountsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAccount(GetAccountRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Account) { + requests.add(request); + responseObserver.onNext(((Account) 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 GetAccount, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Account.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateLabels( + UpdateAccountLabelsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Account) { + requests.add(request); + responseObserver.onNext(((Account) 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 UpdateLabels, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Account.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsService.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsService.java new file mode 100644 index 000000000000..87d5ef9e58aa --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 MockCssProductInputsService implements MockGrpcService { + private final MockCssProductInputsServiceImpl serviceImpl; + + public MockCssProductInputsService() { + serviceImpl = new MockCssProductInputsServiceImpl(); + } + + @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-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsServiceImpl.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsServiceImpl.java new file mode 100644 index 000000000000..50fb97927fdb --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductInputsServiceImpl.java @@ -0,0 +1,103 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInputsServiceGrpc.CssProductInputsServiceImplBase; +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 MockCssProductInputsServiceImpl extends CssProductInputsServiceImplBase { + private List requests; + private Queue responses; + + public MockCssProductInputsServiceImpl() { + 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 insertCssProductInput( + InsertCssProductInputRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CssProductInput) { + requests.add(request); + responseObserver.onNext(((CssProductInput) 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 InsertCssProductInput, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CssProductInput.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCssProductInput( + DeleteCssProductInputRequest 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 DeleteCssProductInput, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsService.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsService.java new file mode 100644 index 000000000000..98ec4fa7e36d --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 MockCssProductsService implements MockGrpcService { + private final MockCssProductsServiceImpl serviceImpl; + + public MockCssProductsService() { + serviceImpl = new MockCssProductsServiceImpl(); + } + + @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-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsServiceImpl.java b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsServiceImpl.java new file mode 100644 index 000000000000..c62ab6afb123 --- /dev/null +++ b/java-shopping-css/google-shopping-css/src/test/java/com/google/shopping/css/v1/MockCssProductsServiceImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.shopping.css.v1.CssProductsServiceGrpc.CssProductsServiceImplBase; +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 MockCssProductsServiceImpl extends CssProductsServiceImplBase { + private List requests; + private Queue responses; + + public MockCssProductsServiceImpl() { + 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 getCssProduct( + GetCssProductRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CssProduct) { + requests.add(request); + responseObserver.onNext(((CssProduct) 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 GetCssProduct, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CssProduct.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCssProducts( + ListCssProductsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCssProductsResponse) { + requests.add(request); + responseObserver.onNext(((ListCssProductsResponse) 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 ListCssProducts, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCssProductsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-css/grpc-google-shopping-css-v1/pom.xml b/java-shopping-css/grpc-google-shopping-css-v1/pom.xml new file mode 100644 index 000000000000..ca0113850094 --- /dev/null +++ b/java-shopping-css/grpc-google-shopping-css-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-css-v1 + 0.0.1-SNAPSHOT + grpc-google-shopping-css-v1 + GRPC library for google-shopping-css + + com.google.shopping + google-shopping-css-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.shopping.api.grpc + proto-google-shopping-css-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceGrpc.java b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceGrpc.java new file mode 100644 index 000000000000..f5f920182f82 --- /dev/null +++ b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelsServiceGrpc.java @@ -0,0 +1,737 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Manages Merchant Center and CSS accounts labels.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/css/v1/accounts_labels.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AccountLabelsServiceGrpc { + + private AccountLabelsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.shopping.css.v1.AccountLabelsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListAccountLabelsRequest, + com.google.shopping.css.v1.ListAccountLabelsResponse> + getListAccountLabelsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAccountLabels", + requestType = com.google.shopping.css.v1.ListAccountLabelsRequest.class, + responseType = com.google.shopping.css.v1.ListAccountLabelsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListAccountLabelsRequest, + com.google.shopping.css.v1.ListAccountLabelsResponse> + getListAccountLabelsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListAccountLabelsRequest, + com.google.shopping.css.v1.ListAccountLabelsResponse> + getListAccountLabelsMethod; + if ((getListAccountLabelsMethod = AccountLabelsServiceGrpc.getListAccountLabelsMethod) + == null) { + synchronized (AccountLabelsServiceGrpc.class) { + if ((getListAccountLabelsMethod = AccountLabelsServiceGrpc.getListAccountLabelsMethod) + == null) { + AccountLabelsServiceGrpc.getListAccountLabelsMethod = + getListAccountLabelsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAccountLabels")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListAccountLabelsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListAccountLabelsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AccountLabelsServiceMethodDescriptorSupplier("ListAccountLabels")) + .build(); + } + } + } + return getListAccountLabelsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.CreateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getCreateAccountLabelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateAccountLabel", + requestType = com.google.shopping.css.v1.CreateAccountLabelRequest.class, + responseType = com.google.shopping.css.v1.AccountLabel.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.CreateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getCreateAccountLabelMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.CreateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getCreateAccountLabelMethod; + if ((getCreateAccountLabelMethod = AccountLabelsServiceGrpc.getCreateAccountLabelMethod) + == null) { + synchronized (AccountLabelsServiceGrpc.class) { + if ((getCreateAccountLabelMethod = AccountLabelsServiceGrpc.getCreateAccountLabelMethod) + == null) { + AccountLabelsServiceGrpc.getCreateAccountLabelMethod = + getCreateAccountLabelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAccountLabel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.CreateAccountLabelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.AccountLabel.getDefaultInstance())) + .setSchemaDescriptor( + new AccountLabelsServiceMethodDescriptorSupplier("CreateAccountLabel")) + .build(); + } + } + } + return getCreateAccountLabelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getUpdateAccountLabelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateAccountLabel", + requestType = com.google.shopping.css.v1.UpdateAccountLabelRequest.class, + responseType = com.google.shopping.css.v1.AccountLabel.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getUpdateAccountLabelMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel> + getUpdateAccountLabelMethod; + if ((getUpdateAccountLabelMethod = AccountLabelsServiceGrpc.getUpdateAccountLabelMethod) + == null) { + synchronized (AccountLabelsServiceGrpc.class) { + if ((getUpdateAccountLabelMethod = AccountLabelsServiceGrpc.getUpdateAccountLabelMethod) + == null) { + AccountLabelsServiceGrpc.getUpdateAccountLabelMethod = + getUpdateAccountLabelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateAccountLabel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.UpdateAccountLabelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.AccountLabel.getDefaultInstance())) + .setSchemaDescriptor( + new AccountLabelsServiceMethodDescriptorSupplier("UpdateAccountLabel")) + .build(); + } + } + } + return getUpdateAccountLabelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteAccountLabelRequest, com.google.protobuf.Empty> + getDeleteAccountLabelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteAccountLabel", + requestType = com.google.shopping.css.v1.DeleteAccountLabelRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteAccountLabelRequest, com.google.protobuf.Empty> + getDeleteAccountLabelMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteAccountLabelRequest, com.google.protobuf.Empty> + getDeleteAccountLabelMethod; + if ((getDeleteAccountLabelMethod = AccountLabelsServiceGrpc.getDeleteAccountLabelMethod) + == null) { + synchronized (AccountLabelsServiceGrpc.class) { + if ((getDeleteAccountLabelMethod = AccountLabelsServiceGrpc.getDeleteAccountLabelMethod) + == null) { + AccountLabelsServiceGrpc.getDeleteAccountLabelMethod = + getDeleteAccountLabelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAccountLabel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.DeleteAccountLabelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new AccountLabelsServiceMethodDescriptorSupplier("DeleteAccountLabel")) + .build(); + } + } + } + return getDeleteAccountLabelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AccountLabelsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountLabelsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceStub(channel, callOptions); + } + }; + return AccountLabelsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AccountLabelsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountLabelsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceBlockingStub(channel, callOptions); + } + }; + return AccountLabelsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AccountLabelsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountLabelsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceFutureStub(channel, callOptions); + } + }; + return AccountLabelsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Manages Merchant Center and CSS accounts labels.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists the labels assigned to an account.
+     * 
+ */ + default void listAccountLabels( + com.google.shopping.css.v1.ListAccountLabelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAccountLabelsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new label, not assigned to any account.
+     * 
+ */ + default void createAccountLabel( + com.google.shopping.css.v1.CreateAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateAccountLabelMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a label.
+     * 
+ */ + default void updateAccountLabel( + com.google.shopping.css.v1.UpdateAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateAccountLabelMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a label and removes it from all accounts to which it was assigned.
+     * 
+ */ + default void deleteAccountLabel( + com.google.shopping.css.v1.DeleteAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteAccountLabelMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service AccountLabelsService. + * + *
+   * Manages Merchant Center and CSS accounts labels.
+   * 
+ */ + public abstract static class AccountLabelsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return AccountLabelsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service AccountLabelsService. + * + *
+   * Manages Merchant Center and CSS accounts labels.
+   * 
+ */ + public static final class AccountLabelsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AccountLabelsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountLabelsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the labels assigned to an account.
+     * 
+ */ + public void listAccountLabels( + com.google.shopping.css.v1.ListAccountLabelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAccountLabelsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new label, not assigned to any account.
+     * 
+ */ + public void createAccountLabel( + com.google.shopping.css.v1.CreateAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateAccountLabelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a label.
+     * 
+ */ + public void updateAccountLabel( + com.google.shopping.css.v1.UpdateAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateAccountLabelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a label and removes it from all accounts to which it was assigned.
+     * 
+ */ + public void deleteAccountLabel( + com.google.shopping.css.v1.DeleteAccountLabelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteAccountLabelMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service AccountLabelsService. + * + *
+   * Manages Merchant Center and CSS accounts labels.
+   * 
+ */ + public static final class AccountLabelsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AccountLabelsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountLabelsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the labels assigned to an account.
+     * 
+ */ + public com.google.shopping.css.v1.ListAccountLabelsResponse listAccountLabels( + com.google.shopping.css.v1.ListAccountLabelsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAccountLabelsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new label, not assigned to any account.
+     * 
+ */ + public com.google.shopping.css.v1.AccountLabel createAccountLabel( + com.google.shopping.css.v1.CreateAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateAccountLabelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a label.
+     * 
+ */ + public com.google.shopping.css.v1.AccountLabel updateAccountLabel( + com.google.shopping.css.v1.UpdateAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateAccountLabelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a label and removes it from all accounts to which it was assigned.
+     * 
+ */ + public com.google.protobuf.Empty deleteAccountLabel( + com.google.shopping.css.v1.DeleteAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteAccountLabelMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AccountLabelsService. + * + *
+   * Manages Merchant Center and CSS accounts labels.
+   * 
+ */ + public static final class AccountLabelsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AccountLabelsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountLabelsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountLabelsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the labels assigned to an account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.ListAccountLabelsResponse> + listAccountLabels(com.google.shopping.css.v1.ListAccountLabelsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAccountLabelsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new label, not assigned to any account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.AccountLabel> + createAccountLabel(com.google.shopping.css.v1.CreateAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateAccountLabelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a label.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.AccountLabel> + updateAccountLabel(com.google.shopping.css.v1.UpdateAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateAccountLabelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a label and removes it from all accounts to which it was assigned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteAccountLabel(com.google.shopping.css.v1.DeleteAccountLabelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteAccountLabelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_ACCOUNT_LABELS = 0; + private static final int METHODID_CREATE_ACCOUNT_LABEL = 1; + private static final int METHODID_UPDATE_ACCOUNT_LABEL = 2; + private static final int METHODID_DELETE_ACCOUNT_LABEL = 3; + + 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_LIST_ACCOUNT_LABELS: + serviceImpl.listAccountLabels( + (com.google.shopping.css.v1.ListAccountLabelsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_ACCOUNT_LABEL: + serviceImpl.createAccountLabel( + (com.google.shopping.css.v1.CreateAccountLabelRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_ACCOUNT_LABEL: + serviceImpl.updateAccountLabel( + (com.google.shopping.css.v1.UpdateAccountLabelRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_ACCOUNT_LABEL: + serviceImpl.deleteAccountLabel( + (com.google.shopping.css.v1.DeleteAccountLabelRequest) 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( + getListAccountLabelsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.ListAccountLabelsRequest, + com.google.shopping.css.v1.ListAccountLabelsResponse>( + service, METHODID_LIST_ACCOUNT_LABELS))) + .addMethod( + getCreateAccountLabelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.CreateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel>( + service, METHODID_CREATE_ACCOUNT_LABEL))) + .addMethod( + getUpdateAccountLabelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.UpdateAccountLabelRequest, + com.google.shopping.css.v1.AccountLabel>( + service, METHODID_UPDATE_ACCOUNT_LABEL))) + .addMethod( + getDeleteAccountLabelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.DeleteAccountLabelRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_ACCOUNT_LABEL))) + .build(); + } + + private abstract static class AccountLabelsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AccountLabelsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AccountLabelsService"); + } + } + + private static final class AccountLabelsServiceFileDescriptorSupplier + extends AccountLabelsServiceBaseDescriptorSupplier { + AccountLabelsServiceFileDescriptorSupplier() {} + } + + private static final class AccountLabelsServiceMethodDescriptorSupplier + extends AccountLabelsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + AccountLabelsServiceMethodDescriptorSupplier(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 (AccountLabelsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AccountLabelsServiceFileDescriptorSupplier()) + .addMethod(getListAccountLabelsMethod()) + .addMethod(getCreateAccountLabelMethod()) + .addMethod(getUpdateAccountLabelMethod()) + .addMethod(getDeleteAccountLabelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsServiceGrpc.java b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsServiceGrpc.java new file mode 100644 index 000000000000..387b93a1f866 --- /dev/null +++ b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsServiceGrpc.java @@ -0,0 +1,603 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing CSS/MC account information.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/css/v1/accounts.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AccountsServiceGrpc { + + private AccountsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.shopping.css.v1.AccountsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListChildAccountsRequest, + com.google.shopping.css.v1.ListChildAccountsResponse> + getListChildAccountsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListChildAccounts", + requestType = com.google.shopping.css.v1.ListChildAccountsRequest.class, + responseType = com.google.shopping.css.v1.ListChildAccountsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListChildAccountsRequest, + com.google.shopping.css.v1.ListChildAccountsResponse> + getListChildAccountsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListChildAccountsRequest, + com.google.shopping.css.v1.ListChildAccountsResponse> + getListChildAccountsMethod; + if ((getListChildAccountsMethod = AccountsServiceGrpc.getListChildAccountsMethod) == null) { + synchronized (AccountsServiceGrpc.class) { + if ((getListChildAccountsMethod = AccountsServiceGrpc.getListChildAccountsMethod) == null) { + AccountsServiceGrpc.getListChildAccountsMethod = + getListChildAccountsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListChildAccounts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListChildAccountsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListChildAccountsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new AccountsServiceMethodDescriptorSupplier("ListChildAccounts")) + .build(); + } + } + } + return getListChildAccountsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetAccountRequest, com.google.shopping.css.v1.Account> + getGetAccountMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetAccount", + requestType = com.google.shopping.css.v1.GetAccountRequest.class, + responseType = com.google.shopping.css.v1.Account.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetAccountRequest, com.google.shopping.css.v1.Account> + getGetAccountMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetAccountRequest, com.google.shopping.css.v1.Account> + getGetAccountMethod; + if ((getGetAccountMethod = AccountsServiceGrpc.getGetAccountMethod) == null) { + synchronized (AccountsServiceGrpc.class) { + if ((getGetAccountMethod = AccountsServiceGrpc.getGetAccountMethod) == null) { + AccountsServiceGrpc.getGetAccountMethod = + getGetAccountMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAccount")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.GetAccountRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.Account.getDefaultInstance())) + .setSchemaDescriptor( + new AccountsServiceMethodDescriptorSupplier("GetAccount")) + .build(); + } + } + } + return getGetAccountMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelsRequest, com.google.shopping.css.v1.Account> + getUpdateLabelsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateLabels", + requestType = com.google.shopping.css.v1.UpdateAccountLabelsRequest.class, + responseType = com.google.shopping.css.v1.Account.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelsRequest, com.google.shopping.css.v1.Account> + getUpdateLabelsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.UpdateAccountLabelsRequest, + com.google.shopping.css.v1.Account> + getUpdateLabelsMethod; + if ((getUpdateLabelsMethod = AccountsServiceGrpc.getUpdateLabelsMethod) == null) { + synchronized (AccountsServiceGrpc.class) { + if ((getUpdateLabelsMethod = AccountsServiceGrpc.getUpdateLabelsMethod) == null) { + AccountsServiceGrpc.getUpdateLabelsMethod = + getUpdateLabelsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateLabels")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.UpdateAccountLabelsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.Account.getDefaultInstance())) + .setSchemaDescriptor( + new AccountsServiceMethodDescriptorSupplier("UpdateLabels")) + .build(); + } + } + } + return getUpdateLabelsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AccountsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceStub(channel, callOptions); + } + }; + return AccountsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AccountsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceBlockingStub(channel, callOptions); + } + }; + return AccountsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AccountsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AccountsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceFutureStub(channel, callOptions); + } + }; + return AccountsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing CSS/MC account information.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all the accounts under the specified CSS account ID, and
+     * optionally filters by label ID and account name.
+     * 
+ */ + default void listChildAccounts( + com.google.shopping.css.v1.ListChildAccountsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListChildAccountsMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a single CSS/MC account by ID.
+     * 
+ */ + default void getAccount( + com.google.shopping.css.v1.GetAccountRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAccountMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates labels assigned to CSS/MC accounts by a CSS domain.
+     * 
+ */ + default void updateLabels( + com.google.shopping.css.v1.UpdateAccountLabelsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateLabelsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service AccountsService. + * + *
+   * Service for managing CSS/MC account information.
+   * 
+ */ + public abstract static class AccountsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return AccountsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service AccountsService. + * + *
+   * Service for managing CSS/MC account information.
+   * 
+ */ + public static final class AccountsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AccountsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the accounts under the specified CSS account ID, and
+     * optionally filters by label ID and account name.
+     * 
+ */ + public void listChildAccounts( + com.google.shopping.css.v1.ListChildAccountsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListChildAccountsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a single CSS/MC account by ID.
+     * 
+ */ + public void getAccount( + com.google.shopping.css.v1.GetAccountRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetAccountMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates labels assigned to CSS/MC accounts by a CSS domain.
+     * 
+ */ + public void updateLabels( + com.google.shopping.css.v1.UpdateAccountLabelsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateLabelsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service AccountsService. + * + *
+   * Service for managing CSS/MC account information.
+   * 
+ */ + public static final class AccountsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AccountsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the accounts under the specified CSS account ID, and
+     * optionally filters by label ID and account name.
+     * 
+ */ + public com.google.shopping.css.v1.ListChildAccountsResponse listChildAccounts( + com.google.shopping.css.v1.ListChildAccountsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListChildAccountsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a single CSS/MC account by ID.
+     * 
+ */ + public com.google.shopping.css.v1.Account getAccount( + com.google.shopping.css.v1.GetAccountRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAccountMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates labels assigned to CSS/MC accounts by a CSS domain.
+     * 
+ */ + public com.google.shopping.css.v1.Account updateLabels( + com.google.shopping.css.v1.UpdateAccountLabelsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateLabelsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AccountsService. + * + *
+   * Service for managing CSS/MC account information.
+   * 
+ */ + public static final class AccountsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AccountsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AccountsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AccountsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all the accounts under the specified CSS account ID, and
+     * optionally filters by label ID and account name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.ListChildAccountsResponse> + listChildAccounts(com.google.shopping.css.v1.ListChildAccountsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListChildAccountsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a single CSS/MC account by ID.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getAccount(com.google.shopping.css.v1.GetAccountRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetAccountMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates labels assigned to CSS/MC accounts by a CSS domain.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateLabels(com.google.shopping.css.v1.UpdateAccountLabelsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateLabelsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CHILD_ACCOUNTS = 0; + private static final int METHODID_GET_ACCOUNT = 1; + private static final int METHODID_UPDATE_LABELS = 2; + + 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_LIST_CHILD_ACCOUNTS: + serviceImpl.listChildAccounts( + (com.google.shopping.css.v1.ListChildAccountsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_ACCOUNT: + serviceImpl.getAccount( + (com.google.shopping.css.v1.GetAccountRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_LABELS: + serviceImpl.updateLabels( + (com.google.shopping.css.v1.UpdateAccountLabelsRequest) 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( + getListChildAccountsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.ListChildAccountsRequest, + com.google.shopping.css.v1.ListChildAccountsResponse>( + service, METHODID_LIST_CHILD_ACCOUNTS))) + .addMethod( + getGetAccountMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.GetAccountRequest, + com.google.shopping.css.v1.Account>(service, METHODID_GET_ACCOUNT))) + .addMethod( + getUpdateLabelsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.UpdateAccountLabelsRequest, + com.google.shopping.css.v1.Account>(service, METHODID_UPDATE_LABELS))) + .build(); + } + + private abstract static class AccountsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AccountsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.css.v1.AccountsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AccountsService"); + } + } + + private static final class AccountsServiceFileDescriptorSupplier + extends AccountsServiceBaseDescriptorSupplier { + AccountsServiceFileDescriptorSupplier() {} + } + + private static final class AccountsServiceMethodDescriptorSupplier + extends AccountsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + AccountsServiceMethodDescriptorSupplier(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 (AccountsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AccountsServiceFileDescriptorSupplier()) + .addMethod(getListChildAccountsMethod()) + .addMethod(getGetAccountMethod()) + .addMethod(getUpdateLabelsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceGrpc.java b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceGrpc.java new file mode 100644 index 000000000000..6bcfb5f89cc2 --- /dev/null +++ b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsServiceGrpc.java @@ -0,0 +1,534 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to use CssProductInput resource.
+ * This service helps to insert/update/delete CSS Products.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/css/v1/css_product_inputs.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CssProductInputsServiceGrpc { + + private CssProductInputsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.css.v1.CssProductInputsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.InsertCssProductInputRequest, + com.google.shopping.css.v1.CssProductInput> + getInsertCssProductInputMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InsertCssProductInput", + requestType = com.google.shopping.css.v1.InsertCssProductInputRequest.class, + responseType = com.google.shopping.css.v1.CssProductInput.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.InsertCssProductInputRequest, + com.google.shopping.css.v1.CssProductInput> + getInsertCssProductInputMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.InsertCssProductInputRequest, + com.google.shopping.css.v1.CssProductInput> + getInsertCssProductInputMethod; + if ((getInsertCssProductInputMethod = + CssProductInputsServiceGrpc.getInsertCssProductInputMethod) + == null) { + synchronized (CssProductInputsServiceGrpc.class) { + if ((getInsertCssProductInputMethod = + CssProductInputsServiceGrpc.getInsertCssProductInputMethod) + == null) { + CssProductInputsServiceGrpc.getInsertCssProductInputMethod = + getInsertCssProductInputMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "InsertCssProductInput")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.InsertCssProductInputRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.CssProductInput.getDefaultInstance())) + .setSchemaDescriptor( + new CssProductInputsServiceMethodDescriptorSupplier( + "InsertCssProductInput")) + .build(); + } + } + } + return getInsertCssProductInputMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteCssProductInputRequest, com.google.protobuf.Empty> + getDeleteCssProductInputMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCssProductInput", + requestType = com.google.shopping.css.v1.DeleteCssProductInputRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteCssProductInputRequest, com.google.protobuf.Empty> + getDeleteCssProductInputMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.DeleteCssProductInputRequest, com.google.protobuf.Empty> + getDeleteCssProductInputMethod; + if ((getDeleteCssProductInputMethod = + CssProductInputsServiceGrpc.getDeleteCssProductInputMethod) + == null) { + synchronized (CssProductInputsServiceGrpc.class) { + if ((getDeleteCssProductInputMethod = + CssProductInputsServiceGrpc.getDeleteCssProductInputMethod) + == null) { + CssProductInputsServiceGrpc.getDeleteCssProductInputMethod = + getDeleteCssProductInputMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteCssProductInput")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.DeleteCssProductInputRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new CssProductInputsServiceMethodDescriptorSupplier( + "DeleteCssProductInput")) + .build(); + } + } + } + return getDeleteCssProductInputMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CssProductInputsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductInputsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceStub(channel, callOptions); + } + }; + return CssProductInputsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CssProductInputsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductInputsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceBlockingStub(channel, callOptions); + } + }; + return CssProductInputsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CssProductInputsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductInputsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceFutureStub(channel, callOptions); + } + }; + return CssProductInputsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to use CssProductInput resource.
+   * This service helps to insert/update/delete CSS Products.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Uploads a CssProductInput to your CSS Center account. If an
+     * input with the same contentLanguage, identity, feedLabel and feedId already
+     * exists, this method replaces that entry.
+     * After inserting, updating, or deleting a CSS Product input, it may
+     * take several minutes before the processed CSS Product can be retrieved.
+     * 
+ */ + default void insertCssProductInput( + com.google.shopping.css.v1.InsertCssProductInputRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInsertCssProductInputMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a CSS Product input from your CSS Center account.
+     * After a delete it may take several minutes until the input is no longer
+     * available.
+     * 
+ */ + default void deleteCssProductInput( + com.google.shopping.css.v1.DeleteCssProductInputRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteCssProductInputMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CssProductInputsService. + * + *
+   * Service to use CssProductInput resource.
+   * This service helps to insert/update/delete CSS Products.
+   * 
+ */ + public abstract static class CssProductInputsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CssProductInputsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CssProductInputsService. + * + *
+   * Service to use CssProductInput resource.
+   * This service helps to insert/update/delete CSS Products.
+   * 
+ */ + public static final class CssProductInputsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CssProductInputsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductInputsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Uploads a CssProductInput to your CSS Center account. If an
+     * input with the same contentLanguage, identity, feedLabel and feedId already
+     * exists, this method replaces that entry.
+     * After inserting, updating, or deleting a CSS Product input, it may
+     * take several minutes before the processed CSS Product can be retrieved.
+     * 
+ */ + public void insertCssProductInput( + com.google.shopping.css.v1.InsertCssProductInputRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertCssProductInputMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a CSS Product input from your CSS Center account.
+     * After a delete it may take several minutes until the input is no longer
+     * available.
+     * 
+ */ + public void deleteCssProductInput( + com.google.shopping.css.v1.DeleteCssProductInputRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteCssProductInputMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CssProductInputsService. + * + *
+   * Service to use CssProductInput resource.
+   * This service helps to insert/update/delete CSS Products.
+   * 
+ */ + public static final class CssProductInputsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CssProductInputsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductInputsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Uploads a CssProductInput to your CSS Center account. If an
+     * input with the same contentLanguage, identity, feedLabel and feedId already
+     * exists, this method replaces that entry.
+     * After inserting, updating, or deleting a CSS Product input, it may
+     * take several minutes before the processed CSS Product can be retrieved.
+     * 
+ */ + public com.google.shopping.css.v1.CssProductInput insertCssProductInput( + com.google.shopping.css.v1.InsertCssProductInputRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertCssProductInputMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a CSS Product input from your CSS Center account.
+     * After a delete it may take several minutes until the input is no longer
+     * available.
+     * 
+ */ + public com.google.protobuf.Empty deleteCssProductInput( + com.google.shopping.css.v1.DeleteCssProductInputRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteCssProductInputMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * CssProductInputsService. + * + *
+   * Service to use CssProductInput resource.
+   * This service helps to insert/update/delete CSS Products.
+   * 
+ */ + public static final class CssProductInputsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CssProductInputsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductInputsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductInputsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Uploads a CssProductInput to your CSS Center account. If an
+     * input with the same contentLanguage, identity, feedLabel and feedId already
+     * exists, this method replaces that entry.
+     * After inserting, updating, or deleting a CSS Product input, it may
+     * take several minutes before the processed CSS Product can be retrieved.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.CssProductInput> + insertCssProductInput(com.google.shopping.css.v1.InsertCssProductInputRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertCssProductInputMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a CSS Product input from your CSS Center account.
+     * After a delete it may take several minutes until the input is no longer
+     * available.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCssProductInput(com.google.shopping.css.v1.DeleteCssProductInputRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteCssProductInputMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_INSERT_CSS_PRODUCT_INPUT = 0; + private static final int METHODID_DELETE_CSS_PRODUCT_INPUT = 1; + + 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_INSERT_CSS_PRODUCT_INPUT: + serviceImpl.insertCssProductInput( + (com.google.shopping.css.v1.InsertCssProductInputRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_CSS_PRODUCT_INPUT: + serviceImpl.deleteCssProductInput( + (com.google.shopping.css.v1.DeleteCssProductInputRequest) 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( + getInsertCssProductInputMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.InsertCssProductInputRequest, + com.google.shopping.css.v1.CssProductInput>( + service, METHODID_INSERT_CSS_PRODUCT_INPUT))) + .addMethod( + getDeleteCssProductInputMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.DeleteCssProductInputRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_CSS_PRODUCT_INPUT))) + .build(); + } + + private abstract static class CssProductInputsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CssProductInputsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CssProductInputsService"); + } + } + + private static final class CssProductInputsServiceFileDescriptorSupplier + extends CssProductInputsServiceBaseDescriptorSupplier { + CssProductInputsServiceFileDescriptorSupplier() {} + } + + private static final class CssProductInputsServiceMethodDescriptorSupplier + extends CssProductInputsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CssProductInputsServiceMethodDescriptorSupplier(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 (CssProductInputsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CssProductInputsServiceFileDescriptorSupplier()) + .addMethod(getInsertCssProductInputMethod()) + .addMethod(getDeleteCssProductInputMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsServiceGrpc.java b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsServiceGrpc.java new file mode 100644 index 000000000000..ed6d4422c007 --- /dev/null +++ b/java-shopping-css/grpc-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsServiceGrpc.java @@ -0,0 +1,526 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+ * internally).
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/css/v1/css_products.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CssProductsServiceGrpc { + + private CssProductsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.shopping.css.v1.CssProductsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetCssProductRequest, com.google.shopping.css.v1.CssProduct> + getGetCssProductMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCssProduct", + requestType = com.google.shopping.css.v1.GetCssProductRequest.class, + responseType = com.google.shopping.css.v1.CssProduct.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetCssProductRequest, com.google.shopping.css.v1.CssProduct> + getGetCssProductMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.GetCssProductRequest, com.google.shopping.css.v1.CssProduct> + getGetCssProductMethod; + if ((getGetCssProductMethod = CssProductsServiceGrpc.getGetCssProductMethod) == null) { + synchronized (CssProductsServiceGrpc.class) { + if ((getGetCssProductMethod = CssProductsServiceGrpc.getGetCssProductMethod) == null) { + CssProductsServiceGrpc.getGetCssProductMethod = + getGetCssProductMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCssProduct")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.GetCssProductRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.CssProduct.getDefaultInstance())) + .setSchemaDescriptor( + new CssProductsServiceMethodDescriptorSupplier("GetCssProduct")) + .build(); + } + } + } + return getGetCssProductMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListCssProductsRequest, + com.google.shopping.css.v1.ListCssProductsResponse> + getListCssProductsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCssProducts", + requestType = com.google.shopping.css.v1.ListCssProductsRequest.class, + responseType = com.google.shopping.css.v1.ListCssProductsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListCssProductsRequest, + com.google.shopping.css.v1.ListCssProductsResponse> + getListCssProductsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.css.v1.ListCssProductsRequest, + com.google.shopping.css.v1.ListCssProductsResponse> + getListCssProductsMethod; + if ((getListCssProductsMethod = CssProductsServiceGrpc.getListCssProductsMethod) == null) { + synchronized (CssProductsServiceGrpc.class) { + if ((getListCssProductsMethod = CssProductsServiceGrpc.getListCssProductsMethod) == null) { + CssProductsServiceGrpc.getListCssProductsMethod = + getListCssProductsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCssProducts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListCssProductsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.css.v1.ListCssProductsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CssProductsServiceMethodDescriptorSupplier("ListCssProducts")) + .build(); + } + } + } + return getListCssProductsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CssProductsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceStub(channel, callOptions); + } + }; + return CssProductsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CssProductsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceBlockingStub(channel, callOptions); + } + }; + return CssProductsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CssProductsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CssProductsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceFutureStub(channel, callOptions); + } + }; + return CssProductsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+   * internally).
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Retrieves the processed CSS Product from your CSS Center account. After
+     * inserting, updating, or deleting a product input, it may take several
+     * minutes before the updated final product can be retrieved.
+     * 
+ */ + default void getCssProduct( + com.google.shopping.css.v1.GetCssProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCssProductMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the processed CSS Products in your CSS Center account. The response
+     * might contain fewer items than specified by pageSize. Rely on pageToken to
+     * determine if there are more items to be requested.
+     * After inserting, updating, or deleting a CSS product input, it may
+     * take several minutes before the updated processed CSS product can be
+     * retrieved.
+     * 
+ */ + default void listCssProducts( + com.google.shopping.css.v1.ListCssProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCssProductsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CssProductsService. + * + *
+   * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+   * internally).
+   * 
+ */ + public abstract static class CssProductsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CssProductsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CssProductsService. + * + *
+   * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+   * internally).
+   * 
+ */ + public static final class CssProductsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CssProductsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the processed CSS Product from your CSS Center account. After
+     * inserting, updating, or deleting a product input, it may take several
+     * minutes before the updated final product can be retrieved.
+     * 
+ */ + public void getCssProduct( + com.google.shopping.css.v1.GetCssProductRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCssProductMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the processed CSS Products in your CSS Center account. The response
+     * might contain fewer items than specified by pageSize. Rely on pageToken to
+     * determine if there are more items to be requested.
+     * After inserting, updating, or deleting a CSS product input, it may
+     * take several minutes before the updated processed CSS product can be
+     * retrieved.
+     * 
+ */ + public void listCssProducts( + com.google.shopping.css.v1.ListCssProductsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCssProductsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CssProductsService. + * + *
+   * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+   * internally).
+   * 
+ */ + public static final class CssProductsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CssProductsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the processed CSS Product from your CSS Center account. After
+     * inserting, updating, or deleting a product input, it may take several
+     * minutes before the updated final product can be retrieved.
+     * 
+ */ + public com.google.shopping.css.v1.CssProduct getCssProduct( + com.google.shopping.css.v1.GetCssProductRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCssProductMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the processed CSS Products in your CSS Center account. The response
+     * might contain fewer items than specified by pageSize. Rely on pageToken to
+     * determine if there are more items to be requested.
+     * After inserting, updating, or deleting a CSS product input, it may
+     * take several minutes before the updated processed CSS product can be
+     * retrieved.
+     * 
+ */ + public com.google.shopping.css.v1.ListCssProductsResponse listCssProducts( + com.google.shopping.css.v1.ListCssProductsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCssProductsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CssProductsService. + * + *
+   * Service for doing get and list on Css Products(a.k.a Aggregate Offers
+   * internally).
+   * 
+ */ + public static final class CssProductsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CssProductsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CssProductsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CssProductsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Retrieves the processed CSS Product from your CSS Center account. After
+     * inserting, updating, or deleting a product input, it may take several
+     * minutes before the updated final product can be retrieved.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getCssProduct(com.google.shopping.css.v1.GetCssProductRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCssProductMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the processed CSS Products in your CSS Center account. The response
+     * might contain fewer items than specified by pageSize. Rely on pageToken to
+     * determine if there are more items to be requested.
+     * After inserting, updating, or deleting a CSS product input, it may
+     * take several minutes before the updated processed CSS product can be
+     * retrieved.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.css.v1.ListCssProductsResponse> + listCssProducts(com.google.shopping.css.v1.ListCssProductsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCssProductsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_CSS_PRODUCT = 0; + private static final int METHODID_LIST_CSS_PRODUCTS = 1; + + 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_CSS_PRODUCT: + serviceImpl.getCssProduct( + (com.google.shopping.css.v1.GetCssProductRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CSS_PRODUCTS: + serviceImpl.listCssProducts( + (com.google.shopping.css.v1.ListCssProductsRequest) 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( + getGetCssProductMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.GetCssProductRequest, + com.google.shopping.css.v1.CssProduct>(service, METHODID_GET_CSS_PRODUCT))) + .addMethod( + getListCssProductsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.css.v1.ListCssProductsRequest, + com.google.shopping.css.v1.ListCssProductsResponse>( + service, METHODID_LIST_CSS_PRODUCTS))) + .build(); + } + + private abstract static class CssProductsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CssProductsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.css.v1.CssProductsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CssProductsService"); + } + } + + private static final class CssProductsServiceFileDescriptorSupplier + extends CssProductsServiceBaseDescriptorSupplier { + CssProductsServiceFileDescriptorSupplier() {} + } + + private static final class CssProductsServiceMethodDescriptorSupplier + extends CssProductsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CssProductsServiceMethodDescriptorSupplier(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 (CssProductsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CssProductsServiceFileDescriptorSupplier()) + .addMethod(getGetCssProductMethod()) + .addMethod(getListCssProductsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-css/owlbot.py b/java-shopping-css/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-shopping-css/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-shopping-css/pom.xml b/java-shopping-css/pom.xml new file mode 100644 index 000000000000..1c9d6cce9a3e --- /dev/null +++ b/java-shopping-css/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.shopping + google-shopping-css-parent + pom + 0.0.1-SNAPSHOT + Google CSS API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.27.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-shopping-css-parent + + + + + + com.google.shopping + google-shopping-css + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-css-v1 + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-css-v1 + 0.0.1-SNAPSHOT + + + + + + google-shopping-css + grpc-google-shopping-css-v1 + proto-google-shopping-css-v1 + google-shopping-css-bom + + + diff --git a/java-shopping-css/proto-google-shopping-css-v1/clirr-ignored-differences.xml b/java-shopping-css/proto-google-shopping-css-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..5af38d5f2710 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/clirr-ignored-differences.xml @@ -0,0 +1,47 @@ + + + + + 7012 + com/google/api/*OrBuilder + * get*(*) + + + 7012 + com/google/api/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/api/*OrBuilder + boolean has*(*) + + 7012 + com/google/shopping/css/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/css/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/css/v1/*OrBuilder + boolean has*(*) + + 7012 + com/google/shopping/type/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/type/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/type/*OrBuilder + boolean has*(*) + + diff --git a/java-shopping-css/proto-google-shopping-css-v1/pom.xml b/java-shopping-css/proto-google-shopping-css-v1/pom.xml new file mode 100644 index 000000000000..146ded721360 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-css-v1 + 0.0.1-SNAPSHOT + proto-google-shopping-css-v1 + Proto library for google-shopping-css + + com.google.shopping + google-shopping-css-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Account.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Account.java new file mode 100644 index 000000000000..86d5d5db2572 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Account.java @@ -0,0 +1,2470 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Information about CSS/MC account.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.Account} + */ +public final class Account extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.Account) + AccountOrBuilder { + private static final long serialVersionUID = 0L; + // Use Account.newBuilder() to construct. + private Account(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Account() { + name_ = ""; + fullName_ = ""; + displayName_ = ""; + homepageUri_ = ""; + parent_ = ""; + labelIds_ = emptyLongList(); + automaticLabelIds_ = emptyLongList(); + accountType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Account(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_Account_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_Account_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Account.class, + com.google.shopping.css.v1.Account.Builder.class); + } + + /** + * + * + *
+   * The account type.
+   * 
+ * + * Protobuf enum {@code google.shopping.css.v1.Account.AccountType} + */ + public enum AccountType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown account type.
+     * 
+ * + * ACCOUNT_TYPE_UNSPECIFIED = 0; + */ + ACCOUNT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * CSS group account.
+     * 
+ * + * CSS_GROUP = 1; + */ + CSS_GROUP(1), + /** + * + * + *
+     * CSS domain account.
+     * 
+ * + * CSS_DOMAIN = 2; + */ + CSS_DOMAIN(2), + /** + * + * + *
+     * MC Primary CSS MCA account.
+     * 
+ * + * MC_PRIMARY_CSS_MCA = 3; + */ + MC_PRIMARY_CSS_MCA(3), + /** + * + * + *
+     * MC CSS MCA account.
+     * 
+ * + * MC_CSS_MCA = 4; + */ + MC_CSS_MCA(4), + /** + * + * + *
+     * MC Marketplace MCA account.
+     * 
+ * + * MC_MARKETPLACE_MCA = 5; + */ + MC_MARKETPLACE_MCA(5), + /** + * + * + *
+     * MC Other MCA account.
+     * 
+ * + * MC_OTHER_MCA = 6; + */ + MC_OTHER_MCA(6), + /** + * + * + *
+     * MC Standalone account.
+     * 
+ * + * MC_STANDALONE = 7; + */ + MC_STANDALONE(7), + /** + * + * + *
+     * MC MCA sub-account.
+     * 
+ * + * MC_MCA_SUBACCOUNT = 8; + */ + MC_MCA_SUBACCOUNT(8), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown account type.
+     * 
+ * + * ACCOUNT_TYPE_UNSPECIFIED = 0; + */ + public static final int ACCOUNT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * CSS group account.
+     * 
+ * + * CSS_GROUP = 1; + */ + public static final int CSS_GROUP_VALUE = 1; + /** + * + * + *
+     * CSS domain account.
+     * 
+ * + * CSS_DOMAIN = 2; + */ + public static final int CSS_DOMAIN_VALUE = 2; + /** + * + * + *
+     * MC Primary CSS MCA account.
+     * 
+ * + * MC_PRIMARY_CSS_MCA = 3; + */ + public static final int MC_PRIMARY_CSS_MCA_VALUE = 3; + /** + * + * + *
+     * MC CSS MCA account.
+     * 
+ * + * MC_CSS_MCA = 4; + */ + public static final int MC_CSS_MCA_VALUE = 4; + /** + * + * + *
+     * MC Marketplace MCA account.
+     * 
+ * + * MC_MARKETPLACE_MCA = 5; + */ + public static final int MC_MARKETPLACE_MCA_VALUE = 5; + /** + * + * + *
+     * MC Other MCA account.
+     * 
+ * + * MC_OTHER_MCA = 6; + */ + public static final int MC_OTHER_MCA_VALUE = 6; + /** + * + * + *
+     * MC Standalone account.
+     * 
+ * + * MC_STANDALONE = 7; + */ + public static final int MC_STANDALONE_VALUE = 7; + /** + * + * + *
+     * MC MCA sub-account.
+     * 
+ * + * MC_MCA_SUBACCOUNT = 8; + */ + public static final int MC_MCA_SUBACCOUNT_VALUE = 8; + + 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 AccountType 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 AccountType forNumber(int value) { + switch (value) { + case 0: + return ACCOUNT_TYPE_UNSPECIFIED; + case 1: + return CSS_GROUP; + case 2: + return CSS_DOMAIN; + case 3: + return MC_PRIMARY_CSS_MCA; + case 4: + return MC_CSS_MCA; + case 5: + return MC_MARKETPLACE_MCA; + case 6: + return MC_OTHER_MCA; + case 7: + return MC_STANDALONE; + case 8: + return MC_MCA_SUBACCOUNT; + 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 AccountType findValueByNumber(int number) { + return AccountType.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.css.v1.Account.getDescriptor().getEnumTypes().get(0); + } + + private static final AccountType[] VALUES = values(); + + public static AccountType 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 AccountType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.css.v1.Account.AccountType) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * string name = 1; + * + * @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 FULL_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object fullName_ = ""; + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's full name.
+   * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fullName. + */ + @java.lang.Override + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + 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(); + fullName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's full name.
+   * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for fullName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @return Whether the displayName field is set. + */ + @java.lang.Override + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @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 HOMEPAGE_URI_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object homepageUri_ = ""; + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the homepageUri field is set. + */ + @java.lang.Override + public boolean hasHomepageUri() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The homepageUri. + */ + @java.lang.Override + public java.lang.String getHomepageUri() { + java.lang.Object ref = homepageUri_; + 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(); + homepageUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for homepageUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHomepageUriBytes() { + java.lang.Object ref = homepageUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + homepageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @return Whether the parent field is set. + */ + @java.lang.Override + public boolean hasParent() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @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; + } + } + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @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 LABEL_IDS_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList labelIds_; + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @return A list containing the labelIds. + */ + @java.lang.Override + public java.util.List getLabelIdsList() { + return labelIds_; + } + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @return The count of labelIds. + */ + public int getLabelIdsCount() { + return labelIds_.size(); + } + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + public long getLabelIds(int index) { + return labelIds_.getLong(index); + } + + private int labelIdsMemoizedSerializedSize = -1; + + public static final int AUTOMATIC_LABEL_IDS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList automaticLabelIds_; + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return A list containing the automaticLabelIds. + */ + @java.lang.Override + public java.util.List getAutomaticLabelIdsList() { + return automaticLabelIds_; + } + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return The count of automaticLabelIds. + */ + public int getAutomaticLabelIdsCount() { + return automaticLabelIds_.size(); + } + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param index The index of the element to return. + * @return The automaticLabelIds at the given index. + */ + public long getAutomaticLabelIds(int index) { + return automaticLabelIds_.getLong(index); + } + + private int automaticLabelIdsMemoizedSerializedSize = -1; + + public static final int ACCOUNT_TYPE_FIELD_NUMBER = 8; + private int accountType_ = 0; + /** + * + * + *
+   * Output only. The type of this account.
+   * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for accountType. + */ + @java.lang.Override + public int getAccountTypeValue() { + return accountType_; + } + /** + * + * + *
+   * Output only. The type of this account.
+   * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The accountType. + */ + @java.lang.Override + public com.google.shopping.css.v1.Account.AccountType getAccountType() { + com.google.shopping.css.v1.Account.AccountType result = + com.google.shopping.css.v1.Account.AccountType.forNumber(accountType_); + return result == null ? com.google.shopping.css.v1.Account.AccountType.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fullName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, homepageUri_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); + } + if (getLabelIdsList().size() > 0) { + output.writeUInt32NoTag(50); + output.writeUInt32NoTag(labelIdsMemoizedSerializedSize); + } + for (int i = 0; i < labelIds_.size(); i++) { + output.writeInt64NoTag(labelIds_.getLong(i)); + } + if (getAutomaticLabelIdsList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(automaticLabelIdsMemoizedSerializedSize); + } + for (int i = 0; i < automaticLabelIds_.size(); i++) { + output.writeInt64NoTag(automaticLabelIds_.getLong(i)); + } + if (accountType_ + != com.google.shopping.css.v1.Account.AccountType.ACCOUNT_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, accountType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fullName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fullName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, homepageUri_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); + } + { + int dataSize = 0; + for (int i = 0; i < labelIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(labelIds_.getLong(i)); + } + size += dataSize; + if (!getLabelIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + labelIdsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < automaticLabelIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag( + automaticLabelIds_.getLong(i)); + } + size += dataSize; + if (!getAutomaticLabelIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + automaticLabelIdsMemoizedSerializedSize = dataSize; + } + if (accountType_ + != com.google.shopping.css.v1.Account.AccountType.ACCOUNT_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, accountType_); + } + 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.css.v1.Account)) { + return super.equals(obj); + } + com.google.shopping.css.v1.Account other = (com.google.shopping.css.v1.Account) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFullName().equals(other.getFullName())) return false; + if (hasDisplayName() != other.hasDisplayName()) return false; + if (hasDisplayName()) { + if (!getDisplayName().equals(other.getDisplayName())) return false; + } + if (hasHomepageUri() != other.hasHomepageUri()) return false; + if (hasHomepageUri()) { + if (!getHomepageUri().equals(other.getHomepageUri())) return false; + } + if (hasParent() != other.hasParent()) return false; + if (hasParent()) { + if (!getParent().equals(other.getParent())) return false; + } + if (!getLabelIdsList().equals(other.getLabelIdsList())) return false; + if (!getAutomaticLabelIdsList().equals(other.getAutomaticLabelIdsList())) return false; + if (accountType_ != other.accountType_) 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) + FULL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFullName().hashCode(); + if (hasDisplayName()) { + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + } + if (hasHomepageUri()) { + hash = (37 * hash) + HOMEPAGE_URI_FIELD_NUMBER; + hash = (53 * hash) + getHomepageUri().hashCode(); + } + if (hasParent()) { + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + } + if (getLabelIdsCount() > 0) { + hash = (37 * hash) + LABEL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLabelIdsList().hashCode(); + } + if (getAutomaticLabelIdsCount() > 0) { + hash = (37 * hash) + AUTOMATIC_LABEL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getAutomaticLabelIdsList().hashCode(); + } + hash = (37 * hash) + ACCOUNT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + accountType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.Account parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Account 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.css.v1.Account parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Account 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.css.v1.Account parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Account parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.Account parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Account 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.css.v1.Account parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Account 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.css.v1.Account parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Account 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.css.v1.Account 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; + } + /** + * + * + *
+   * Information about CSS/MC account.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.Account} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.Account) + com.google.shopping.css.v1.AccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_Account_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_Account_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Account.class, + com.google.shopping.css.v1.Account.Builder.class); + } + + // Construct using com.google.shopping.css.v1.Account.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + fullName_ = ""; + displayName_ = ""; + homepageUri_ = ""; + parent_ = ""; + labelIds_ = emptyLongList(); + automaticLabelIds_ = emptyLongList(); + accountType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_Account_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.Account getDefaultInstanceForType() { + return com.google.shopping.css.v1.Account.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.Account build() { + com.google.shopping.css.v1.Account result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.Account buildPartial() { + com.google.shopping.css.v1.Account result = new com.google.shopping.css.v1.Account(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.css.v1.Account result) { + if (((bitField0_ & 0x00000020) != 0)) { + labelIds_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.labelIds_ = labelIds_; + if (((bitField0_ & 0x00000040) != 0)) { + automaticLabelIds_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.automaticLabelIds_ = automaticLabelIds_; + } + + private void buildPartial0(com.google.shopping.css.v1.Account result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.fullName_ = fullName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.displayName_ = displayName_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.homepageUri_ = homepageUri_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.parent_ = parent_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.accountType_ = accountType_; + } + 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.css.v1.Account) { + return mergeFrom((com.google.shopping.css.v1.Account) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.Account other) { + if (other == com.google.shopping.css.v1.Account.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFullName().isEmpty()) { + fullName_ = other.fullName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasDisplayName()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasHomepageUri()) { + homepageUri_ = other.homepageUri_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasParent()) { + parent_ = other.parent_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.labelIds_.isEmpty()) { + if (labelIds_.isEmpty()) { + labelIds_ = other.labelIds_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureLabelIdsIsMutable(); + labelIds_.addAll(other.labelIds_); + } + onChanged(); + } + if (!other.automaticLabelIds_.isEmpty()) { + if (automaticLabelIds_.isEmpty()) { + automaticLabelIds_ = other.automaticLabelIds_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureAutomaticLabelIdsIsMutable(); + automaticLabelIds_.addAll(other.automaticLabelIds_); + } + onChanged(); + } + if (other.accountType_ != 0) { + setAccountTypeValue(other.getAccountTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + fullName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + homepageUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + long v = input.readInt64(); + ensureLabelIdsIsMutable(); + labelIds_.addLong(v); + break; + } // case 48 + case 50: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureLabelIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + labelIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 50 + case 56: + { + long v = input.readInt64(); + ensureAutomaticLabelIdsIsMutable(); + automaticLabelIds_.addLong(v); + break; + } // case 56 + case 58: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureAutomaticLabelIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + automaticLabelIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 58 + case 64: + { + accountType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + 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_ = ""; + /** + * + * + *
+     * The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object fullName_ = ""; + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's full name.
+     * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fullName. + */ + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's full name.
+     * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for fullName. + */ + public com.google.protobuf.ByteString getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's full name.
+     * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The fullName to set. + * @return This builder for chaining. + */ + public Builder setFullName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fullName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's full name.
+     * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearFullName() { + fullName_ = getDefaultInstance().getFullName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's full name.
+     * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for fullName to set. + * @return This builder for chaining. + */ + public Builder setFullNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fullName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @return Whether the displayName field is set. + */ + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The CSS/MC account's short display name.
+     * 
+ * + * optional string display_name = 3; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object homepageUri_ = ""; + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the homepageUri field is set. + */ + public boolean hasHomepageUri() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The homepageUri. + */ + public java.lang.String getHomepageUri() { + java.lang.Object ref = homepageUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + homepageUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for homepageUri. + */ + public com.google.protobuf.ByteString getHomepageUriBytes() { + java.lang.Object ref = homepageUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + homepageUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The homepageUri to set. + * @return This builder for chaining. + */ + public Builder setHomepageUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + homepageUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearHomepageUri() { + homepageUri_ = getDefaultInstance().getHomepageUri(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The CSS/MC account's homepage.
+     * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for homepageUri to set. + * @return This builder for chaining. + */ + public Builder setHomepageUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + homepageUri_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @return Whether the parent field is set. + */ + public boolean hasParent() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @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; + } + } + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @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; + } + } + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+     * domain for MC accounts. Returned only if the user has access to the
+     * parent account.
+     * 
+ * + * optional string parent = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList labelIds_ = emptyLongList(); + + private void ensureLabelIdsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + labelIds_ = mutableCopy(labelIds_); + bitField0_ |= 0x00000020; + } + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @return A list containing the labelIds. + */ + public java.util.List getLabelIdsList() { + return ((bitField0_ & 0x00000020) != 0) + ? java.util.Collections.unmodifiableList(labelIds_) + : labelIds_; + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @return The count of labelIds. + */ + public int getLabelIdsCount() { + return labelIds_.size(); + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + public long getLabelIds(int index) { + return labelIds_.getLong(index); + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @param index The index to set the value at. + * @param value The labelIds to set. + * @return This builder for chaining. + */ + public Builder setLabelIds(int index, long value) { + + ensureLabelIdsIsMutable(); + labelIds_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @param value The labelIds to add. + * @return This builder for chaining. + */ + public Builder addLabelIds(long value) { + + ensureLabelIdsIsMutable(); + labelIds_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @param values The labelIds to add. + * @return This builder for chaining. + */ + public Builder addAllLabelIds(java.lang.Iterable values) { + ensureLabelIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labelIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+     * account.
+     * 
+ * + * repeated int64 label_ids = 6; + * + * @return This builder for chaining. + */ + public Builder clearLabelIds() { + labelIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList automaticLabelIds_ = emptyLongList(); + + private void ensureAutomaticLabelIdsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + automaticLabelIds_ = mutableCopy(automaticLabelIds_); + bitField0_ |= 0x00000040; + } + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return A list containing the automaticLabelIds. + */ + public java.util.List getAutomaticLabelIdsList() { + return ((bitField0_ & 0x00000040) != 0) + ? java.util.Collections.unmodifiableList(automaticLabelIds_) + : automaticLabelIds_; + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return The count of automaticLabelIds. + */ + public int getAutomaticLabelIdsCount() { + return automaticLabelIds_.size(); + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param index The index of the element to return. + * @return The automaticLabelIds at the given index. + */ + public long getAutomaticLabelIds(int index) { + return automaticLabelIds_.getLong(index); + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param index The index to set the value at. + * @param value The automaticLabelIds to set. + * @return This builder for chaining. + */ + public Builder setAutomaticLabelIds(int index, long value) { + + ensureAutomaticLabelIdsIsMutable(); + automaticLabelIds_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param value The automaticLabelIds to add. + * @return This builder for chaining. + */ + public Builder addAutomaticLabelIds(long value) { + + ensureAutomaticLabelIdsIsMutable(); + automaticLabelIds_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param values The automaticLabelIds to add. + * @return This builder for chaining. + */ + public Builder addAllAutomaticLabelIds(java.lang.Iterable values) { + ensureAutomaticLabelIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, automaticLabelIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * Automatically created label IDs assigned to the MC account by
+     * CSS Center.
+     * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return This builder for chaining. + */ + public Builder clearAutomaticLabelIds() { + automaticLabelIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + private int accountType_ = 0; + /** + * + * + *
+     * Output only. The type of this account.
+     * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for accountType. + */ + @java.lang.Override + public int getAccountTypeValue() { + return accountType_; + } + /** + * + * + *
+     * Output only. The type of this account.
+     * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for accountType to set. + * @return This builder for chaining. + */ + public Builder setAccountTypeValue(int value) { + accountType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this account.
+     * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The accountType. + */ + @java.lang.Override + public com.google.shopping.css.v1.Account.AccountType getAccountType() { + com.google.shopping.css.v1.Account.AccountType result = + com.google.shopping.css.v1.Account.AccountType.forNumber(accountType_); + return result == null ? com.google.shopping.css.v1.Account.AccountType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The type of this account.
+     * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The accountType to set. + * @return This builder for chaining. + */ + public Builder setAccountType(com.google.shopping.css.v1.Account.AccountType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + accountType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this account.
+     * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAccountType() { + bitField0_ = (bitField0_ & ~0x00000080); + accountType_ = 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.css.v1.Account) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.Account) + private static final com.google.shopping.css.v1.Account DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.Account(); + } + + public static com.google.shopping.css.v1.Account getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Account 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.css.v1.Account getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabel.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabel.java new file mode 100644 index 000000000000..4d656ac1a3ed --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabel.java @@ -0,0 +1,1575 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Label assigned by CSS domain or CSS group to one of its sub-accounts.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.AccountLabel} + */ +public final class AccountLabel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.AccountLabel) + AccountLabelOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccountLabel.newBuilder() to construct. + private AccountLabel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccountLabel() { + name_ = ""; + displayName_ = ""; + description_ = ""; + labelType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccountLabel(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_AccountLabel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_AccountLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.AccountLabel.class, + com.google.shopping.css.v1.AccountLabel.Builder.class); + } + + /** + * + * + *
+   * The label type.
+   * 
+ * + * Protobuf enum {@code google.shopping.css.v1.AccountLabel.LabelType} + */ + public enum LabelType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown label type.
+     * 
+ * + * LABEL_TYPE_UNSPECIFIED = 0; + */ + LABEL_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates that the label was created manually.
+     * 
+ * + * MANUAL = 1; + */ + MANUAL(1), + /** + * + * + *
+     * Indicates that the label was created automatically by CSS Center.
+     * 
+ * + * AUTOMATIC = 2; + */ + AUTOMATIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown label type.
+     * 
+ * + * LABEL_TYPE_UNSPECIFIED = 0; + */ + public static final int LABEL_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates that the label was created manually.
+     * 
+ * + * MANUAL = 1; + */ + public static final int MANUAL_VALUE = 1; + /** + * + * + *
+     * Indicates that the label was created automatically by CSS Center.
+     * 
+ * + * AUTOMATIC = 2; + */ + public static final int AUTOMATIC_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 LabelType 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 LabelType forNumber(int value) { + switch (value) { + case 0: + return LABEL_TYPE_UNSPECIFIED; + case 1: + return MANUAL; + case 2: + return AUTOMATIC; + 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 LabelType findValueByNumber(int number) { + return LabelType.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.css.v1.AccountLabel.getDescriptor().getEnumTypes().get(0); + } + + private static final LabelType[] VALUES = values(); + + public static LabelType 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 LabelType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.css.v1.AccountLabel.LabelType) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The resource name of the label.
+   * Format: accounts/{account}/labels/{label}
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The resource name of the label.
+   * Format: accounts/{account}/labels/{label}
+   * 
+ * + * string name = 1; + * + * @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 LABEL_ID_FIELD_NUMBER = 2; + private long labelId_ = 0L; + /** + * + * + *
+   * Output only. The ID of the label.
+   * 
+ * + * int64 label_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The labelId. + */ + @java.lang.Override + public long getLabelId() { + return labelId_; + } + + public static final int ACCOUNT_ID_FIELD_NUMBER = 3; + private long accountId_ = 0L; + /** + * + * + *
+   * Output only. The ID of account this label belongs to.
+   * 
+ * + * int64 account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + @java.lang.Override + public long getAccountId() { + return accountId_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @return Whether the displayName field is set. + */ + @java.lang.Override + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @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 DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @return Whether the description field is set. + */ + @java.lang.Override + public boolean hasDescription() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @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; + } + } + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @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 LABEL_TYPE_FIELD_NUMBER = 6; + private int labelType_ = 0; + /** + * + * + *
+   * Output only. The type of this label.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for labelType. + */ + @java.lang.Override + public int getLabelTypeValue() { + return labelType_; + } + /** + * + * + *
+   * Output only. The type of this label.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The labelType. + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel.LabelType getLabelType() { + com.google.shopping.css.v1.AccountLabel.LabelType result = + com.google.shopping.css.v1.AccountLabel.LabelType.forNumber(labelType_); + return result == null ? com.google.shopping.css.v1.AccountLabel.LabelType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (labelId_ != 0L) { + output.writeInt64(2, labelId_); + } + if (accountId_ != 0L) { + output.writeInt64(3, accountId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, displayName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (labelType_ + != com.google.shopping.css.v1.AccountLabel.LabelType.LABEL_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, labelType_); + } + 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 (labelId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, labelId_); + } + if (accountId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, accountId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, displayName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (labelType_ + != com.google.shopping.css.v1.AccountLabel.LabelType.LABEL_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, labelType_); + } + 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.css.v1.AccountLabel)) { + return super.equals(obj); + } + com.google.shopping.css.v1.AccountLabel other = (com.google.shopping.css.v1.AccountLabel) obj; + + if (!getName().equals(other.getName())) return false; + if (getLabelId() != other.getLabelId()) return false; + if (getAccountId() != other.getAccountId()) return false; + if (hasDisplayName() != other.hasDisplayName()) return false; + if (hasDisplayName()) { + if (!getDisplayName().equals(other.getDisplayName())) return false; + } + if (hasDescription() != other.hasDescription()) return false; + if (hasDescription()) { + if (!getDescription().equals(other.getDescription())) return false; + } + if (labelType_ != other.labelType_) 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) + LABEL_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLabelId()); + hash = (37 * hash) + ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAccountId()); + if (hasDisplayName()) { + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + } + if (hasDescription()) { + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + } + hash = (37 * hash) + LABEL_TYPE_FIELD_NUMBER; + hash = (53 * hash) + labelType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.AccountLabel parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.AccountLabel 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.css.v1.AccountLabel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.AccountLabel 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.css.v1.AccountLabel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.AccountLabel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.AccountLabel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.AccountLabel 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.css.v1.AccountLabel parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.AccountLabel 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.css.v1.AccountLabel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.AccountLabel 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.css.v1.AccountLabel 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; + } + /** + * + * + *
+   * Label assigned by CSS domain or CSS group to one of its sub-accounts.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.AccountLabel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.AccountLabel) + com.google.shopping.css.v1.AccountLabelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_AccountLabel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_AccountLabel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.AccountLabel.class, + com.google.shopping.css.v1.AccountLabel.Builder.class); + } + + // Construct using com.google.shopping.css.v1.AccountLabel.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + labelId_ = 0L; + accountId_ = 0L; + displayName_ = ""; + description_ = ""; + labelType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_AccountLabel_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel getDefaultInstanceForType() { + return com.google.shopping.css.v1.AccountLabel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel build() { + com.google.shopping.css.v1.AccountLabel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel buildPartial() { + com.google.shopping.css.v1.AccountLabel result = + new com.google.shopping.css.v1.AccountLabel(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.AccountLabel result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.labelId_ = labelId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.accountId_ = accountId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.displayName_ = displayName_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.labelType_ = labelType_; + } + 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.css.v1.AccountLabel) { + return mergeFrom((com.google.shopping.css.v1.AccountLabel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.AccountLabel other) { + if (other == com.google.shopping.css.v1.AccountLabel.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getLabelId() != 0L) { + setLabelId(other.getLabelId()); + } + if (other.getAccountId() != 0L) { + setAccountId(other.getAccountId()); + } + if (other.hasDisplayName()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasDescription()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.labelType_ != 0) { + setLabelTypeValue(other.getLabelTypeValue()); + } + 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: + { + labelId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + accountId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + labelType_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + 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_ = ""; + /** + * + * + *
+     * The resource name of the label.
+     * Format: accounts/{account}/labels/{label}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The resource name of the label.
+     * Format: accounts/{account}/labels/{label}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The resource name of the label.
+     * Format: accounts/{account}/labels/{label}
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The resource name of the label.
+     * Format: accounts/{account}/labels/{label}
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the label.
+     * Format: accounts/{account}/labels/{label}
+     * 
+ * + * string name = 1; + * + * @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 labelId_; + /** + * + * + *
+     * Output only. The ID of the label.
+     * 
+ * + * int64 label_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The labelId. + */ + @java.lang.Override + public long getLabelId() { + return labelId_; + } + /** + * + * + *
+     * Output only. The ID of the label.
+     * 
+ * + * int64 label_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The labelId to set. + * @return This builder for chaining. + */ + public Builder setLabelId(long value) { + + labelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The ID of the label.
+     * 
+ * + * int64 label_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLabelId() { + bitField0_ = (bitField0_ & ~0x00000002); + labelId_ = 0L; + onChanged(); + return this; + } + + private long accountId_; + /** + * + * + *
+     * Output only. The ID of account this label belongs to.
+     * 
+ * + * int64 account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + @java.lang.Override + public long getAccountId() { + return accountId_; + } + /** + * + * + *
+     * Output only. The ID of account this label belongs to.
+     * 
+ * + * int64 account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The accountId to set. + * @return This builder for chaining. + */ + public Builder setAccountId(long value) { + + accountId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The ID of account this label belongs to.
+     * 
+ * + * int64 account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAccountId() { + bitField0_ = (bitField0_ & ~0x00000004); + accountId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @return Whether the displayName field is set. + */ + public boolean hasDisplayName() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of this label.
+     * 
+ * + * optional string display_name = 4; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @return Whether the description field is set. + */ + public boolean hasDescription() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @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; + } + } + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The description of this label.
+     * 
+ * + * optional string description = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private int labelType_ = 0; + /** + * + * + *
+     * Output only. The type of this label.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for labelType. + */ + @java.lang.Override + public int getLabelTypeValue() { + return labelType_; + } + /** + * + * + *
+     * Output only. The type of this label.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for labelType to set. + * @return This builder for chaining. + */ + public Builder setLabelTypeValue(int value) { + labelType_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this label.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The labelType. + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel.LabelType getLabelType() { + com.google.shopping.css.v1.AccountLabel.LabelType result = + com.google.shopping.css.v1.AccountLabel.LabelType.forNumber(labelType_); + return result == null + ? com.google.shopping.css.v1.AccountLabel.LabelType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of this label.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The labelType to set. + * @return This builder for chaining. + */ + public Builder setLabelType(com.google.shopping.css.v1.AccountLabel.LabelType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + labelType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of this label.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLabelType() { + bitField0_ = (bitField0_ & ~0x00000020); + labelType_ = 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.css.v1.AccountLabel) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.AccountLabel) + private static final com.google.shopping.css.v1.AccountLabel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.AccountLabel(); + } + + public static com.google.shopping.css.v1.AccountLabel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccountLabel 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.css.v1.AccountLabel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelName.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelName.java new file mode 100644 index 000000000000..d3539c6e8a67 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 AccountLabelName implements ResourceName { + private static final PathTemplate ACCOUNT_LABEL = + PathTemplate.createWithoutUrlEncoding("accounts/{account}/labels/{label}"); + private volatile Map fieldValuesMap; + private final String account; + private final String label; + + @Deprecated + protected AccountLabelName() { + account = null; + label = null; + } + + private AccountLabelName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + label = Preconditions.checkNotNull(builder.getLabel()); + } + + public String getAccount() { + return account; + } + + public String getLabel() { + return label; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccountLabelName of(String account, String label) { + return newBuilder().setAccount(account).setLabel(label).build(); + } + + public static String format(String account, String label) { + return newBuilder().setAccount(account).setLabel(label).build().toString(); + } + + public static AccountLabelName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_LABEL.validatedMatch( + formattedString, "AccountLabelName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("label")); + } + + 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 (AccountLabelName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_LABEL.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 (label != null) { + fieldMapBuilder.put("label", label); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_LABEL.instantiate("account", account, "label", label); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccountLabelName that = ((AccountLabelName) o); + return Objects.equals(this.account, that.account) && Objects.equals(this.label, that.label); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(label); + return h; + } + + /** Builder for accounts/{account}/labels/{label}. */ + public static class Builder { + private String account; + private String label; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getLabel() { + return label; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setLabel(String label) { + this.label = label; + return this; + } + + private Builder(AccountLabelName accountLabelName) { + this.account = accountLabelName.account; + this.label = accountLabelName.label; + } + + public AccountLabelName build() { + return new AccountLabelName(this); + } + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelOrBuilder.java new file mode 100644 index 000000000000..79902981de68 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountLabelOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface AccountLabelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.AccountLabel) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the label.
+   * Format: accounts/{account}/labels/{label}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the label.
+   * Format: accounts/{account}/labels/{label}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The ID of the label.
+   * 
+ * + * int64 label_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The labelId. + */ + long getLabelId(); + + /** + * + * + *
+   * Output only. The ID of account this label belongs to.
+   * 
+ * + * int64 account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The accountId. + */ + long getAccountId(); + + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @return Whether the displayName field is set. + */ + boolean hasDisplayName(); + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The display name of this label.
+   * 
+ * + * optional string display_name = 4; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @return Whether the description field is set. + */ + boolean hasDescription(); + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * The description of this label.
+   * 
+ * + * optional string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The type of this label.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for labelType. + */ + int getLabelTypeValue(); + /** + * + * + *
+   * Output only. The type of this label.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel.LabelType label_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The labelType. + */ + com.google.shopping.css.v1.AccountLabel.LabelType getLabelType(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountName.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountName.java new file mode 100644 index 000000000000..11be191fd6f2 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountOrBuilder.java new file mode 100644 index 000000000000..50684c9dbc45 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountOrBuilder.java @@ -0,0 +1,315 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public interface AccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.Account) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's full name.
+   * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The fullName. + */ + java.lang.String getFullName(); + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's full name.
+   * 
+ * + * + * string full_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for fullName. + */ + com.google.protobuf.ByteString getFullNameBytes(); + + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @return Whether the displayName field is set. + */ + boolean hasDisplayName(); + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The CSS/MC account's short display name.
+   * 
+ * + * optional string display_name = 3; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the homepageUri field is set. + */ + boolean hasHomepageUri(); + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The homepageUri. + */ + java.lang.String getHomepageUri(); + /** + * + * + *
+   * Output only. Immutable. The CSS/MC account's homepage.
+   * 
+ * + * + * optional string homepage_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for homepageUri. + */ + com.google.protobuf.ByteString getHomepageUriBytes(); + + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @return Whether the parent field is set. + */ + boolean hasParent(); + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The CSS/MC account's parent resource. CSS group for CSS domains; CSS
+   * domain for MC accounts. Returned only if the user has access to the
+   * parent account.
+   * 
+ * + * optional string parent = 5; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @return A list containing the labelIds. + */ + java.util.List getLabelIdsList(); + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @return The count of labelIds. + */ + int getLabelIdsCount(); + /** + * + * + *
+   * Manually created label IDs assigned to the CSS/MC account by a CSS parent
+   * account.
+   * 
+ * + * repeated int64 label_ids = 6; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + long getLabelIds(int index); + + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return A list containing the automaticLabelIds. + */ + java.util.List getAutomaticLabelIdsList(); + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @return The count of automaticLabelIds. + */ + int getAutomaticLabelIdsCount(); + /** + * + * + *
+   * Automatically created label IDs assigned to the MC account by
+   * CSS Center.
+   * 
+ * + * repeated int64 automatic_label_ids = 7; + * + * @param index The index of the element to return. + * @return The automaticLabelIds at the given index. + */ + long getAutomaticLabelIds(int index); + + /** + * + * + *
+   * Output only. The type of this account.
+   * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for accountType. + */ + int getAccountTypeValue(); + /** + * + * + *
+   * Output only. The type of this account.
+   * 
+ * + * + * .google.shopping.css.v1.Account.AccountType account_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The accountType. + */ + com.google.shopping.css.v1.Account.AccountType getAccountType(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsLabelsProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsLabelsProto.java new file mode 100644 index 000000000000..0b3345c182cf --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsLabelsProto.java @@ -0,0 +1,203 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public final class AccountsLabelsProto { + private AccountsLabelsProto() {} + + 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_css_v1_AccountLabel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_AccountLabel_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListAccountLabelsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListAccountLabelsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CreateAccountLabelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_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/css/v1/accounts_labels" + + ".proto\022\026google.shopping.css.v1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032\033google/protob" + + "uf/empty.proto\"\230\003\n\014AccountLabel\022\014\n\004name\030" + + "\001 \001(\t\022\026\n\010label_id\030\002 \001(\003B\004\342A\001\003\022\030\n\naccount" + + "_id\030\003 \001(\003B\004\342A\001\003\022\031\n\014display_name\030\004 \001(\tH\000\210" + + "\001\001\022\030\n\013description\030\005 \001(\tH\001\210\001\001\022H\n\nlabel_ty" + + "pe\030\006 \001(\0162..google.shopping.css.v1.Accoun" + + "tLabel.LabelTypeB\004\342A\001\003\"B\n\tLabelType\022\032\n\026L" + + "ABEL_TYPE_UNSPECIFIED\020\000\022\n\n\006MANUAL\020\001\022\r\n\tA" + + "UTOMATIC\020\002:d\352Aa\n\037css.googleapis.com/Acco" + + "untLabel\022!accounts/{account}/labels/{lab" + + "el}*\raccountLabels2\014accountLabelB\017\n\r_dis" + + "play_nameB\016\n\014_description\"{\n\030ListAccount" + + "LabelsRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A!\022\037" + + "css.googleapis.com/AccountLabel\022\021\n\tpage_" + + "size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"r\n\031ListAc" + + "countLabelsResponse\022<\n\016account_labels\030\001 " + + "\003(\0132$.google.shopping.css.v1.AccountLabe" + + "l\022\027\n\017next_page_token\030\002 \001(\t\"\230\001\n\031CreateAcc" + + "ountLabelRequest\0228\n\006parent\030\001 \001(\tB(\342A\001\002\372A" + + "!\022\037css.googleapis.com/AccountLabel\022A\n\rac" + + "count_label\030\002 \001(\0132$.google.shopping.css." + + "v1.AccountLabelB\004\342A\001\002\"^\n\031UpdateAccountLa" + + "belRequest\022A\n\raccount_label\030\001 \001(\0132$.goog" + + "le.shopping.css.v1.AccountLabelB\004\342A\001\002\"S\n" + + "\031DeleteAccountLabelRequest\0226\n\004name\030\001 \001(\t" + + "B(\342A\001\002\372A!\n\037css.googleapis.com/AccountLab" + + "el2\227\006\n\024AccountLabelsService\022\251\001\n\021ListAcco" + + "untLabels\0220.google.shopping.css.v1.ListA" + + "ccountLabelsRequest\0321.google.shopping.cs" + + "s.v1.ListAccountLabelsResponse\"/\332A\006paren" + + "t\202\323\344\223\002 \022\036/v1/{parent=accounts/*}/labels\022" + + "\273\001\n\022CreateAccountLabel\0221.google.shopping" + + ".css.v1.CreateAccountLabelRequest\032$.goog" + + "le.shopping.css.v1.AccountLabel\"L\332A\024pare" + + "nt,account_label\202\323\344\223\002/\"\036/v1/{parent=acco" + + "unts/*}/labels:\raccount_label\022\302\001\n\022Update" + + "AccountLabel\0221.google.shopping.css.v1.Up" + + "dateAccountLabelRequest\032$.google.shoppin" + + "g.css.v1.AccountLabel\"S\332A\raccount_label\202" + + "\323\344\223\002=2,/v1/{account_label.name=accounts/" + + "*/labels/*}:\raccount_label\022\216\001\n\022DeleteAcc" + + "ountLabel\0221.google.shopping.css.v1.Delet" + + "eAccountLabelRequest\032\026.google.protobuf.E" + + "mpty\"-\332A\004name\202\323\344\223\002 *\036/v1/{name=accounts/" + + "*/labels/*}\032?\312A\022css.googleapis.com\322A\'htt" + + "ps://www.googleapis.com/auth/contentB\265\001\n" + + "\032com.google.shopping.css.v1B\023AccountsLab" + + "elsProtoP\001Z2cloud.google.com/go/shopping" + + "/css/apiv1/csspb;csspb\252\002\026Google.Shopping" + + ".Css.V1\312\002\026Google\\Shopping\\Css\\V1\352\002\031Googl" + + "e::Shopping::Css::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.EmptyProto.getDescriptor(), + }); + internal_static_google_shopping_css_v1_AccountLabel_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_css_v1_AccountLabel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_AccountLabel_descriptor, + new java.lang.String[] { + "Name", + "LabelId", + "AccountId", + "DisplayName", + "Description", + "LabelType", + "DisplayName", + "Description", + }); + internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_css_v1_ListAccountLabelsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_css_v1_ListAccountLabelsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor, + new java.lang.String[] { + "AccountLabels", "NextPageToken", + }); + internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_css_v1_CreateAccountLabelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor, + new java.lang.String[] { + "Parent", "AccountLabel", + }); + internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor, + new java.lang.String[] { + "AccountLabel", + }); + internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_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.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsProto.java new file mode 100644 index 000000000000..5f7d4656fd05 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AccountsProto.java @@ -0,0 +1,190 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public final class AccountsProto { + private AccountsProto() {} + + 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_css_v1_ListChildAccountsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListChildAccountsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListChildAccountsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_GetAccountRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_GetAccountRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_Account_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_Account_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/css/v1/accounts.proto\022" + + "\026google.shopping.css.v1\032\034google/api/anno" + + "tations.proto\032\027google/api/client.proto\032\037" + + "google/api/field_behavior.proto\032\031google/" + + "api/resource.proto\"\314\001\n\030ListChildAccounts" + + "Request\0223\n\006parent\030\001 \001(\tB#\342A\001\002\372A\034\n\032css.go" + + "ogleapis.com/Account\022\025\n\010label_id\030\002 \001(\003H\000" + + "\210\001\001\022\026\n\tfull_name\030\003 \001(\tH\001\210\001\001\022\027\n\tpage_size" + + "\030\004 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\005 \001(\tB\004\342A\001\001B\013" + + "\n\t_label_idB\014\n\n_full_name\"g\n\031ListChildAc" + + "countsResponse\0221\n\010accounts\030\001 \003(\0132\037.googl" + + "e.shopping.css.v1.Account\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"\213\001\n\021GetAccountRequest\0221\n\004name" + + "\030\001 \001(\tB#\342A\001\002\372A\034\n\032css.googleapis.com/Acco" + + "unt\0228\n\006parent\030\002 \001(\tB#\342A\001\001\372A\034\n\032css.google" + + "apis.com/AccountH\000\210\001\001B\t\n\007_parent\"\247\001\n\032Upd" + + "ateAccountLabelsRequest\0221\n\004name\030\001 \001(\tB#\342" + + "A\001\002\372A\034\n\032css.googleapis.com/Account\022\021\n\tla" + + "bel_ids\030\002 \003(\003\0228\n\006parent\030\003 \001(\tB#\342A\001\001\372A\034\n\032" + + "css.googleapis.com/AccountH\000\210\001\001B\t\n\007_pare" + + "nt\"\272\004\n\007Account\022\014\n\004name\030\001 \001(\t\022\030\n\tfull_nam" + + "e\030\002 \001(\tB\005\342A\002\003\005\022\031\n\014display_name\030\003 \001(\tH\000\210\001" + + "\001\022 \n\014homepage_uri\030\004 \001(\tB\005\342A\002\003\005H\001\210\001\001\022\023\n\006p" + + "arent\030\005 \001(\tH\002\210\001\001\022\021\n\tlabel_ids\030\006 \003(\003\022\033\n\023a" + + "utomatic_label_ids\030\007 \003(\003\022G\n\014account_type" + + "\030\010 \001(\0162+.google.shopping.css.v1.Account." + + "AccountTypeB\004\342A\001\003\"\306\001\n\013AccountType\022\034\n\030ACC" + + "OUNT_TYPE_UNSPECIFIED\020\000\022\r\n\tCSS_GROUP\020\001\022\016" + + "\n\nCSS_DOMAIN\020\002\022\026\n\022MC_PRIMARY_CSS_MCA\020\003\022\016" + + "\n\nMC_CSS_MCA\020\004\022\026\n\022MC_MARKETPLACE_MCA\020\005\022\020" + + "\n\014MC_OTHER_MCA\020\006\022\021\n\rMC_STANDALONE\020\007\022\025\n\021M" + + "C_MCA_SUBACCOUNT\020\010:F\352AC\n\032css.googleapis." + + "com/Account\022\022accounts/{account}*\010account" + + "s2\007accountB\017\n\r_display_nameB\017\n\r_homepage" + + "_uriB\t\n\007_parent2\245\004\n\017AccountsService\022\264\001\n\021" + + "ListChildAccounts\0220.google.shopping.css." + + "v1.ListChildAccountsRequest\0321.google.sho" + + "pping.css.v1.ListChildAccountsResponse\":" + + "\332A\006parent\202\323\344\223\002+\022)/v1/{parent=accounts/*}" + + ":listChildAccounts\022~\n\nGetAccount\022).googl" + + "e.shopping.css.v1.GetAccountRequest\032\037.go" + + "ogle.shopping.css.v1.Account\"$\332A\004name\202\323\344" + + "\223\002\027\022\025/v1/{name=accounts/*}\022\231\001\n\014UpdateLab" + + "els\0222.google.shopping.css.v1.UpdateAccou" + + "ntLabelsRequest\032\037.google.shopping.css.v1" + + ".Account\"4\332A\004name\202\323\344\223\002\'\"\"/v1/{name=accou" + + "nts/*}:updateLabels:\001*\032?\312A\022css.googleapi" + + "s.com\322A\'https://www.googleapis.com/auth/" + + "contentB\257\001\n\032com.google.shopping.css.v1B\r" + + "AccountsProtoP\001Z2cloud.google.com/go/sho" + + "pping/css/apiv1/csspb;csspb\252\002\026Google.Sho" + + "pping.Css.V1\312\002\026Google\\Shopping\\Css\\V1\352\002\031" + + "Google::Shopping::Css::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(), + }); + internal_static_google_shopping_css_v1_ListChildAccountsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_css_v1_ListChildAccountsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListChildAccountsRequest_descriptor, + new java.lang.String[] { + "Parent", "LabelId", "FullName", "PageSize", "PageToken", "LabelId", "FullName", + }); + internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_css_v1_ListChildAccountsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor, + new java.lang.String[] { + "Accounts", "NextPageToken", + }); + internal_static_google_shopping_css_v1_GetAccountRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_css_v1_GetAccountRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_GetAccountRequest_descriptor, + new java.lang.String[] { + "Name", "Parent", "Parent", + }); + internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor, + new java.lang.String[] { + "Name", "LabelIds", "Parent", "Parent", + }); + internal_static_google_shopping_css_v1_Account_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_css_v1_Account_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_Account_descriptor, + new java.lang.String[] { + "Name", + "FullName", + "DisplayName", + "HomepageUri", + "Parent", + "LabelIds", + "AutomaticLabelIds", + "AccountType", + "DisplayName", + "HomepageUri", + "Parent", + }); + 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(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Attributes.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Attributes.java new file mode 100644 index 000000000000..91a725cd7407 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Attributes.java @@ -0,0 +1,12213 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Attributes for CSS Product.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.Attributes} + */ +public final class Attributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.Attributes) + AttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Attributes.newBuilder() to construct. + private Attributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Attributes() { + cppLink_ = ""; + cppMobileLink_ = ""; + cppAdsRedirect_ = ""; + headlineOfferCondition_ = ""; + headlineOfferLink_ = ""; + headlineOfferMobileLink_ = ""; + title_ = ""; + imageLink_ = ""; + additionalImageLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + description_ = ""; + brand_ = ""; + mpn_ = ""; + gtin_ = ""; + productTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + googleProductCategory_ = ""; + ageGroup_ = ""; + color_ = ""; + gender_ = ""; + material_ = ""; + pattern_ = ""; + size_ = ""; + sizeSystem_ = ""; + sizeTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + itemGroupId_ = ""; + productDetails_ = java.util.Collections.emptyList(); + productHighlights_ = com.google.protobuf.LazyStringArrayList.emptyList(); + certifications_ = java.util.Collections.emptyList(); + includedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + excludedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pause_ = ""; + customLabel0_ = ""; + customLabel1_ = ""; + customLabel2_ = ""; + customLabel3_ = ""; + customLabel4_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attributes(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Attributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Attributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Attributes.class, + com.google.shopping.css.v1.Attributes.Builder.class); + } + + private int bitField0_; + public static final int CPP_LINK_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object cppLink_ = ""; + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return Whether the cppLink field is set. + */ + @java.lang.Override + public boolean hasCppLink() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return The cppLink. + */ + @java.lang.Override + public java.lang.String getCppLink() { + java.lang.Object ref = cppLink_; + 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(); + cppLink_ = s; + return s; + } + } + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return The bytes for cppLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCppLinkBytes() { + java.lang.Object ref = cppLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CPP_MOBILE_LINK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object cppMobileLink_ = ""; + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return Whether the cppMobileLink field is set. + */ + @java.lang.Override + public boolean hasCppMobileLink() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The cppMobileLink. + */ + @java.lang.Override + public java.lang.String getCppMobileLink() { + java.lang.Object ref = cppMobileLink_; + 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(); + cppMobileLink_ = s; + return s; + } + } + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The bytes for cppMobileLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCppMobileLinkBytes() { + java.lang.Object ref = cppMobileLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppMobileLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CPP_ADS_REDIRECT_FIELD_NUMBER = 42; + + @SuppressWarnings("serial") + private volatile java.lang.Object cppAdsRedirect_ = ""; + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return Whether the cppAdsRedirect field is set. + */ + @java.lang.Override + public boolean hasCppAdsRedirect() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The cppAdsRedirect. + */ + @java.lang.Override + public java.lang.String getCppAdsRedirect() { + java.lang.Object ref = cppAdsRedirect_; + 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(); + cppAdsRedirect_ = s; + return s; + } + } + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The bytes for cppAdsRedirect. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCppAdsRedirectBytes() { + java.lang.Object ref = cppAdsRedirect_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppAdsRedirect_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOW_PRICE_FIELD_NUMBER = 3; + private com.google.shopping.type.Price lowPrice_; + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return Whether the lowPrice field is set. + */ + @java.lang.Override + public boolean hasLowPrice() { + return lowPrice_ != null; + } + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return The lowPrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getLowPrice() { + return lowPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : lowPrice_; + } + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getLowPriceOrBuilder() { + return lowPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : lowPrice_; + } + + public static final int HIGH_PRICE_FIELD_NUMBER = 4; + private com.google.shopping.type.Price highPrice_; + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return Whether the highPrice field is set. + */ + @java.lang.Override + public boolean hasHighPrice() { + return highPrice_ != null; + } + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return The highPrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getHighPrice() { + return highPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : highPrice_; + } + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getHighPriceOrBuilder() { + return highPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : highPrice_; + } + + public static final int NUMBER_OF_OFFERS_FIELD_NUMBER = 5; + private long numberOfOffers_ = 0L; + /** + * + * + *
+   * The number of aggregate offers.
+   * 
+ * + * optional int64 number_of_offers = 5; + * + * @return Whether the numberOfOffers field is set. + */ + @java.lang.Override + public boolean hasNumberOfOffers() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * The number of aggregate offers.
+   * 
+ * + * optional int64 number_of_offers = 5; + * + * @return The numberOfOffers. + */ + @java.lang.Override + public long getNumberOfOffers() { + return numberOfOffers_; + } + + public static final int HEADLINE_OFFER_CONDITION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object headlineOfferCondition_ = ""; + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return Whether the headlineOfferCondition field is set. + */ + @java.lang.Override + public boolean hasHeadlineOfferCondition() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The headlineOfferCondition. + */ + @java.lang.Override + public java.lang.String getHeadlineOfferCondition() { + java.lang.Object ref = headlineOfferCondition_; + 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(); + headlineOfferCondition_ = s; + return s; + } + } + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The bytes for headlineOfferCondition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeadlineOfferConditionBytes() { + java.lang.Object ref = headlineOfferCondition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferCondition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADLINE_OFFER_PRICE_FIELD_NUMBER = 7; + private com.google.shopping.type.Price headlineOfferPrice_; + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return Whether the headlineOfferPrice field is set. + */ + @java.lang.Override + public boolean hasHeadlineOfferPrice() { + return headlineOfferPrice_ != null; + } + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return The headlineOfferPrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getHeadlineOfferPrice() { + return headlineOfferPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferPrice_; + } + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getHeadlineOfferPriceOrBuilder() { + return headlineOfferPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferPrice_; + } + + public static final int HEADLINE_OFFER_LINK_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object headlineOfferLink_ = ""; + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return Whether the headlineOfferLink field is set. + */ + @java.lang.Override + public boolean hasHeadlineOfferLink() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return The headlineOfferLink. + */ + @java.lang.Override + public java.lang.String getHeadlineOfferLink() { + java.lang.Object ref = headlineOfferLink_; + 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(); + headlineOfferLink_ = s; + return s; + } + } + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return The bytes for headlineOfferLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeadlineOfferLinkBytes() { + java.lang.Object ref = headlineOfferLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADLINE_OFFER_MOBILE_LINK_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object headlineOfferMobileLink_ = ""; + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return Whether the headlineOfferMobileLink field is set. + */ + @java.lang.Override + public boolean hasHeadlineOfferMobileLink() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The headlineOfferMobileLink. + */ + @java.lang.Override + public java.lang.String getHeadlineOfferMobileLink() { + java.lang.Object ref = headlineOfferMobileLink_; + 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(); + headlineOfferMobileLink_ = s; + return s; + } + } + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The bytes for headlineOfferMobileLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHeadlineOfferMobileLinkBytes() { + java.lang.Object ref = headlineOfferMobileLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferMobileLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HEADLINE_OFFER_SHIPPING_PRICE_FIELD_NUMBER = 41; + private com.google.shopping.type.Price headlineOfferShippingPrice_; + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return Whether the headlineOfferShippingPrice field is set. + */ + @java.lang.Override + public boolean hasHeadlineOfferShippingPrice() { + return headlineOfferShippingPrice_ != null; + } + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return The headlineOfferShippingPrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getHeadlineOfferShippingPrice() { + return headlineOfferShippingPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferShippingPrice_; + } + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getHeadlineOfferShippingPriceOrBuilder() { + return headlineOfferShippingPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferShippingPrice_; + } + + public static final int TITLE_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object title_ = ""; + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @return Whether the title field is set. + */ + @java.lang.Override + public boolean hasTitle() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @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; + } + } + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @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 IMAGE_LINK_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object imageLink_ = ""; + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return Whether the imageLink field is set. + */ + @java.lang.Override + public boolean hasImageLink() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return The imageLink. + */ + @java.lang.Override + public java.lang.String getImageLink() { + java.lang.Object ref = imageLink_; + 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(); + imageLink_ = s; + return s; + } + } + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return The bytes for imageLink. + */ + @java.lang.Override + public com.google.protobuf.ByteString getImageLinkBytes() { + java.lang.Object ref = imageLink_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + imageLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDITIONAL_IMAGE_LINKS_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList additionalImageLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @return A list containing the additionalImageLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalImageLinksList() { + return additionalImageLinks_; + } + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @return The count of additionalImageLinks. + */ + public int getAdditionalImageLinksCount() { + return additionalImageLinks_.size(); + } + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the element to return. + * @return The additionalImageLinks at the given index. + */ + public java.lang.String getAdditionalImageLinks(int index) { + return additionalImageLinks_.get(index); + } + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the value to return. + * @return The bytes of the additionalImageLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalImageLinksBytes(int index) { + return additionalImageLinks_.getByteString(index); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @return Whether the description field is set. + */ + @java.lang.Override + public boolean hasDescription() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @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; + } + } + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @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 BRAND_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object brand_ = ""; + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return Whether the brand field is set. + */ + @java.lang.Override + public boolean hasBrand() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return The brand. + */ + @java.lang.Override + public java.lang.String getBrand() { + java.lang.Object ref = brand_; + 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(); + brand_ = s; + return s; + } + } + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return The bytes for brand. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBrandBytes() { + java.lang.Object ref = brand_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + brand_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MPN_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object mpn_ = ""; + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return Whether the mpn field is set. + */ + @java.lang.Override + public boolean hasMpn() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return The mpn. + */ + @java.lang.Override + public java.lang.String getMpn() { + java.lang.Object ref = mpn_; + 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(); + mpn_ = s; + return s; + } + } + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return The bytes for mpn. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMpnBytes() { + java.lang.Object ref = mpn_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mpn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GTIN_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private volatile java.lang.Object gtin_ = ""; + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return Whether the gtin field is set. + */ + @java.lang.Override + public boolean hasGtin() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return The gtin. + */ + @java.lang.Override + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + 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(); + gtin_ = s; + return s; + } + } + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return The bytes for gtin. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_TYPES_FIELD_NUMBER = 36; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList productTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @return A list containing the productTypes. + */ + public com.google.protobuf.ProtocolStringList getProductTypesList() { + return productTypes_; + } + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @return The count of productTypes. + */ + public int getProductTypesCount() { + return productTypes_.size(); + } + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the element to return. + * @return The productTypes at the given index. + */ + public java.lang.String getProductTypes(int index) { + return productTypes_.get(index); + } + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the value to return. + * @return The bytes of the productTypes at the given index. + */ + public com.google.protobuf.ByteString getProductTypesBytes(int index) { + return productTypes_.getByteString(index); + } + + public static final int GOOGLE_PRODUCT_CATEGORY_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object googleProductCategory_ = ""; + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return Whether the googleProductCategory field is set. + */ + @java.lang.Override + public boolean hasGoogleProductCategory() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return The googleProductCategory. + */ + @java.lang.Override + public java.lang.String getGoogleProductCategory() { + java.lang.Object ref = googleProductCategory_; + 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(); + googleProductCategory_ = s; + return s; + } + } + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return The bytes for googleProductCategory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGoogleProductCategoryBytes() { + java.lang.Object ref = googleProductCategory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + googleProductCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADULT_FIELD_NUMBER = 18; + private boolean adult_ = false; + /** + * + * + *
+   * Set to true if the item is targeted towards adults.
+   * 
+ * + * optional bool adult = 18; + * + * @return Whether the adult field is set. + */ + @java.lang.Override + public boolean hasAdult() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+   * Set to true if the item is targeted towards adults.
+   * 
+ * + * optional bool adult = 18; + * + * @return The adult. + */ + @java.lang.Override + public boolean getAdult() { + return adult_; + } + + public static final int MULTIPACK_FIELD_NUMBER = 19; + private long multipack_ = 0L; + /** + * + * + *
+   * The number of identical products in a merchant-defined multipack.
+   * 
+ * + * optional int64 multipack = 19; + * + * @return Whether the multipack field is set. + */ + @java.lang.Override + public boolean hasMultipack() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+   * The number of identical products in a merchant-defined multipack.
+   * 
+ * + * optional int64 multipack = 19; + * + * @return The multipack. + */ + @java.lang.Override + public long getMultipack() { + return multipack_; + } + + public static final int IS_BUNDLE_FIELD_NUMBER = 20; + private boolean isBundle_ = false; + /** + * + * + *
+   * Whether the item is a merchant-defined bundle. A bundle is a custom
+   * grouping of different products sold by a merchant for a single price.
+   * 
+ * + * optional bool is_bundle = 20; + * + * @return Whether the isBundle field is set. + */ + @java.lang.Override + public boolean hasIsBundle() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+   * Whether the item is a merchant-defined bundle. A bundle is a custom
+   * grouping of different products sold by a merchant for a single price.
+   * 
+ * + * optional bool is_bundle = 20; + * + * @return The isBundle. + */ + @java.lang.Override + public boolean getIsBundle() { + return isBundle_; + } + + public static final int AGE_GROUP_FIELD_NUMBER = 21; + + @SuppressWarnings("serial") + private volatile java.lang.Object ageGroup_ = ""; + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return Whether the ageGroup field is set. + */ + @java.lang.Override + public boolean hasAgeGroup() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return The ageGroup. + */ + @java.lang.Override + public java.lang.String getAgeGroup() { + java.lang.Object ref = ageGroup_; + 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(); + ageGroup_ = s; + return s; + } + } + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return The bytes for ageGroup. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAgeGroupBytes() { + java.lang.Object ref = ageGroup_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ageGroup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COLOR_FIELD_NUMBER = 22; + + @SuppressWarnings("serial") + private volatile java.lang.Object color_ = ""; + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return Whether the color field is set. + */ + @java.lang.Override + public boolean hasColor() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return The color. + */ + @java.lang.Override + public java.lang.String getColor() { + java.lang.Object ref = color_; + 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(); + color_ = s; + return s; + } + } + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return The bytes for color. + */ + @java.lang.Override + public com.google.protobuf.ByteString getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENDER_FIELD_NUMBER = 23; + + @SuppressWarnings("serial") + private volatile java.lang.Object gender_ = ""; + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return Whether the gender field is set. + */ + @java.lang.Override + public boolean hasGender() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return The gender. + */ + @java.lang.Override + public java.lang.String getGender() { + java.lang.Object ref = gender_; + 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(); + gender_ = s; + return s; + } + } + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return The bytes for gender. + */ + @java.lang.Override + public com.google.protobuf.ByteString getGenderBytes() { + java.lang.Object ref = gender_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MATERIAL_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private volatile java.lang.Object material_ = ""; + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return Whether the material field is set. + */ + @java.lang.Override + public boolean hasMaterial() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return The material. + */ + @java.lang.Override + public java.lang.String getMaterial() { + java.lang.Object ref = material_; + 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(); + material_ = s; + return s; + } + } + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return The bytes for material. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMaterialBytes() { + java.lang.Object ref = material_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + material_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATTERN_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private volatile java.lang.Object pattern_ = ""; + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return Whether the pattern field is set. + */ + @java.lang.Override + public boolean hasPattern() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return The pattern. + */ + @java.lang.Override + public java.lang.String getPattern() { + java.lang.Object ref = pattern_; + 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(); + pattern_ = s; + return s; + } + } + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return The bytes for pattern. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPatternBytes() { + java.lang.Object ref = pattern_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_FIELD_NUMBER = 26; + + @SuppressWarnings("serial") + private volatile java.lang.Object size_ = ""; + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return Whether the size field is set. + */ + @java.lang.Override + public boolean hasSize() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return The size. + */ + @java.lang.Override + public java.lang.String getSize() { + java.lang.Object ref = size_; + 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(); + size_ = s; + return s; + } + } + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return The bytes for size. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSizeBytes() { + java.lang.Object ref = size_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + size_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_SYSTEM_FIELD_NUMBER = 27; + + @SuppressWarnings("serial") + private volatile java.lang.Object sizeSystem_ = ""; + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return Whether the sizeSystem field is set. + */ + @java.lang.Override + public boolean hasSizeSystem() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return The sizeSystem. + */ + @java.lang.Override + public java.lang.String getSizeSystem() { + java.lang.Object ref = sizeSystem_; + 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(); + sizeSystem_ = s; + return s; + } + } + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return The bytes for sizeSystem. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSizeSystemBytes() { + java.lang.Object ref = sizeSystem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sizeSystem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_TYPES_FIELD_NUMBER = 28; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList sizeTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @return A list containing the sizeTypes. + */ + public com.google.protobuf.ProtocolStringList getSizeTypesList() { + return sizeTypes_; + } + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @return The count of sizeTypes. + */ + public int getSizeTypesCount() { + return sizeTypes_.size(); + } + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the element to return. + * @return The sizeTypes at the given index. + */ + public java.lang.String getSizeTypes(int index) { + return sizeTypes_.get(index); + } + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the value to return. + * @return The bytes of the sizeTypes at the given index. + */ + public com.google.protobuf.ByteString getSizeTypesBytes(int index) { + return sizeTypes_.getByteString(index); + } + + public static final int ITEM_GROUP_ID_FIELD_NUMBER = 29; + + @SuppressWarnings("serial") + private volatile java.lang.Object itemGroupId_ = ""; + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return Whether the itemGroupId field is set. + */ + @java.lang.Override + public boolean hasItemGroupId() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return The itemGroupId. + */ + @java.lang.Override + public java.lang.String getItemGroupId() { + java.lang.Object ref = itemGroupId_; + 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(); + itemGroupId_ = s; + return s; + } + } + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return The bytes for itemGroupId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getItemGroupIdBytes() { + java.lang.Object ref = itemGroupId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + itemGroupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRODUCT_DETAILS_FIELD_NUMBER = 30; + + @SuppressWarnings("serial") + private java.util.List productDetails_; + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + @java.lang.Override + public java.util.List getProductDetailsList() { + return productDetails_; + } + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + @java.lang.Override + public java.util.List + getProductDetailsOrBuilderList() { + return productDetails_; + } + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + @java.lang.Override + public int getProductDetailsCount() { + return productDetails_.size(); + } + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDetail getProductDetails(int index) { + return productDetails_.get(index); + } + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { + return productDetails_.get(index); + } + + public static final int PRODUCT_WEIGHT_FIELD_NUMBER = 31; + private com.google.shopping.css.v1.ProductWeight productWeight_; + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return Whether the productWeight field is set. + */ + @java.lang.Override + public boolean hasProductWeight() { + return productWeight_ != null; + } + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return The productWeight. + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductWeight getProductWeight() { + return productWeight_ == null + ? com.google.shopping.css.v1.ProductWeight.getDefaultInstance() + : productWeight_; + } + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductWeightOrBuilder getProductWeightOrBuilder() { + return productWeight_ == null + ? com.google.shopping.css.v1.ProductWeight.getDefaultInstance() + : productWeight_; + } + + public static final int PRODUCT_LENGTH_FIELD_NUMBER = 32; + private com.google.shopping.css.v1.ProductDimension productLength_; + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return Whether the productLength field is set. + */ + @java.lang.Override + public boolean hasProductLength() { + return productLength_ != null; + } + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return The productLength. + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension getProductLength() { + return productLength_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productLength_; + } + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductLengthOrBuilder() { + return productLength_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productLength_; + } + + public static final int PRODUCT_WIDTH_FIELD_NUMBER = 33; + private com.google.shopping.css.v1.ProductDimension productWidth_; + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return Whether the productWidth field is set. + */ + @java.lang.Override + public boolean hasProductWidth() { + return productWidth_ != null; + } + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return The productWidth. + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension getProductWidth() { + return productWidth_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productWidth_; + } + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductWidthOrBuilder() { + return productWidth_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productWidth_; + } + + public static final int PRODUCT_HEIGHT_FIELD_NUMBER = 34; + private com.google.shopping.css.v1.ProductDimension productHeight_; + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return Whether the productHeight field is set. + */ + @java.lang.Override + public boolean hasProductHeight() { + return productHeight_ != null; + } + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return The productHeight. + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension getProductHeight() { + return productHeight_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productHeight_; + } + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + @java.lang.Override + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductHeightOrBuilder() { + return productHeight_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productHeight_; + } + + public static final int PRODUCT_HIGHLIGHTS_FIELD_NUMBER = 35; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList productHighlights_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @return A list containing the productHighlights. + */ + public com.google.protobuf.ProtocolStringList getProductHighlightsList() { + return productHighlights_; + } + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @return The count of productHighlights. + */ + public int getProductHighlightsCount() { + return productHighlights_.size(); + } + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the element to return. + * @return The productHighlights at the given index. + */ + public java.lang.String getProductHighlights(int index) { + return productHighlights_.get(index); + } + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the value to return. + * @return The bytes of the productHighlights at the given index. + */ + public com.google.protobuf.ByteString getProductHighlightsBytes(int index) { + return productHighlights_.getByteString(index); + } + + public static final int CERTIFICATIONS_FIELD_NUMBER = 39; + + @SuppressWarnings("serial") + private java.util.List certifications_; + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + @java.lang.Override + public java.util.List getCertificationsList() { + return certifications_; + } + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + @java.lang.Override + public java.util.List + getCertificationsOrBuilderList() { + return certifications_; + } + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + @java.lang.Override + public int getCertificationsCount() { + return certifications_.size(); + } + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + @java.lang.Override + public com.google.shopping.css.v1.Certification getCertifications(int index) { + return certifications_.get(index); + } + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + @java.lang.Override + public com.google.shopping.css.v1.CertificationOrBuilder getCertificationsOrBuilder(int index) { + return certifications_.get(index); + } + + public static final int EXPIRATION_DATE_FIELD_NUMBER = 40; + private com.google.protobuf.Timestamp expirationDate_; + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return Whether the expirationDate field is set. + */ + @java.lang.Override + public boolean hasExpirationDate() { + return expirationDate_ != null; + } + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return The expirationDate. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpirationDate() { + return expirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationDate_; + } + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpirationDateOrBuilder() { + return expirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationDate_; + } + + public static final int INCLUDED_DESTINATIONS_FIELD_NUMBER = 43; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList includedDestinations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @return A list containing the includedDestinations. + */ + public com.google.protobuf.ProtocolStringList getIncludedDestinationsList() { + return includedDestinations_; + } + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @return The count of includedDestinations. + */ + public int getIncludedDestinationsCount() { + return includedDestinations_.size(); + } + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the element to return. + * @return The includedDestinations at the given index. + */ + public java.lang.String getIncludedDestinations(int index) { + return includedDestinations_.get(index); + } + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the value to return. + * @return The bytes of the includedDestinations at the given index. + */ + public com.google.protobuf.ByteString getIncludedDestinationsBytes(int index) { + return includedDestinations_.getByteString(index); + } + + public static final int EXCLUDED_DESTINATIONS_FIELD_NUMBER = 44; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList excludedDestinations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @return A list containing the excludedDestinations. + */ + public com.google.protobuf.ProtocolStringList getExcludedDestinationsList() { + return excludedDestinations_; + } + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @return The count of excludedDestinations. + */ + public int getExcludedDestinationsCount() { + return excludedDestinations_.size(); + } + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the element to return. + * @return The excludedDestinations at the given index. + */ + public java.lang.String getExcludedDestinations(int index) { + return excludedDestinations_.get(index); + } + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the value to return. + * @return The bytes of the excludedDestinations at the given index. + */ + public com.google.protobuf.ByteString getExcludedDestinationsBytes(int index) { + return excludedDestinations_.getByteString(index); + } + + public static final int PAUSE_FIELD_NUMBER = 45; + + @SuppressWarnings("serial") + private volatile java.lang.Object pause_ = ""; + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return Whether the pause field is set. + */ + @java.lang.Override + public boolean hasPause() { + return ((bitField0_ & 0x02000000) != 0); + } + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return The pause. + */ + @java.lang.Override + public java.lang.String getPause() { + java.lang.Object ref = pause_; + 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(); + pause_ = s; + return s; + } + } + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return The bytes for pause. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPauseBytes() { + java.lang.Object ref = pause_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pause_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_LABEL_0_FIELD_NUMBER = 46; + + @SuppressWarnings("serial") + private volatile java.lang.Object customLabel0_ = ""; + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return Whether the customLabel0 field is set. + */ + @java.lang.Override + public boolean hasCustomLabel0() { + return ((bitField0_ & 0x04000000) != 0); + } + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return The customLabel0. + */ + @java.lang.Override + public java.lang.String getCustomLabel0() { + java.lang.Object ref = customLabel0_; + 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(); + customLabel0_ = s; + return s; + } + } + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return The bytes for customLabel0. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomLabel0Bytes() { + java.lang.Object ref = customLabel0_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel0_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_LABEL_1_FIELD_NUMBER = 47; + + @SuppressWarnings("serial") + private volatile java.lang.Object customLabel1_ = ""; + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return Whether the customLabel1 field is set. + */ + @java.lang.Override + public boolean hasCustomLabel1() { + return ((bitField0_ & 0x08000000) != 0); + } + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return The customLabel1. + */ + @java.lang.Override + public java.lang.String getCustomLabel1() { + java.lang.Object ref = customLabel1_; + 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(); + customLabel1_ = s; + return s; + } + } + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return The bytes for customLabel1. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomLabel1Bytes() { + java.lang.Object ref = customLabel1_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel1_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_LABEL_2_FIELD_NUMBER = 48; + + @SuppressWarnings("serial") + private volatile java.lang.Object customLabel2_ = ""; + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return Whether the customLabel2 field is set. + */ + @java.lang.Override + public boolean hasCustomLabel2() { + return ((bitField0_ & 0x10000000) != 0); + } + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return The customLabel2. + */ + @java.lang.Override + public java.lang.String getCustomLabel2() { + java.lang.Object ref = customLabel2_; + 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(); + customLabel2_ = s; + return s; + } + } + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return The bytes for customLabel2. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomLabel2Bytes() { + java.lang.Object ref = customLabel2_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel2_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_LABEL_3_FIELD_NUMBER = 49; + + @SuppressWarnings("serial") + private volatile java.lang.Object customLabel3_ = ""; + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return Whether the customLabel3 field is set. + */ + @java.lang.Override + public boolean hasCustomLabel3() { + return ((bitField0_ & 0x20000000) != 0); + } + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return The customLabel3. + */ + @java.lang.Override + public java.lang.String getCustomLabel3() { + java.lang.Object ref = customLabel3_; + 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(); + customLabel3_ = s; + return s; + } + } + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return The bytes for customLabel3. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomLabel3Bytes() { + java.lang.Object ref = customLabel3_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel3_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_LABEL_4_FIELD_NUMBER = 50; + + @SuppressWarnings("serial") + private volatile java.lang.Object customLabel4_ = ""; + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return Whether the customLabel4 field is set. + */ + @java.lang.Override + public boolean hasCustomLabel4() { + return ((bitField0_ & 0x40000000) != 0); + } + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return The customLabel4. + */ + @java.lang.Override + public java.lang.String getCustomLabel4() { + java.lang.Object ref = customLabel4_; + 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(); + customLabel4_ = s; + return s; + } + } + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return The bytes for customLabel4. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomLabel4Bytes() { + java.lang.Object ref = customLabel4_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel4_ = 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cppLink_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cppMobileLink_); + } + if (lowPrice_ != null) { + output.writeMessage(3, getLowPrice()); + } + if (highPrice_ != null) { + output.writeMessage(4, getHighPrice()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(5, numberOfOffers_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, headlineOfferCondition_); + } + if (headlineOfferPrice_ != null) { + output.writeMessage(7, getHeadlineOfferPrice()); + } + if (((bitField0_ & 0x00000020) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, headlineOfferLink_); + } + if (((bitField0_ & 0x00000040) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, headlineOfferMobileLink_); + } + if (((bitField0_ & 0x00000080) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, title_); + } + if (((bitField0_ & 0x00000100) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, imageLink_); + } + for (int i = 0; i < additionalImageLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 12, additionalImageLinks_.getRaw(i)); + } + if (((bitField0_ & 0x00000200) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, description_); + } + if (((bitField0_ & 0x00000400) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, brand_); + } + if (((bitField0_ & 0x00000800) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, mpn_); + } + if (((bitField0_ & 0x00001000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, gtin_); + } + if (((bitField0_ & 0x00002000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, googleProductCategory_); + } + if (((bitField0_ & 0x00004000) != 0)) { + output.writeBool(18, adult_); + } + if (((bitField0_ & 0x00008000) != 0)) { + output.writeInt64(19, multipack_); + } + if (((bitField0_ & 0x00010000) != 0)) { + output.writeBool(20, isBundle_); + } + if (((bitField0_ & 0x00020000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 21, ageGroup_); + } + if (((bitField0_ & 0x00040000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, color_); + } + if (((bitField0_ & 0x00080000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 23, gender_); + } + if (((bitField0_ & 0x00100000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 24, material_); + } + if (((bitField0_ & 0x00200000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 25, pattern_); + } + if (((bitField0_ & 0x00400000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 26, size_); + } + if (((bitField0_ & 0x00800000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, sizeSystem_); + } + for (int i = 0; i < sizeTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, sizeTypes_.getRaw(i)); + } + if (((bitField0_ & 0x01000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 29, itemGroupId_); + } + for (int i = 0; i < productDetails_.size(); i++) { + output.writeMessage(30, productDetails_.get(i)); + } + if (productWeight_ != null) { + output.writeMessage(31, getProductWeight()); + } + if (productLength_ != null) { + output.writeMessage(32, getProductLength()); + } + if (productWidth_ != null) { + output.writeMessage(33, getProductWidth()); + } + if (productHeight_ != null) { + output.writeMessage(34, getProductHeight()); + } + for (int i = 0; i < productHighlights_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 35, productHighlights_.getRaw(i)); + } + for (int i = 0; i < productTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 36, productTypes_.getRaw(i)); + } + for (int i = 0; i < certifications_.size(); i++) { + output.writeMessage(39, certifications_.get(i)); + } + if (expirationDate_ != null) { + output.writeMessage(40, getExpirationDate()); + } + if (headlineOfferShippingPrice_ != null) { + output.writeMessage(41, getHeadlineOfferShippingPrice()); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 42, cppAdsRedirect_); + } + for (int i = 0; i < includedDestinations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 43, includedDestinations_.getRaw(i)); + } + for (int i = 0; i < excludedDestinations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 44, excludedDestinations_.getRaw(i)); + } + if (((bitField0_ & 0x02000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 45, pause_); + } + if (((bitField0_ & 0x04000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 46, customLabel0_); + } + if (((bitField0_ & 0x08000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 47, customLabel1_); + } + if (((bitField0_ & 0x10000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 48, customLabel2_); + } + if (((bitField0_ & 0x20000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 49, customLabel3_); + } + if (((bitField0_ & 0x40000000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 50, customLabel4_); + } + 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(1, cppLink_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cppMobileLink_); + } + if (lowPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLowPrice()); + } + if (highPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getHighPrice()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, numberOfOffers_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, headlineOfferCondition_); + } + if (headlineOfferPrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getHeadlineOfferPrice()); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, headlineOfferLink_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, headlineOfferMobileLink_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, title_); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, imageLink_); + } + { + int dataSize = 0; + for (int i = 0; i < additionalImageLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalImageLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalImageLinksList().size(); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, description_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, brand_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, mpn_); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, gtin_); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, googleProductCategory_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(18, adult_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(19, multipack_); + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, isBundle_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(21, ageGroup_); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, color_); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(23, gender_); + } + if (((bitField0_ & 0x00100000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(24, material_); + } + if (((bitField0_ & 0x00200000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(25, pattern_); + } + if (((bitField0_ & 0x00400000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(26, size_); + } + if (((bitField0_ & 0x00800000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, sizeSystem_); + } + { + int dataSize = 0; + for (int i = 0; i < sizeTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(sizeTypes_.getRaw(i)); + } + size += dataSize; + size += 2 * getSizeTypesList().size(); + } + if (((bitField0_ & 0x01000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(29, itemGroupId_); + } + for (int i = 0; i < productDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(30, productDetails_.get(i)); + } + if (productWeight_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(31, getProductWeight()); + } + if (productLength_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(32, getProductLength()); + } + if (productWidth_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(33, getProductWidth()); + } + if (productHeight_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, getProductHeight()); + } + { + int dataSize = 0; + for (int i = 0; i < productHighlights_.size(); i++) { + dataSize += computeStringSizeNoTag(productHighlights_.getRaw(i)); + } + size += dataSize; + size += 2 * getProductHighlightsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < productTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(productTypes_.getRaw(i)); + } + size += dataSize; + size += 2 * getProductTypesList().size(); + } + for (int i = 0; i < certifications_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(39, certifications_.get(i)); + } + if (expirationDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(40, getExpirationDate()); + } + if (headlineOfferShippingPrice_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 41, getHeadlineOfferShippingPrice()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(42, cppAdsRedirect_); + } + { + int dataSize = 0; + for (int i = 0; i < includedDestinations_.size(); i++) { + dataSize += computeStringSizeNoTag(includedDestinations_.getRaw(i)); + } + size += dataSize; + size += 2 * getIncludedDestinationsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < excludedDestinations_.size(); i++) { + dataSize += computeStringSizeNoTag(excludedDestinations_.getRaw(i)); + } + size += dataSize; + size += 2 * getExcludedDestinationsList().size(); + } + if (((bitField0_ & 0x02000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(45, pause_); + } + if (((bitField0_ & 0x04000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(46, customLabel0_); + } + if (((bitField0_ & 0x08000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(47, customLabel1_); + } + if (((bitField0_ & 0x10000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(48, customLabel2_); + } + if (((bitField0_ & 0x20000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(49, customLabel3_); + } + if (((bitField0_ & 0x40000000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(50, customLabel4_); + } + 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.css.v1.Attributes)) { + return super.equals(obj); + } + com.google.shopping.css.v1.Attributes other = (com.google.shopping.css.v1.Attributes) obj; + + if (hasCppLink() != other.hasCppLink()) return false; + if (hasCppLink()) { + if (!getCppLink().equals(other.getCppLink())) return false; + } + if (hasCppMobileLink() != other.hasCppMobileLink()) return false; + if (hasCppMobileLink()) { + if (!getCppMobileLink().equals(other.getCppMobileLink())) return false; + } + if (hasCppAdsRedirect() != other.hasCppAdsRedirect()) return false; + if (hasCppAdsRedirect()) { + if (!getCppAdsRedirect().equals(other.getCppAdsRedirect())) return false; + } + if (hasLowPrice() != other.hasLowPrice()) return false; + if (hasLowPrice()) { + if (!getLowPrice().equals(other.getLowPrice())) return false; + } + if (hasHighPrice() != other.hasHighPrice()) return false; + if (hasHighPrice()) { + if (!getHighPrice().equals(other.getHighPrice())) return false; + } + if (hasNumberOfOffers() != other.hasNumberOfOffers()) return false; + if (hasNumberOfOffers()) { + if (getNumberOfOffers() != other.getNumberOfOffers()) return false; + } + if (hasHeadlineOfferCondition() != other.hasHeadlineOfferCondition()) return false; + if (hasHeadlineOfferCondition()) { + if (!getHeadlineOfferCondition().equals(other.getHeadlineOfferCondition())) return false; + } + if (hasHeadlineOfferPrice() != other.hasHeadlineOfferPrice()) return false; + if (hasHeadlineOfferPrice()) { + if (!getHeadlineOfferPrice().equals(other.getHeadlineOfferPrice())) return false; + } + if (hasHeadlineOfferLink() != other.hasHeadlineOfferLink()) return false; + if (hasHeadlineOfferLink()) { + if (!getHeadlineOfferLink().equals(other.getHeadlineOfferLink())) return false; + } + if (hasHeadlineOfferMobileLink() != other.hasHeadlineOfferMobileLink()) return false; + if (hasHeadlineOfferMobileLink()) { + if (!getHeadlineOfferMobileLink().equals(other.getHeadlineOfferMobileLink())) return false; + } + if (hasHeadlineOfferShippingPrice() != other.hasHeadlineOfferShippingPrice()) return false; + if (hasHeadlineOfferShippingPrice()) { + if (!getHeadlineOfferShippingPrice().equals(other.getHeadlineOfferShippingPrice())) + return false; + } + if (hasTitle() != other.hasTitle()) return false; + if (hasTitle()) { + if (!getTitle().equals(other.getTitle())) return false; + } + if (hasImageLink() != other.hasImageLink()) return false; + if (hasImageLink()) { + if (!getImageLink().equals(other.getImageLink())) return false; + } + if (!getAdditionalImageLinksList().equals(other.getAdditionalImageLinksList())) return false; + if (hasDescription() != other.hasDescription()) return false; + if (hasDescription()) { + if (!getDescription().equals(other.getDescription())) return false; + } + if (hasBrand() != other.hasBrand()) return false; + if (hasBrand()) { + if (!getBrand().equals(other.getBrand())) return false; + } + if (hasMpn() != other.hasMpn()) return false; + if (hasMpn()) { + if (!getMpn().equals(other.getMpn())) return false; + } + if (hasGtin() != other.hasGtin()) return false; + if (hasGtin()) { + if (!getGtin().equals(other.getGtin())) return false; + } + if (!getProductTypesList().equals(other.getProductTypesList())) return false; + if (hasGoogleProductCategory() != other.hasGoogleProductCategory()) return false; + if (hasGoogleProductCategory()) { + if (!getGoogleProductCategory().equals(other.getGoogleProductCategory())) return false; + } + if (hasAdult() != other.hasAdult()) return false; + if (hasAdult()) { + if (getAdult() != other.getAdult()) return false; + } + if (hasMultipack() != other.hasMultipack()) return false; + if (hasMultipack()) { + if (getMultipack() != other.getMultipack()) return false; + } + if (hasIsBundle() != other.hasIsBundle()) return false; + if (hasIsBundle()) { + if (getIsBundle() != other.getIsBundle()) return false; + } + if (hasAgeGroup() != other.hasAgeGroup()) return false; + if (hasAgeGroup()) { + if (!getAgeGroup().equals(other.getAgeGroup())) return false; + } + if (hasColor() != other.hasColor()) return false; + if (hasColor()) { + if (!getColor().equals(other.getColor())) return false; + } + if (hasGender() != other.hasGender()) return false; + if (hasGender()) { + if (!getGender().equals(other.getGender())) return false; + } + if (hasMaterial() != other.hasMaterial()) return false; + if (hasMaterial()) { + if (!getMaterial().equals(other.getMaterial())) return false; + } + if (hasPattern() != other.hasPattern()) return false; + if (hasPattern()) { + if (!getPattern().equals(other.getPattern())) return false; + } + if (hasSize() != other.hasSize()) return false; + if (hasSize()) { + if (!getSize().equals(other.getSize())) return false; + } + if (hasSizeSystem() != other.hasSizeSystem()) return false; + if (hasSizeSystem()) { + if (!getSizeSystem().equals(other.getSizeSystem())) return false; + } + if (!getSizeTypesList().equals(other.getSizeTypesList())) return false; + if (hasItemGroupId() != other.hasItemGroupId()) return false; + if (hasItemGroupId()) { + if (!getItemGroupId().equals(other.getItemGroupId())) return false; + } + if (!getProductDetailsList().equals(other.getProductDetailsList())) return false; + if (hasProductWeight() != other.hasProductWeight()) return false; + if (hasProductWeight()) { + if (!getProductWeight().equals(other.getProductWeight())) return false; + } + if (hasProductLength() != other.hasProductLength()) return false; + if (hasProductLength()) { + if (!getProductLength().equals(other.getProductLength())) return false; + } + if (hasProductWidth() != other.hasProductWidth()) return false; + if (hasProductWidth()) { + if (!getProductWidth().equals(other.getProductWidth())) return false; + } + if (hasProductHeight() != other.hasProductHeight()) return false; + if (hasProductHeight()) { + if (!getProductHeight().equals(other.getProductHeight())) return false; + } + if (!getProductHighlightsList().equals(other.getProductHighlightsList())) return false; + if (!getCertificationsList().equals(other.getCertificationsList())) return false; + if (hasExpirationDate() != other.hasExpirationDate()) return false; + if (hasExpirationDate()) { + if (!getExpirationDate().equals(other.getExpirationDate())) return false; + } + if (!getIncludedDestinationsList().equals(other.getIncludedDestinationsList())) return false; + if (!getExcludedDestinationsList().equals(other.getExcludedDestinationsList())) return false; + if (hasPause() != other.hasPause()) return false; + if (hasPause()) { + if (!getPause().equals(other.getPause())) return false; + } + if (hasCustomLabel0() != other.hasCustomLabel0()) return false; + if (hasCustomLabel0()) { + if (!getCustomLabel0().equals(other.getCustomLabel0())) return false; + } + if (hasCustomLabel1() != other.hasCustomLabel1()) return false; + if (hasCustomLabel1()) { + if (!getCustomLabel1().equals(other.getCustomLabel1())) return false; + } + if (hasCustomLabel2() != other.hasCustomLabel2()) return false; + if (hasCustomLabel2()) { + if (!getCustomLabel2().equals(other.getCustomLabel2())) return false; + } + if (hasCustomLabel3() != other.hasCustomLabel3()) return false; + if (hasCustomLabel3()) { + if (!getCustomLabel3().equals(other.getCustomLabel3())) return false; + } + if (hasCustomLabel4() != other.hasCustomLabel4()) return false; + if (hasCustomLabel4()) { + if (!getCustomLabel4().equals(other.getCustomLabel4())) 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 (hasCppLink()) { + hash = (37 * hash) + CPP_LINK_FIELD_NUMBER; + hash = (53 * hash) + getCppLink().hashCode(); + } + if (hasCppMobileLink()) { + hash = (37 * hash) + CPP_MOBILE_LINK_FIELD_NUMBER; + hash = (53 * hash) + getCppMobileLink().hashCode(); + } + if (hasCppAdsRedirect()) { + hash = (37 * hash) + CPP_ADS_REDIRECT_FIELD_NUMBER; + hash = (53 * hash) + getCppAdsRedirect().hashCode(); + } + if (hasLowPrice()) { + hash = (37 * hash) + LOW_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getLowPrice().hashCode(); + } + if (hasHighPrice()) { + hash = (37 * hash) + HIGH_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getHighPrice().hashCode(); + } + if (hasNumberOfOffers()) { + hash = (37 * hash) + NUMBER_OF_OFFERS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getNumberOfOffers()); + } + if (hasHeadlineOfferCondition()) { + hash = (37 * hash) + HEADLINE_OFFER_CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getHeadlineOfferCondition().hashCode(); + } + if (hasHeadlineOfferPrice()) { + hash = (37 * hash) + HEADLINE_OFFER_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getHeadlineOfferPrice().hashCode(); + } + if (hasHeadlineOfferLink()) { + hash = (37 * hash) + HEADLINE_OFFER_LINK_FIELD_NUMBER; + hash = (53 * hash) + getHeadlineOfferLink().hashCode(); + } + if (hasHeadlineOfferMobileLink()) { + hash = (37 * hash) + HEADLINE_OFFER_MOBILE_LINK_FIELD_NUMBER; + hash = (53 * hash) + getHeadlineOfferMobileLink().hashCode(); + } + if (hasHeadlineOfferShippingPrice()) { + hash = (37 * hash) + HEADLINE_OFFER_SHIPPING_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getHeadlineOfferShippingPrice().hashCode(); + } + if (hasTitle()) { + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + } + if (hasImageLink()) { + hash = (37 * hash) + IMAGE_LINK_FIELD_NUMBER; + hash = (53 * hash) + getImageLink().hashCode(); + } + if (getAdditionalImageLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_IMAGE_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalImageLinksList().hashCode(); + } + if (hasDescription()) { + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + } + if (hasBrand()) { + hash = (37 * hash) + BRAND_FIELD_NUMBER; + hash = (53 * hash) + getBrand().hashCode(); + } + if (hasMpn()) { + hash = (37 * hash) + MPN_FIELD_NUMBER; + hash = (53 * hash) + getMpn().hashCode(); + } + if (hasGtin()) { + hash = (37 * hash) + GTIN_FIELD_NUMBER; + hash = (53 * hash) + getGtin().hashCode(); + } + if (getProductTypesCount() > 0) { + hash = (37 * hash) + PRODUCT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getProductTypesList().hashCode(); + } + if (hasGoogleProductCategory()) { + hash = (37 * hash) + GOOGLE_PRODUCT_CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getGoogleProductCategory().hashCode(); + } + if (hasAdult()) { + hash = (37 * hash) + ADULT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAdult()); + } + if (hasMultipack()) { + hash = (37 * hash) + MULTIPACK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMultipack()); + } + if (hasIsBundle()) { + hash = (37 * hash) + IS_BUNDLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsBundle()); + } + if (hasAgeGroup()) { + hash = (37 * hash) + AGE_GROUP_FIELD_NUMBER; + hash = (53 * hash) + getAgeGroup().hashCode(); + } + if (hasColor()) { + hash = (37 * hash) + COLOR_FIELD_NUMBER; + hash = (53 * hash) + getColor().hashCode(); + } + if (hasGender()) { + hash = (37 * hash) + GENDER_FIELD_NUMBER; + hash = (53 * hash) + getGender().hashCode(); + } + if (hasMaterial()) { + hash = (37 * hash) + MATERIAL_FIELD_NUMBER; + hash = (53 * hash) + getMaterial().hashCode(); + } + if (hasPattern()) { + hash = (37 * hash) + PATTERN_FIELD_NUMBER; + hash = (53 * hash) + getPattern().hashCode(); + } + if (hasSize()) { + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + getSize().hashCode(); + } + if (hasSizeSystem()) { + hash = (37 * hash) + SIZE_SYSTEM_FIELD_NUMBER; + hash = (53 * hash) + getSizeSystem().hashCode(); + } + if (getSizeTypesCount() > 0) { + hash = (37 * hash) + SIZE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getSizeTypesList().hashCode(); + } + if (hasItemGroupId()) { + hash = (37 * hash) + ITEM_GROUP_ID_FIELD_NUMBER; + hash = (53 * hash) + getItemGroupId().hashCode(); + } + if (getProductDetailsCount() > 0) { + hash = (37 * hash) + PRODUCT_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getProductDetailsList().hashCode(); + } + if (hasProductWeight()) { + hash = (37 * hash) + PRODUCT_WEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getProductWeight().hashCode(); + } + if (hasProductLength()) { + hash = (37 * hash) + PRODUCT_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getProductLength().hashCode(); + } + if (hasProductWidth()) { + hash = (37 * hash) + PRODUCT_WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getProductWidth().hashCode(); + } + if (hasProductHeight()) { + hash = (37 * hash) + PRODUCT_HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getProductHeight().hashCode(); + } + if (getProductHighlightsCount() > 0) { + hash = (37 * hash) + PRODUCT_HIGHLIGHTS_FIELD_NUMBER; + hash = (53 * hash) + getProductHighlightsList().hashCode(); + } + if (getCertificationsCount() > 0) { + hash = (37 * hash) + CERTIFICATIONS_FIELD_NUMBER; + hash = (53 * hash) + getCertificationsList().hashCode(); + } + if (hasExpirationDate()) { + hash = (37 * hash) + EXPIRATION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getExpirationDate().hashCode(); + } + if (getIncludedDestinationsCount() > 0) { + hash = (37 * hash) + INCLUDED_DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getIncludedDestinationsList().hashCode(); + } + if (getExcludedDestinationsCount() > 0) { + hash = (37 * hash) + EXCLUDED_DESTINATIONS_FIELD_NUMBER; + hash = (53 * hash) + getExcludedDestinationsList().hashCode(); + } + if (hasPause()) { + hash = (37 * hash) + PAUSE_FIELD_NUMBER; + hash = (53 * hash) + getPause().hashCode(); + } + if (hasCustomLabel0()) { + hash = (37 * hash) + CUSTOM_LABEL_0_FIELD_NUMBER; + hash = (53 * hash) + getCustomLabel0().hashCode(); + } + if (hasCustomLabel1()) { + hash = (37 * hash) + CUSTOM_LABEL_1_FIELD_NUMBER; + hash = (53 * hash) + getCustomLabel1().hashCode(); + } + if (hasCustomLabel2()) { + hash = (37 * hash) + CUSTOM_LABEL_2_FIELD_NUMBER; + hash = (53 * hash) + getCustomLabel2().hashCode(); + } + if (hasCustomLabel3()) { + hash = (37 * hash) + CUSTOM_LABEL_3_FIELD_NUMBER; + hash = (53 * hash) + getCustomLabel3().hashCode(); + } + if (hasCustomLabel4()) { + hash = (37 * hash) + CUSTOM_LABEL_4_FIELD_NUMBER; + hash = (53 * hash) + getCustomLabel4().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.Attributes parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Attributes 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.css.v1.Attributes parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Attributes 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.css.v1.Attributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Attributes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.Attributes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Attributes 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.css.v1.Attributes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Attributes 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.css.v1.Attributes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Attributes 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.css.v1.Attributes 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; + } + /** + * + * + *
+   * Attributes for CSS Product.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.Attributes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.Attributes) + com.google.shopping.css.v1.AttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Attributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Attributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Attributes.class, + com.google.shopping.css.v1.Attributes.Builder.class); + } + + // Construct using com.google.shopping.css.v1.Attributes.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + bitField1_ = 0; + cppLink_ = ""; + cppMobileLink_ = ""; + cppAdsRedirect_ = ""; + lowPrice_ = null; + if (lowPriceBuilder_ != null) { + lowPriceBuilder_.dispose(); + lowPriceBuilder_ = null; + } + highPrice_ = null; + if (highPriceBuilder_ != null) { + highPriceBuilder_.dispose(); + highPriceBuilder_ = null; + } + numberOfOffers_ = 0L; + headlineOfferCondition_ = ""; + headlineOfferPrice_ = null; + if (headlineOfferPriceBuilder_ != null) { + headlineOfferPriceBuilder_.dispose(); + headlineOfferPriceBuilder_ = null; + } + headlineOfferLink_ = ""; + headlineOfferMobileLink_ = ""; + headlineOfferShippingPrice_ = null; + if (headlineOfferShippingPriceBuilder_ != null) { + headlineOfferShippingPriceBuilder_.dispose(); + headlineOfferShippingPriceBuilder_ = null; + } + title_ = ""; + imageLink_ = ""; + additionalImageLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + description_ = ""; + brand_ = ""; + mpn_ = ""; + gtin_ = ""; + productTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + googleProductCategory_ = ""; + adult_ = false; + multipack_ = 0L; + isBundle_ = false; + ageGroup_ = ""; + color_ = ""; + gender_ = ""; + material_ = ""; + pattern_ = ""; + size_ = ""; + sizeSystem_ = ""; + sizeTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + itemGroupId_ = ""; + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + } else { + productDetails_ = null; + productDetailsBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00000001); + productWeight_ = null; + if (productWeightBuilder_ != null) { + productWeightBuilder_.dispose(); + productWeightBuilder_ = null; + } + productLength_ = null; + if (productLengthBuilder_ != null) { + productLengthBuilder_.dispose(); + productLengthBuilder_ = null; + } + productWidth_ = null; + if (productWidthBuilder_ != null) { + productWidthBuilder_.dispose(); + productWidthBuilder_ = null; + } + productHeight_ = null; + if (productHeightBuilder_ != null) { + productHeightBuilder_.dispose(); + productHeightBuilder_ = null; + } + productHighlights_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (certificationsBuilder_ == null) { + certifications_ = java.util.Collections.emptyList(); + } else { + certifications_ = null; + certificationsBuilder_.clear(); + } + bitField1_ = (bitField1_ & ~0x00000040); + expirationDate_ = null; + if (expirationDateBuilder_ != null) { + expirationDateBuilder_.dispose(); + expirationDateBuilder_ = null; + } + includedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + excludedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pause_ = ""; + customLabel0_ = ""; + customLabel1_ = ""; + customLabel2_ = ""; + customLabel3_ = ""; + customLabel4_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Attributes_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.Attributes getDefaultInstanceForType() { + return com.google.shopping.css.v1.Attributes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.Attributes build() { + com.google.shopping.css.v1.Attributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.Attributes buildPartial() { + com.google.shopping.css.v1.Attributes result = + new com.google.shopping.css.v1.Attributes(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + if (bitField1_ != 0) { + buildPartial1(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.css.v1.Attributes result) { + if (productDetailsBuilder_ == null) { + if (((bitField1_ & 0x00000001) != 0)) { + productDetails_ = java.util.Collections.unmodifiableList(productDetails_); + bitField1_ = (bitField1_ & ~0x00000001); + } + result.productDetails_ = productDetails_; + } else { + result.productDetails_ = productDetailsBuilder_.build(); + } + if (certificationsBuilder_ == null) { + if (((bitField1_ & 0x00000040) != 0)) { + certifications_ = java.util.Collections.unmodifiableList(certifications_); + bitField1_ = (bitField1_ & ~0x00000040); + } + result.certifications_ = certifications_; + } else { + result.certifications_ = certificationsBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.Attributes result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cppLink_ = cppLink_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cppMobileLink_ = cppMobileLink_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cppAdsRedirect_ = cppAdsRedirect_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.lowPrice_ = lowPriceBuilder_ == null ? lowPrice_ : lowPriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.highPrice_ = highPriceBuilder_ == null ? highPrice_ : highPriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.numberOfOffers_ = numberOfOffers_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.headlineOfferCondition_ = headlineOfferCondition_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.headlineOfferPrice_ = + headlineOfferPriceBuilder_ == null + ? headlineOfferPrice_ + : headlineOfferPriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.headlineOfferLink_ = headlineOfferLink_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.headlineOfferMobileLink_ = headlineOfferMobileLink_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.headlineOfferShippingPrice_ = + headlineOfferShippingPriceBuilder_ == null + ? headlineOfferShippingPrice_ + : headlineOfferShippingPriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.title_ = title_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.imageLink_ = imageLink_; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + additionalImageLinks_.makeImmutable(); + result.additionalImageLinks_ = additionalImageLinks_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.description_ = description_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.brand_ = brand_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.mpn_ = mpn_; + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.gtin_ = gtin_; + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + productTypes_.makeImmutable(); + result.productTypes_ = productTypes_; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.googleProductCategory_ = googleProductCategory_; + to_bitField0_ |= 0x00002000; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.adult_ = adult_; + to_bitField0_ |= 0x00004000; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.multipack_ = multipack_; + to_bitField0_ |= 0x00008000; + } + if (((from_bitField0_ & 0x00400000) != 0)) { + result.isBundle_ = isBundle_; + to_bitField0_ |= 0x00010000; + } + if (((from_bitField0_ & 0x00800000) != 0)) { + result.ageGroup_ = ageGroup_; + to_bitField0_ |= 0x00020000; + } + if (((from_bitField0_ & 0x01000000) != 0)) { + result.color_ = color_; + to_bitField0_ |= 0x00040000; + } + if (((from_bitField0_ & 0x02000000) != 0)) { + result.gender_ = gender_; + to_bitField0_ |= 0x00080000; + } + if (((from_bitField0_ & 0x04000000) != 0)) { + result.material_ = material_; + to_bitField0_ |= 0x00100000; + } + if (((from_bitField0_ & 0x08000000) != 0)) { + result.pattern_ = pattern_; + to_bitField0_ |= 0x00200000; + } + if (((from_bitField0_ & 0x10000000) != 0)) { + result.size_ = size_; + to_bitField0_ |= 0x00400000; + } + if (((from_bitField0_ & 0x20000000) != 0)) { + result.sizeSystem_ = sizeSystem_; + to_bitField0_ |= 0x00800000; + } + if (((from_bitField0_ & 0x40000000) != 0)) { + sizeTypes_.makeImmutable(); + result.sizeTypes_ = sizeTypes_; + } + if (((from_bitField0_ & 0x80000000) != 0)) { + result.itemGroupId_ = itemGroupId_; + to_bitField0_ |= 0x01000000; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartial1(com.google.shopping.css.v1.Attributes result) { + int from_bitField1_ = bitField1_; + if (((from_bitField1_ & 0x00000002) != 0)) { + result.productWeight_ = + productWeightBuilder_ == null ? productWeight_ : productWeightBuilder_.build(); + } + if (((from_bitField1_ & 0x00000004) != 0)) { + result.productLength_ = + productLengthBuilder_ == null ? productLength_ : productLengthBuilder_.build(); + } + if (((from_bitField1_ & 0x00000008) != 0)) { + result.productWidth_ = + productWidthBuilder_ == null ? productWidth_ : productWidthBuilder_.build(); + } + if (((from_bitField1_ & 0x00000010) != 0)) { + result.productHeight_ = + productHeightBuilder_ == null ? productHeight_ : productHeightBuilder_.build(); + } + if (((from_bitField1_ & 0x00000020) != 0)) { + productHighlights_.makeImmutable(); + result.productHighlights_ = productHighlights_; + } + if (((from_bitField1_ & 0x00000080) != 0)) { + result.expirationDate_ = + expirationDateBuilder_ == null ? expirationDate_ : expirationDateBuilder_.build(); + } + if (((from_bitField1_ & 0x00000100) != 0)) { + includedDestinations_.makeImmutable(); + result.includedDestinations_ = includedDestinations_; + } + if (((from_bitField1_ & 0x00000200) != 0)) { + excludedDestinations_.makeImmutable(); + result.excludedDestinations_ = excludedDestinations_; + } + int to_bitField0_ = 0; + if (((from_bitField1_ & 0x00000400) != 0)) { + result.pause_ = pause_; + to_bitField0_ |= 0x02000000; + } + if (((from_bitField1_ & 0x00000800) != 0)) { + result.customLabel0_ = customLabel0_; + to_bitField0_ |= 0x04000000; + } + if (((from_bitField1_ & 0x00001000) != 0)) { + result.customLabel1_ = customLabel1_; + to_bitField0_ |= 0x08000000; + } + if (((from_bitField1_ & 0x00002000) != 0)) { + result.customLabel2_ = customLabel2_; + to_bitField0_ |= 0x10000000; + } + if (((from_bitField1_ & 0x00004000) != 0)) { + result.customLabel3_ = customLabel3_; + to_bitField0_ |= 0x20000000; + } + if (((from_bitField1_ & 0x00008000) != 0)) { + result.customLabel4_ = customLabel4_; + to_bitField0_ |= 0x40000000; + } + 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.css.v1.Attributes) { + return mergeFrom((com.google.shopping.css.v1.Attributes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.Attributes other) { + if (other == com.google.shopping.css.v1.Attributes.getDefaultInstance()) return this; + if (other.hasCppLink()) { + cppLink_ = other.cppLink_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCppMobileLink()) { + cppMobileLink_ = other.cppMobileLink_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCppAdsRedirect()) { + cppAdsRedirect_ = other.cppAdsRedirect_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasLowPrice()) { + mergeLowPrice(other.getLowPrice()); + } + if (other.hasHighPrice()) { + mergeHighPrice(other.getHighPrice()); + } + if (other.hasNumberOfOffers()) { + setNumberOfOffers(other.getNumberOfOffers()); + } + if (other.hasHeadlineOfferCondition()) { + headlineOfferCondition_ = other.headlineOfferCondition_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasHeadlineOfferPrice()) { + mergeHeadlineOfferPrice(other.getHeadlineOfferPrice()); + } + if (other.hasHeadlineOfferLink()) { + headlineOfferLink_ = other.headlineOfferLink_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasHeadlineOfferMobileLink()) { + headlineOfferMobileLink_ = other.headlineOfferMobileLink_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasHeadlineOfferShippingPrice()) { + mergeHeadlineOfferShippingPrice(other.getHeadlineOfferShippingPrice()); + } + if (other.hasTitle()) { + title_ = other.title_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (other.hasImageLink()) { + imageLink_ = other.imageLink_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.additionalImageLinks_.isEmpty()) { + if (additionalImageLinks_.isEmpty()) { + additionalImageLinks_ = other.additionalImageLinks_; + bitField0_ |= 0x00002000; + } else { + ensureAdditionalImageLinksIsMutable(); + additionalImageLinks_.addAll(other.additionalImageLinks_); + } + onChanged(); + } + if (other.hasDescription()) { + description_ = other.description_; + bitField0_ |= 0x00004000; + onChanged(); + } + if (other.hasBrand()) { + brand_ = other.brand_; + bitField0_ |= 0x00008000; + onChanged(); + } + if (other.hasMpn()) { + mpn_ = other.mpn_; + bitField0_ |= 0x00010000; + onChanged(); + } + if (other.hasGtin()) { + gtin_ = other.gtin_; + bitField0_ |= 0x00020000; + onChanged(); + } + if (!other.productTypes_.isEmpty()) { + if (productTypes_.isEmpty()) { + productTypes_ = other.productTypes_; + bitField0_ |= 0x00040000; + } else { + ensureProductTypesIsMutable(); + productTypes_.addAll(other.productTypes_); + } + onChanged(); + } + if (other.hasGoogleProductCategory()) { + googleProductCategory_ = other.googleProductCategory_; + bitField0_ |= 0x00080000; + onChanged(); + } + if (other.hasAdult()) { + setAdult(other.getAdult()); + } + if (other.hasMultipack()) { + setMultipack(other.getMultipack()); + } + if (other.hasIsBundle()) { + setIsBundle(other.getIsBundle()); + } + if (other.hasAgeGroup()) { + ageGroup_ = other.ageGroup_; + bitField0_ |= 0x00800000; + onChanged(); + } + if (other.hasColor()) { + color_ = other.color_; + bitField0_ |= 0x01000000; + onChanged(); + } + if (other.hasGender()) { + gender_ = other.gender_; + bitField0_ |= 0x02000000; + onChanged(); + } + if (other.hasMaterial()) { + material_ = other.material_; + bitField0_ |= 0x04000000; + onChanged(); + } + if (other.hasPattern()) { + pattern_ = other.pattern_; + bitField0_ |= 0x08000000; + onChanged(); + } + if (other.hasSize()) { + size_ = other.size_; + bitField0_ |= 0x10000000; + onChanged(); + } + if (other.hasSizeSystem()) { + sizeSystem_ = other.sizeSystem_; + bitField0_ |= 0x20000000; + onChanged(); + } + if (!other.sizeTypes_.isEmpty()) { + if (sizeTypes_.isEmpty()) { + sizeTypes_ = other.sizeTypes_; + bitField0_ |= 0x40000000; + } else { + ensureSizeTypesIsMutable(); + sizeTypes_.addAll(other.sizeTypes_); + } + onChanged(); + } + if (other.hasItemGroupId()) { + itemGroupId_ = other.itemGroupId_; + bitField0_ |= 0x80000000; + onChanged(); + } + if (productDetailsBuilder_ == null) { + if (!other.productDetails_.isEmpty()) { + if (productDetails_.isEmpty()) { + productDetails_ = other.productDetails_; + bitField1_ = (bitField1_ & ~0x00000001); + } else { + ensureProductDetailsIsMutable(); + productDetails_.addAll(other.productDetails_); + } + onChanged(); + } + } else { + if (!other.productDetails_.isEmpty()) { + if (productDetailsBuilder_.isEmpty()) { + productDetailsBuilder_.dispose(); + productDetailsBuilder_ = null; + productDetails_ = other.productDetails_; + bitField1_ = (bitField1_ & ~0x00000001); + productDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProductDetailsFieldBuilder() + : null; + } else { + productDetailsBuilder_.addAllMessages(other.productDetails_); + } + } + } + if (other.hasProductWeight()) { + mergeProductWeight(other.getProductWeight()); + } + if (other.hasProductLength()) { + mergeProductLength(other.getProductLength()); + } + if (other.hasProductWidth()) { + mergeProductWidth(other.getProductWidth()); + } + if (other.hasProductHeight()) { + mergeProductHeight(other.getProductHeight()); + } + if (!other.productHighlights_.isEmpty()) { + if (productHighlights_.isEmpty()) { + productHighlights_ = other.productHighlights_; + bitField1_ |= 0x00000020; + } else { + ensureProductHighlightsIsMutable(); + productHighlights_.addAll(other.productHighlights_); + } + onChanged(); + } + if (certificationsBuilder_ == null) { + if (!other.certifications_.isEmpty()) { + if (certifications_.isEmpty()) { + certifications_ = other.certifications_; + bitField1_ = (bitField1_ & ~0x00000040); + } else { + ensureCertificationsIsMutable(); + certifications_.addAll(other.certifications_); + } + onChanged(); + } + } else { + if (!other.certifications_.isEmpty()) { + if (certificationsBuilder_.isEmpty()) { + certificationsBuilder_.dispose(); + certificationsBuilder_ = null; + certifications_ = other.certifications_; + bitField1_ = (bitField1_ & ~0x00000040); + certificationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCertificationsFieldBuilder() + : null; + } else { + certificationsBuilder_.addAllMessages(other.certifications_); + } + } + } + if (other.hasExpirationDate()) { + mergeExpirationDate(other.getExpirationDate()); + } + if (!other.includedDestinations_.isEmpty()) { + if (includedDestinations_.isEmpty()) { + includedDestinations_ = other.includedDestinations_; + bitField1_ |= 0x00000100; + } else { + ensureIncludedDestinationsIsMutable(); + includedDestinations_.addAll(other.includedDestinations_); + } + onChanged(); + } + if (!other.excludedDestinations_.isEmpty()) { + if (excludedDestinations_.isEmpty()) { + excludedDestinations_ = other.excludedDestinations_; + bitField1_ |= 0x00000200; + } else { + ensureExcludedDestinationsIsMutable(); + excludedDestinations_.addAll(other.excludedDestinations_); + } + onChanged(); + } + if (other.hasPause()) { + pause_ = other.pause_; + bitField1_ |= 0x00000400; + onChanged(); + } + if (other.hasCustomLabel0()) { + customLabel0_ = other.customLabel0_; + bitField1_ |= 0x00000800; + onChanged(); + } + if (other.hasCustomLabel1()) { + customLabel1_ = other.customLabel1_; + bitField1_ |= 0x00001000; + onChanged(); + } + if (other.hasCustomLabel2()) { + customLabel2_ = other.customLabel2_; + bitField1_ |= 0x00002000; + onChanged(); + } + if (other.hasCustomLabel3()) { + customLabel3_ = other.customLabel3_; + bitField1_ |= 0x00004000; + onChanged(); + } + if (other.hasCustomLabel4()) { + customLabel4_ = other.customLabel4_; + bitField1_ |= 0x00008000; + 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: + { + cppLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + cppMobileLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getLowPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(getHighPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 40: + { + numberOfOffers_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 40 + case 50: + { + headlineOfferCondition_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + input.readMessage( + getHeadlineOfferPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + headlineOfferLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + headlineOfferMobileLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + title_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 82 + case 90: + { + imageLink_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 90 + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalImageLinksIsMutable(); + additionalImageLinks_.add(s); + break; + } // case 98 + case 106: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 106 + case 114: + { + brand_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 114 + case 122: + { + mpn_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00010000; + break; + } // case 122 + case 130: + { + gtin_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 130 + case 138: + { + googleProductCategory_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00080000; + break; + } // case 138 + case 144: + { + adult_ = input.readBool(); + bitField0_ |= 0x00100000; + break; + } // case 144 + case 152: + { + multipack_ = input.readInt64(); + bitField0_ |= 0x00200000; + break; + } // case 152 + case 160: + { + isBundle_ = input.readBool(); + bitField0_ |= 0x00400000; + break; + } // case 160 + case 170: + { + ageGroup_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00800000; + break; + } // case 170 + case 178: + { + color_ = input.readStringRequireUtf8(); + bitField0_ |= 0x01000000; + break; + } // case 178 + case 186: + { + gender_ = input.readStringRequireUtf8(); + bitField0_ |= 0x02000000; + break; + } // case 186 + case 194: + { + material_ = input.readStringRequireUtf8(); + bitField0_ |= 0x04000000; + break; + } // case 194 + case 202: + { + pattern_ = input.readStringRequireUtf8(); + bitField0_ |= 0x08000000; + break; + } // case 202 + case 210: + { + size_ = input.readStringRequireUtf8(); + bitField0_ |= 0x10000000; + break; + } // case 210 + case 218: + { + sizeSystem_ = input.readStringRequireUtf8(); + bitField0_ |= 0x20000000; + break; + } // case 218 + case 226: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureSizeTypesIsMutable(); + sizeTypes_.add(s); + break; + } // case 226 + case 234: + { + itemGroupId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x80000000; + break; + } // case 234 + case 242: + { + com.google.shopping.css.v1.ProductDetail m = + input.readMessage( + com.google.shopping.css.v1.ProductDetail.parser(), extensionRegistry); + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(m); + } else { + productDetailsBuilder_.addMessage(m); + } + break; + } // case 242 + case 250: + { + input.readMessage(getProductWeightFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000002; + break; + } // case 250 + case 258: + { + input.readMessage(getProductLengthFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000004; + break; + } // case 258 + case 266: + { + input.readMessage(getProductWidthFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000008; + break; + } // case 266 + case 274: + { + input.readMessage(getProductHeightFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000010; + break; + } // case 274 + case 282: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureProductHighlightsIsMutable(); + productHighlights_.add(s); + break; + } // case 282 + case 290: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureProductTypesIsMutable(); + productTypes_.add(s); + break; + } // case 290 + case 314: + { + com.google.shopping.css.v1.Certification m = + input.readMessage( + com.google.shopping.css.v1.Certification.parser(), extensionRegistry); + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + certifications_.add(m); + } else { + certificationsBuilder_.addMessage(m); + } + break; + } // case 314 + case 322: + { + input.readMessage(getExpirationDateFieldBuilder().getBuilder(), extensionRegistry); + bitField1_ |= 0x00000080; + break; + } // case 322 + case 330: + { + input.readMessage( + getHeadlineOfferShippingPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 330 + case 338: + { + cppAdsRedirect_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 338 + case 346: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIncludedDestinationsIsMutable(); + includedDestinations_.add(s); + break; + } // case 346 + case 354: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureExcludedDestinationsIsMutable(); + excludedDestinations_.add(s); + break; + } // case 354 + case 362: + { + pause_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000400; + break; + } // case 362 + case 370: + { + customLabel0_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00000800; + break; + } // case 370 + case 378: + { + customLabel1_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00001000; + break; + } // case 378 + case 386: + { + customLabel2_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00002000; + break; + } // case 386 + case 394: + { + customLabel3_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00004000; + break; + } // case 394 + case 402: + { + customLabel4_ = input.readStringRequireUtf8(); + bitField1_ |= 0x00008000; + break; + } // case 402 + 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 bitField1_; + + private java.lang.Object cppLink_ = ""; + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @return Whether the cppLink field is set. + */ + public boolean hasCppLink() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @return The cppLink. + */ + public java.lang.String getCppLink() { + java.lang.Object ref = cppLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cppLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @return The bytes for cppLink. + */ + public com.google.protobuf.ByteString getCppLinkBytes() { + java.lang.Object ref = cppLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @param value The cppLink to set. + * @return This builder for chaining. + */ + public Builder setCppLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cppLink_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @return This builder for chaining. + */ + public Builder clearCppLink() { + cppLink_ = getDefaultInstance().getCppLink(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * URL directly linking to your the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_link = 1; + * + * @param value The bytes for cppLink to set. + * @return This builder for chaining. + */ + public Builder setCppLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cppLink_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object cppMobileLink_ = ""; + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return Whether the cppMobileLink field is set. + */ + public boolean hasCppMobileLink() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The cppMobileLink. + */ + public java.lang.String getCppMobileLink() { + java.lang.Object ref = cppMobileLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cppMobileLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The bytes for cppMobileLink. + */ + public com.google.protobuf.ByteString getCppMobileLinkBytes() { + java.lang.Object ref = cppMobileLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppMobileLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @param value The cppMobileLink to set. + * @return This builder for chaining. + */ + public Builder setCppMobileLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cppMobileLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return This builder for chaining. + */ + public Builder clearCppMobileLink() { + cppMobileLink_ = getDefaultInstance().getCppMobileLink(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+     * 
+ * + * optional string cpp_mobile_link = 2; + * + * @param value The bytes for cppMobileLink to set. + * @return This builder for chaining. + */ + public Builder setCppMobileLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cppMobileLink_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object cppAdsRedirect_ = ""; + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return Whether the cppAdsRedirect field is set. + */ + public boolean hasCppAdsRedirect() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The cppAdsRedirect. + */ + public java.lang.String getCppAdsRedirect() { + java.lang.Object ref = cppAdsRedirect_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cppAdsRedirect_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The bytes for cppAdsRedirect. + */ + public com.google.protobuf.ByteString getCppAdsRedirectBytes() { + java.lang.Object ref = cppAdsRedirect_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cppAdsRedirect_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @param value The cppAdsRedirect to set. + * @return This builder for chaining. + */ + public Builder setCppAdsRedirect(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cppAdsRedirect_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return This builder for chaining. + */ + public Builder clearCppAdsRedirect() { + cppAdsRedirect_ = getDefaultInstance().getCppAdsRedirect(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Allows advertisers to override the item URL when the product is shown
+     * within the context of Product Ads.
+     * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @param value The bytes for cppAdsRedirect to set. + * @return This builder for chaining. + */ + public Builder setCppAdsRedirectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cppAdsRedirect_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.shopping.type.Price lowPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + lowPriceBuilder_; + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return Whether the lowPrice field is set. + */ + public boolean hasLowPrice() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return The lowPrice. + */ + public com.google.shopping.type.Price getLowPrice() { + if (lowPriceBuilder_ == null) { + return lowPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : lowPrice_; + } else { + return lowPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public Builder setLowPrice(com.google.shopping.type.Price value) { + if (lowPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lowPrice_ = value; + } else { + lowPriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public Builder setLowPrice(com.google.shopping.type.Price.Builder builderForValue) { + if (lowPriceBuilder_ == null) { + lowPrice_ = builderForValue.build(); + } else { + lowPriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public Builder mergeLowPrice(com.google.shopping.type.Price value) { + if (lowPriceBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && lowPrice_ != null + && lowPrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getLowPriceBuilder().mergeFrom(value); + } else { + lowPrice_ = value; + } + } else { + lowPriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public Builder clearLowPrice() { + bitField0_ = (bitField0_ & ~0x00000008); + lowPrice_ = null; + if (lowPriceBuilder_ != null) { + lowPriceBuilder_.dispose(); + lowPriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public com.google.shopping.type.Price.Builder getLowPriceBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getLowPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + public com.google.shopping.type.PriceOrBuilder getLowPriceOrBuilder() { + if (lowPriceBuilder_ != null) { + return lowPriceBuilder_.getMessageOrBuilder(); + } else { + return lowPrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : lowPrice_; + } + } + /** + * + * + *
+     * Low Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getLowPriceFieldBuilder() { + if (lowPriceBuilder_ == null) { + lowPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getLowPrice(), getParentForChildren(), isClean()); + lowPrice_ = null; + } + return lowPriceBuilder_; + } + + private com.google.shopping.type.Price highPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + highPriceBuilder_; + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return Whether the highPrice field is set. + */ + public boolean hasHighPrice() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return The highPrice. + */ + public com.google.shopping.type.Price getHighPrice() { + if (highPriceBuilder_ == null) { + return highPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : highPrice_; + } else { + return highPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public Builder setHighPrice(com.google.shopping.type.Price value) { + if (highPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + highPrice_ = value; + } else { + highPriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public Builder setHighPrice(com.google.shopping.type.Price.Builder builderForValue) { + if (highPriceBuilder_ == null) { + highPrice_ = builderForValue.build(); + } else { + highPriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public Builder mergeHighPrice(com.google.shopping.type.Price value) { + if (highPriceBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && highPrice_ != null + && highPrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getHighPriceBuilder().mergeFrom(value); + } else { + highPrice_ = value; + } + } else { + highPriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public Builder clearHighPrice() { + bitField0_ = (bitField0_ & ~0x00000010); + highPrice_ = null; + if (highPriceBuilder_ != null) { + highPriceBuilder_.dispose(); + highPriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public com.google.shopping.type.Price.Builder getHighPriceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getHighPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + public com.google.shopping.type.PriceOrBuilder getHighPriceOrBuilder() { + if (highPriceBuilder_ != null) { + return highPriceBuilder_.getMessageOrBuilder(); + } else { + return highPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : highPrice_; + } + } + /** + * + * + *
+     * High Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getHighPriceFieldBuilder() { + if (highPriceBuilder_ == null) { + highPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getHighPrice(), getParentForChildren(), isClean()); + highPrice_ = null; + } + return highPriceBuilder_; + } + + private long numberOfOffers_; + /** + * + * + *
+     * The number of aggregate offers.
+     * 
+ * + * optional int64 number_of_offers = 5; + * + * @return Whether the numberOfOffers field is set. + */ + @java.lang.Override + public boolean hasNumberOfOffers() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The number of aggregate offers.
+     * 
+ * + * optional int64 number_of_offers = 5; + * + * @return The numberOfOffers. + */ + @java.lang.Override + public long getNumberOfOffers() { + return numberOfOffers_; + } + /** + * + * + *
+     * The number of aggregate offers.
+     * 
+ * + * optional int64 number_of_offers = 5; + * + * @param value The numberOfOffers to set. + * @return This builder for chaining. + */ + public Builder setNumberOfOffers(long value) { + + numberOfOffers_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of aggregate offers.
+     * 
+ * + * optional int64 number_of_offers = 5; + * + * @return This builder for chaining. + */ + public Builder clearNumberOfOffers() { + bitField0_ = (bitField0_ & ~0x00000020); + numberOfOffers_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object headlineOfferCondition_ = ""; + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @return Whether the headlineOfferCondition field is set. + */ + public boolean hasHeadlineOfferCondition() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The headlineOfferCondition. + */ + public java.lang.String getHeadlineOfferCondition() { + java.lang.Object ref = headlineOfferCondition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headlineOfferCondition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The bytes for headlineOfferCondition. + */ + public com.google.protobuf.ByteString getHeadlineOfferConditionBytes() { + java.lang.Object ref = headlineOfferCondition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferCondition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @param value The headlineOfferCondition to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + headlineOfferCondition_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @return This builder for chaining. + */ + public Builder clearHeadlineOfferCondition() { + headlineOfferCondition_ = getDefaultInstance().getHeadlineOfferCondition(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Condition of the headline offer.
+     * 
+ * + * optional string headline_offer_condition = 6; + * + * @param value The bytes for headlineOfferCondition to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + headlineOfferCondition_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.shopping.type.Price headlineOfferPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + headlineOfferPriceBuilder_; + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return Whether the headlineOfferPrice field is set. + */ + public boolean hasHeadlineOfferPrice() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return The headlineOfferPrice. + */ + public com.google.shopping.type.Price getHeadlineOfferPrice() { + if (headlineOfferPriceBuilder_ == null) { + return headlineOfferPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferPrice_; + } else { + return headlineOfferPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public Builder setHeadlineOfferPrice(com.google.shopping.type.Price value) { + if (headlineOfferPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + headlineOfferPrice_ = value; + } else { + headlineOfferPriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public Builder setHeadlineOfferPrice(com.google.shopping.type.Price.Builder builderForValue) { + if (headlineOfferPriceBuilder_ == null) { + headlineOfferPrice_ = builderForValue.build(); + } else { + headlineOfferPriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public Builder mergeHeadlineOfferPrice(com.google.shopping.type.Price value) { + if (headlineOfferPriceBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && headlineOfferPrice_ != null + && headlineOfferPrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getHeadlineOfferPriceBuilder().mergeFrom(value); + } else { + headlineOfferPrice_ = value; + } + } else { + headlineOfferPriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public Builder clearHeadlineOfferPrice() { + bitField0_ = (bitField0_ & ~0x00000080); + headlineOfferPrice_ = null; + if (headlineOfferPriceBuilder_ != null) { + headlineOfferPriceBuilder_.dispose(); + headlineOfferPriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public com.google.shopping.type.Price.Builder getHeadlineOfferPriceBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getHeadlineOfferPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + public com.google.shopping.type.PriceOrBuilder getHeadlineOfferPriceOrBuilder() { + if (headlineOfferPriceBuilder_ != null) { + return headlineOfferPriceBuilder_.getMessageOrBuilder(); + } else { + return headlineOfferPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferPrice_; + } + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getHeadlineOfferPriceFieldBuilder() { + if (headlineOfferPriceBuilder_ == null) { + headlineOfferPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getHeadlineOfferPrice(), getParentForChildren(), isClean()); + headlineOfferPrice_ = null; + } + return headlineOfferPriceBuilder_; + } + + private java.lang.Object headlineOfferLink_ = ""; + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @return Whether the headlineOfferLink field is set. + */ + public boolean hasHeadlineOfferLink() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @return The headlineOfferLink. + */ + public java.lang.String getHeadlineOfferLink() { + java.lang.Object ref = headlineOfferLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headlineOfferLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @return The bytes for headlineOfferLink. + */ + public com.google.protobuf.ByteString getHeadlineOfferLinkBytes() { + java.lang.Object ref = headlineOfferLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @param value The headlineOfferLink to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + headlineOfferLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @return This builder for chaining. + */ + public Builder clearHeadlineOfferLink() { + headlineOfferLink_ = getDefaultInstance().getHeadlineOfferLink(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the headline offer.
+     * 
+ * + * optional string headline_offer_link = 8; + * + * @param value The bytes for headlineOfferLink to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + headlineOfferLink_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object headlineOfferMobileLink_ = ""; + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return Whether the headlineOfferMobileLink field is set. + */ + public boolean hasHeadlineOfferMobileLink() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The headlineOfferMobileLink. + */ + public java.lang.String getHeadlineOfferMobileLink() { + java.lang.Object ref = headlineOfferMobileLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + headlineOfferMobileLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The bytes for headlineOfferMobileLink. + */ + public com.google.protobuf.ByteString getHeadlineOfferMobileLinkBytes() { + java.lang.Object ref = headlineOfferMobileLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + headlineOfferMobileLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @param value The headlineOfferMobileLink to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferMobileLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + headlineOfferMobileLink_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return This builder for chaining. + */ + public Builder clearHeadlineOfferMobileLink() { + headlineOfferMobileLink_ = getDefaultInstance().getHeadlineOfferMobileLink(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Mobile Link to the headline offer.
+     * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @param value The bytes for headlineOfferMobileLink to set. + * @return This builder for chaining. + */ + public Builder setHeadlineOfferMobileLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + headlineOfferMobileLink_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private com.google.shopping.type.Price headlineOfferShippingPrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + headlineOfferShippingPriceBuilder_; + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return Whether the headlineOfferShippingPrice field is set. + */ + public boolean hasHeadlineOfferShippingPrice() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return The headlineOfferShippingPrice. + */ + public com.google.shopping.type.Price getHeadlineOfferShippingPrice() { + if (headlineOfferShippingPriceBuilder_ == null) { + return headlineOfferShippingPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferShippingPrice_; + } else { + return headlineOfferShippingPriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public Builder setHeadlineOfferShippingPrice(com.google.shopping.type.Price value) { + if (headlineOfferShippingPriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + headlineOfferShippingPrice_ = value; + } else { + headlineOfferShippingPriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public Builder setHeadlineOfferShippingPrice( + com.google.shopping.type.Price.Builder builderForValue) { + if (headlineOfferShippingPriceBuilder_ == null) { + headlineOfferShippingPrice_ = builderForValue.build(); + } else { + headlineOfferShippingPriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public Builder mergeHeadlineOfferShippingPrice(com.google.shopping.type.Price value) { + if (headlineOfferShippingPriceBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && headlineOfferShippingPrice_ != null + && headlineOfferShippingPrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getHeadlineOfferShippingPriceBuilder().mergeFrom(value); + } else { + headlineOfferShippingPrice_ = value; + } + } else { + headlineOfferShippingPriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public Builder clearHeadlineOfferShippingPrice() { + bitField0_ = (bitField0_ & ~0x00000400); + headlineOfferShippingPrice_ = null; + if (headlineOfferShippingPriceBuilder_ != null) { + headlineOfferShippingPriceBuilder_.dispose(); + headlineOfferShippingPriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public com.google.shopping.type.Price.Builder getHeadlineOfferShippingPriceBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getHeadlineOfferShippingPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + public com.google.shopping.type.PriceOrBuilder getHeadlineOfferShippingPriceOrBuilder() { + if (headlineOfferShippingPriceBuilder_ != null) { + return headlineOfferShippingPriceBuilder_.getMessageOrBuilder(); + } else { + return headlineOfferShippingPrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : headlineOfferShippingPrice_; + } + } + /** + * + * + *
+     * Headline Price of the aggregate offer.
+     * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getHeadlineOfferShippingPriceFieldBuilder() { + if (headlineOfferShippingPriceBuilder_ == null) { + headlineOfferShippingPriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getHeadlineOfferShippingPrice(), getParentForChildren(), isClean()); + headlineOfferShippingPrice_ = null; + } + return headlineOfferShippingPriceBuilder_; + } + + private java.lang.Object title_ = ""; + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @return Whether the title field is set. + */ + public boolean hasTitle() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @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; + } + } + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @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; + } + } + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @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_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { + title_ = getDefaultInstance().getTitle(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Title of the item.
+     * 
+ * + * optional string title = 10; + * + * @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_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object imageLink_ = ""; + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @return Whether the imageLink field is set. + */ + public boolean hasImageLink() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @return The imageLink. + */ + public java.lang.String getImageLink() { + java.lang.Object ref = imageLink_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + imageLink_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @return The bytes for imageLink. + */ + public com.google.protobuf.ByteString getImageLinkBytes() { + java.lang.Object ref = imageLink_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + imageLink_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @param value The imageLink to set. + * @return This builder for chaining. + */ + public Builder setImageLink(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + imageLink_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @return This builder for chaining. + */ + public Builder clearImageLink() { + imageLink_ = getDefaultInstance().getImageLink(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * URL of an image of the item.
+     * 
+ * + * optional string image_link = 11; + * + * @param value The bytes for imageLink to set. + * @return This builder for chaining. + */ + public Builder setImageLinkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + imageLink_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList additionalImageLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAdditionalImageLinksIsMutable() { + if (!additionalImageLinks_.isModifiable()) { + additionalImageLinks_ = new com.google.protobuf.LazyStringArrayList(additionalImageLinks_); + } + bitField0_ |= 0x00002000; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @return A list containing the additionalImageLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalImageLinksList() { + additionalImageLinks_.makeImmutable(); + return additionalImageLinks_; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @return The count of additionalImageLinks. + */ + public int getAdditionalImageLinksCount() { + return additionalImageLinks_.size(); + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the element to return. + * @return The additionalImageLinks at the given index. + */ + public java.lang.String getAdditionalImageLinks(int index) { + return additionalImageLinks_.get(index); + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the value to return. + * @return The bytes of the additionalImageLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalImageLinksBytes(int index) { + return additionalImageLinks_.getByteString(index); + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index to set the value at. + * @param value The additionalImageLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalImageLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalImageLinksIsMutable(); + additionalImageLinks_.set(index, value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param value The additionalImageLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalImageLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalImageLinksIsMutable(); + additionalImageLinks_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param values The additionalImageLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalImageLinks(java.lang.Iterable values) { + ensureAdditionalImageLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalImageLinks_); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalImageLinks() { + additionalImageLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Additional URL of images of the item.
+     * 
+ * + * repeated string additional_image_links = 12; + * + * @param value The bytes of the additionalImageLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalImageLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalImageLinksIsMutable(); + additionalImageLinks_.add(value); + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @return Whether the description field is set. + */ + public boolean hasDescription() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @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; + } + } + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @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; + } + } + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the item.
+     * 
+ * + * optional string description = 13; + * + * @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_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object brand_ = ""; + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @return Whether the brand field is set. + */ + public boolean hasBrand() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @return The brand. + */ + public java.lang.String getBrand() { + java.lang.Object ref = brand_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + brand_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @return The bytes for brand. + */ + public com.google.protobuf.ByteString getBrandBytes() { + java.lang.Object ref = brand_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + brand_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @param value The brand to set. + * @return This builder for chaining. + */ + public Builder setBrand(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + brand_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @return This builder for chaining. + */ + public Builder clearBrand() { + brand_ = getDefaultInstance().getBrand(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * Product Related Attributes.[14-36]
+     * Brand of the item.
+     * 
+ * + * optional string brand = 14; + * + * @param value The bytes for brand to set. + * @return This builder for chaining. + */ + public Builder setBrandBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + brand_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private java.lang.Object mpn_ = ""; + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @return Whether the mpn field is set. + */ + public boolean hasMpn() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @return The mpn. + */ + public java.lang.String getMpn() { + java.lang.Object ref = mpn_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mpn_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @return The bytes for mpn. + */ + public com.google.protobuf.ByteString getMpnBytes() { + java.lang.Object ref = mpn_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mpn_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @param value The mpn to set. + * @return This builder for chaining. + */ + public Builder setMpn(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + mpn_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @return This builder for chaining. + */ + public Builder clearMpn() { + mpn_ = getDefaultInstance().getMpn(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + /** + * + * + *
+     * Manufacturer Part Number
+     * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+     * item.
+     * 
+ * + * optional string mpn = 15; + * + * @param value The bytes for mpn to set. + * @return This builder for chaining. + */ + public Builder setMpnBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + mpn_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + private java.lang.Object gtin_ = ""; + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @return Whether the gtin field is set. + */ + public boolean hasGtin() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @return The gtin. + */ + public java.lang.String getGtin() { + java.lang.Object ref = gtin_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gtin_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @return The bytes for gtin. + */ + public com.google.protobuf.ByteString getGtinBytes() { + java.lang.Object ref = gtin_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gtin_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @param value The gtin to set. + * @return This builder for chaining. + */ + public Builder setGtin(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gtin_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @return This builder for chaining. + */ + public Builder clearGtin() { + gtin_ = getDefaultInstance().getGtin(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + /** + * + * + *
+     * Global Trade Item Number
+     * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+     * item.
+     * 
+ * + * optional string gtin = 16; + * + * @param value The bytes for gtin to set. + * @return This builder for chaining. + */ + public Builder setGtinBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gtin_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList productTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureProductTypesIsMutable() { + if (!productTypes_.isModifiable()) { + productTypes_ = new com.google.protobuf.LazyStringArrayList(productTypes_); + } + bitField0_ |= 0x00040000; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @return A list containing the productTypes. + */ + public com.google.protobuf.ProtocolStringList getProductTypesList() { + productTypes_.makeImmutable(); + return productTypes_; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @return The count of productTypes. + */ + public int getProductTypesCount() { + return productTypes_.size(); + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the element to return. + * @return The productTypes at the given index. + */ + public java.lang.String getProductTypes(int index) { + return productTypes_.get(index); + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the value to return. + * @return The bytes of the productTypes at the given index. + */ + public com.google.protobuf.ByteString getProductTypesBytes(int index) { + return productTypes_.getByteString(index); + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param index The index to set the value at. + * @param value The productTypes to set. + * @return This builder for chaining. + */ + public Builder setProductTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductTypesIsMutable(); + productTypes_.set(index, value); + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param value The productTypes to add. + * @return This builder for chaining. + */ + public Builder addProductTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductTypesIsMutable(); + productTypes_.add(value); + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param values The productTypes to add. + * @return This builder for chaining. + */ + public Builder addAllProductTypes(java.lang.Iterable values) { + ensureProductTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productTypes_); + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @return This builder for chaining. + */ + public Builder clearProductTypes() { + productTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00040000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Categories of the item (formatted as in [products data
+     * specification](https://support.google.com/merchants/answer/6324406)).
+     * 
+ * + * repeated string product_types = 36; + * + * @param value The bytes of the productTypes to add. + * @return This builder for chaining. + */ + public Builder addProductTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProductTypesIsMutable(); + productTypes_.add(value); + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + + private java.lang.Object googleProductCategory_ = ""; + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @return Whether the googleProductCategory field is set. + */ + public boolean hasGoogleProductCategory() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @return The googleProductCategory. + */ + public java.lang.String getGoogleProductCategory() { + java.lang.Object ref = googleProductCategory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + googleProductCategory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @return The bytes for googleProductCategory. + */ + public com.google.protobuf.ByteString getGoogleProductCategoryBytes() { + java.lang.Object ref = googleProductCategory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + googleProductCategory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @param value The googleProductCategory to set. + * @return This builder for chaining. + */ + public Builder setGoogleProductCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + googleProductCategory_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @return This builder for chaining. + */ + public Builder clearGoogleProductCategory() { + googleProductCategory_ = getDefaultInstance().getGoogleProductCategory(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + return this; + } + /** + * + * + *
+     * Google's category of the item (see [Google product
+     * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+     * querying products, this field will contain the user provided value. There
+     * is currently no way to get back the auto assigned google product
+     * categories through the API.
+     * 
+ * + * optional string google_product_category = 17; + * + * @param value The bytes for googleProductCategory to set. + * @return This builder for chaining. + */ + public Builder setGoogleProductCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + googleProductCategory_ = value; + bitField0_ |= 0x00080000; + onChanged(); + return this; + } + + private boolean adult_; + /** + * + * + *
+     * Set to true if the item is targeted towards adults.
+     * 
+ * + * optional bool adult = 18; + * + * @return Whether the adult field is set. + */ + @java.lang.Override + public boolean hasAdult() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * + * + *
+     * Set to true if the item is targeted towards adults.
+     * 
+ * + * optional bool adult = 18; + * + * @return The adult. + */ + @java.lang.Override + public boolean getAdult() { + return adult_; + } + /** + * + * + *
+     * Set to true if the item is targeted towards adults.
+     * 
+ * + * optional bool adult = 18; + * + * @param value The adult to set. + * @return This builder for chaining. + */ + public Builder setAdult(boolean value) { + + adult_ = value; + bitField0_ |= 0x00100000; + onChanged(); + return this; + } + /** + * + * + *
+     * Set to true if the item is targeted towards adults.
+     * 
+ * + * optional bool adult = 18; + * + * @return This builder for chaining. + */ + public Builder clearAdult() { + bitField0_ = (bitField0_ & ~0x00100000); + adult_ = false; + onChanged(); + return this; + } + + private long multipack_; + /** + * + * + *
+     * The number of identical products in a merchant-defined multipack.
+     * 
+ * + * optional int64 multipack = 19; + * + * @return Whether the multipack field is set. + */ + @java.lang.Override + public boolean hasMultipack() { + return ((bitField0_ & 0x00200000) != 0); + } + /** + * + * + *
+     * The number of identical products in a merchant-defined multipack.
+     * 
+ * + * optional int64 multipack = 19; + * + * @return The multipack. + */ + @java.lang.Override + public long getMultipack() { + return multipack_; + } + /** + * + * + *
+     * The number of identical products in a merchant-defined multipack.
+     * 
+ * + * optional int64 multipack = 19; + * + * @param value The multipack to set. + * @return This builder for chaining. + */ + public Builder setMultipack(long value) { + + multipack_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of identical products in a merchant-defined multipack.
+     * 
+ * + * optional int64 multipack = 19; + * + * @return This builder for chaining. + */ + public Builder clearMultipack() { + bitField0_ = (bitField0_ & ~0x00200000); + multipack_ = 0L; + onChanged(); + return this; + } + + private boolean isBundle_; + /** + * + * + *
+     * Whether the item is a merchant-defined bundle. A bundle is a custom
+     * grouping of different products sold by a merchant for a single price.
+     * 
+ * + * optional bool is_bundle = 20; + * + * @return Whether the isBundle field is set. + */ + @java.lang.Override + public boolean hasIsBundle() { + return ((bitField0_ & 0x00400000) != 0); + } + /** + * + * + *
+     * Whether the item is a merchant-defined bundle. A bundle is a custom
+     * grouping of different products sold by a merchant for a single price.
+     * 
+ * + * optional bool is_bundle = 20; + * + * @return The isBundle. + */ + @java.lang.Override + public boolean getIsBundle() { + return isBundle_; + } + /** + * + * + *
+     * Whether the item is a merchant-defined bundle. A bundle is a custom
+     * grouping of different products sold by a merchant for a single price.
+     * 
+ * + * optional bool is_bundle = 20; + * + * @param value The isBundle to set. + * @return This builder for chaining. + */ + public Builder setIsBundle(boolean value) { + + isBundle_ = value; + bitField0_ |= 0x00400000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the item is a merchant-defined bundle. A bundle is a custom
+     * grouping of different products sold by a merchant for a single price.
+     * 
+ * + * optional bool is_bundle = 20; + * + * @return This builder for chaining. + */ + public Builder clearIsBundle() { + bitField0_ = (bitField0_ & ~0x00400000); + isBundle_ = false; + onChanged(); + return this; + } + + private java.lang.Object ageGroup_ = ""; + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @return Whether the ageGroup field is set. + */ + public boolean hasAgeGroup() { + return ((bitField0_ & 0x00800000) != 0); + } + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @return The ageGroup. + */ + public java.lang.String getAgeGroup() { + java.lang.Object ref = ageGroup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ageGroup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @return The bytes for ageGroup. + */ + public com.google.protobuf.ByteString getAgeGroupBytes() { + java.lang.Object ref = ageGroup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ageGroup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @param value The ageGroup to set. + * @return This builder for chaining. + */ + public Builder setAgeGroup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ageGroup_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @return This builder for chaining. + */ + public Builder clearAgeGroup() { + ageGroup_ = getDefaultInstance().getAgeGroup(); + bitField0_ = (bitField0_ & ~0x00800000); + onChanged(); + return this; + } + /** + * + * + *
+     * Target age group of the item.
+     * 
+ * + * optional string age_group = 21; + * + * @param value The bytes for ageGroup to set. + * @return This builder for chaining. + */ + public Builder setAgeGroupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ageGroup_ = value; + bitField0_ |= 0x00800000; + onChanged(); + return this; + } + + private java.lang.Object color_ = ""; + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @return Whether the color field is set. + */ + public boolean hasColor() { + return ((bitField0_ & 0x01000000) != 0); + } + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @return The color. + */ + public java.lang.String getColor() { + java.lang.Object ref = color_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + color_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @return The bytes for color. + */ + public com.google.protobuf.ByteString getColorBytes() { + java.lang.Object ref = color_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + color_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @param value The color to set. + * @return This builder for chaining. + */ + public Builder setColor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + color_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @return This builder for chaining. + */ + public Builder clearColor() { + color_ = getDefaultInstance().getColor(); + bitField0_ = (bitField0_ & ~0x01000000); + onChanged(); + return this; + } + /** + * + * + *
+     * Color of the item.
+     * 
+ * + * optional string color = 22; + * + * @param value The bytes for color to set. + * @return This builder for chaining. + */ + public Builder setColorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + color_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + + private java.lang.Object gender_ = ""; + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @return Whether the gender field is set. + */ + public boolean hasGender() { + return ((bitField0_ & 0x02000000) != 0); + } + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @return The gender. + */ + public java.lang.String getGender() { + java.lang.Object ref = gender_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gender_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @return The bytes for gender. + */ + public com.google.protobuf.ByteString getGenderBytes() { + java.lang.Object ref = gender_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + gender_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @param value The gender to set. + * @return This builder for chaining. + */ + public Builder setGender(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + gender_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @return This builder for chaining. + */ + public Builder clearGender() { + gender_ = getDefaultInstance().getGender(); + bitField0_ = (bitField0_ & ~0x02000000); + onChanged(); + return this; + } + /** + * + * + *
+     * Target gender of the item.
+     * 
+ * + * optional string gender = 23; + * + * @param value The bytes for gender to set. + * @return This builder for chaining. + */ + public Builder setGenderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + gender_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + + private java.lang.Object material_ = ""; + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @return Whether the material field is set. + */ + public boolean hasMaterial() { + return ((bitField0_ & 0x04000000) != 0); + } + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @return The material. + */ + public java.lang.String getMaterial() { + java.lang.Object ref = material_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + material_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @return The bytes for material. + */ + public com.google.protobuf.ByteString getMaterialBytes() { + java.lang.Object ref = material_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + material_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @param value The material to set. + * @return This builder for chaining. + */ + public Builder setMaterial(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + material_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @return This builder for chaining. + */ + public Builder clearMaterial() { + material_ = getDefaultInstance().getMaterial(); + bitField0_ = (bitField0_ & ~0x04000000); + onChanged(); + return this; + } + /** + * + * + *
+     * The material of which the item is made.
+     * 
+ * + * optional string material = 24; + * + * @param value The bytes for material to set. + * @return This builder for chaining. + */ + public Builder setMaterialBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + material_ = value; + bitField0_ |= 0x04000000; + onChanged(); + return this; + } + + private java.lang.Object pattern_ = ""; + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @return Whether the pattern field is set. + */ + public boolean hasPattern() { + return ((bitField0_ & 0x08000000) != 0); + } + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @return The pattern. + */ + public java.lang.String getPattern() { + java.lang.Object ref = pattern_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pattern_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @return The bytes for pattern. + */ + public com.google.protobuf.ByteString getPatternBytes() { + java.lang.Object ref = pattern_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pattern_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @param value The pattern to set. + * @return This builder for chaining. + */ + public Builder setPattern(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pattern_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @return This builder for chaining. + */ + public Builder clearPattern() { + pattern_ = getDefaultInstance().getPattern(); + bitField0_ = (bitField0_ & ~0x08000000); + onChanged(); + return this; + } + /** + * + * + *
+     * The item's pattern (e.g. polka dots).
+     * 
+ * + * optional string pattern = 25; + * + * @param value The bytes for pattern to set. + * @return This builder for chaining. + */ + public Builder setPatternBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pattern_ = value; + bitField0_ |= 0x08000000; + onChanged(); + return this; + } + + private java.lang.Object size_ = ""; + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @return Whether the size field is set. + */ + public boolean hasSize() { + return ((bitField0_ & 0x10000000) != 0); + } + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @return The size. + */ + public java.lang.String getSize() { + java.lang.Object ref = size_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + size_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @return The bytes for size. + */ + public com.google.protobuf.ByteString getSizeBytes() { + java.lang.Object ref = size_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + size_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + size_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @return This builder for chaining. + */ + public Builder clearSize() { + size_ = getDefaultInstance().getSize(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + return this; + } + /** + * + * + *
+     * Size of the item. Only one value is allowed. For variants with different
+     * sizes, insert a separate product for each size with the same
+     * `itemGroupId` value (see
+     * [https://support.google.com/merchants/answer/6324492](size definition)).
+     * 
+ * + * optional string size = 26; + * + * @param value The bytes for size to set. + * @return This builder for chaining. + */ + public Builder setSizeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + size_ = value; + bitField0_ |= 0x10000000; + onChanged(); + return this; + } + + private java.lang.Object sizeSystem_ = ""; + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @return Whether the sizeSystem field is set. + */ + public boolean hasSizeSystem() { + return ((bitField0_ & 0x20000000) != 0); + } + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @return The sizeSystem. + */ + public java.lang.String getSizeSystem() { + java.lang.Object ref = sizeSystem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sizeSystem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @return The bytes for sizeSystem. + */ + public com.google.protobuf.ByteString getSizeSystemBytes() { + java.lang.Object ref = sizeSystem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sizeSystem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @param value The sizeSystem to set. + * @return This builder for chaining. + */ + public Builder setSizeSystem(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sizeSystem_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @return This builder for chaining. + */ + public Builder clearSizeSystem() { + sizeSystem_ = getDefaultInstance().getSizeSystem(); + bitField0_ = (bitField0_ & ~0x20000000); + onChanged(); + return this; + } + /** + * + * + *
+     * System in which the size is specified. Recommended for apparel items.
+     * 
+ * + * optional string size_system = 27; + * + * @param value The bytes for sizeSystem to set. + * @return This builder for chaining. + */ + public Builder setSizeSystemBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sizeSystem_ = value; + bitField0_ |= 0x20000000; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList sizeTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureSizeTypesIsMutable() { + if (!sizeTypes_.isModifiable()) { + sizeTypes_ = new com.google.protobuf.LazyStringArrayList(sizeTypes_); + } + bitField0_ |= 0x40000000; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @return A list containing the sizeTypes. + */ + public com.google.protobuf.ProtocolStringList getSizeTypesList() { + sizeTypes_.makeImmutable(); + return sizeTypes_; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @return The count of sizeTypes. + */ + public int getSizeTypesCount() { + return sizeTypes_.size(); + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the element to return. + * @return The sizeTypes at the given index. + */ + public java.lang.String getSizeTypes(int index) { + return sizeTypes_.get(index); + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the value to return. + * @return The bytes of the sizeTypes at the given index. + */ + public com.google.protobuf.ByteString getSizeTypesBytes(int index) { + return sizeTypes_.getByteString(index); + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param index The index to set the value at. + * @param value The sizeTypes to set. + * @return This builder for chaining. + */ + public Builder setSizeTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizeTypesIsMutable(); + sizeTypes_.set(index, value); + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param value The sizeTypes to add. + * @return This builder for chaining. + */ + public Builder addSizeTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSizeTypesIsMutable(); + sizeTypes_.add(value); + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param values The sizeTypes to add. + * @return This builder for chaining. + */ + public Builder addAllSizeTypes(java.lang.Iterable values) { + ensureSizeTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sizeTypes_); + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @return This builder for chaining. + */ + public Builder clearSizeTypes() { + sizeTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x40000000); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The cut of the item. It can be used to represent combined size types for
+     * apparel items. Maximum two of size types can be provided (see
+     * [https://support.google.com/merchants/answer/6324497](size type)).
+     * 
+ * + * repeated string size_types = 28; + * + * @param value The bytes of the sizeTypes to add. + * @return This builder for chaining. + */ + public Builder addSizeTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureSizeTypesIsMutable(); + sizeTypes_.add(value); + bitField0_ |= 0x40000000; + onChanged(); + return this; + } + + private java.lang.Object itemGroupId_ = ""; + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @return Whether the itemGroupId field is set. + */ + public boolean hasItemGroupId() { + return ((bitField0_ & 0x80000000) != 0); + } + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @return The itemGroupId. + */ + public java.lang.String getItemGroupId() { + java.lang.Object ref = itemGroupId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + itemGroupId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @return The bytes for itemGroupId. + */ + public com.google.protobuf.ByteString getItemGroupIdBytes() { + java.lang.Object ref = itemGroupId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + itemGroupId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @param value The itemGroupId to set. + * @return This builder for chaining. + */ + public Builder setItemGroupId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + itemGroupId_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @return This builder for chaining. + */ + public Builder clearItemGroupId() { + itemGroupId_ = getDefaultInstance().getItemGroupId(); + bitField0_ = (bitField0_ & ~0x80000000); + onChanged(); + return this; + } + /** + * + * + *
+     * Shared identifier for all variants of the same product.
+     * 
+ * + * optional string item_group_id = 29; + * + * @param value The bytes for itemGroupId to set. + * @return This builder for chaining. + */ + public Builder setItemGroupIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + itemGroupId_ = value; + bitField0_ |= 0x80000000; + onChanged(); + return this; + } + + private java.util.List productDetails_ = + java.util.Collections.emptyList(); + + private void ensureProductDetailsIsMutable() { + if (!((bitField1_ & 0x00000001) != 0)) { + productDetails_ = + new java.util.ArrayList(productDetails_); + bitField1_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.ProductDetail, + com.google.shopping.css.v1.ProductDetail.Builder, + com.google.shopping.css.v1.ProductDetailOrBuilder> + productDetailsBuilder_; + + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public java.util.List getProductDetailsList() { + if (productDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(productDetails_); + } else { + return productDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public int getProductDetailsCount() { + if (productDetailsBuilder_ == null) { + return productDetails_.size(); + } else { + return productDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public com.google.shopping.css.v1.ProductDetail getProductDetails(int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder setProductDetails(int index, com.google.shopping.css.v1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.set(index, value); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder setProductDetails( + int index, com.google.shopping.css.v1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder addProductDetails(com.google.shopping.css.v1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder addProductDetails(int index, com.google.shopping.css.v1.ProductDetail value) { + if (productDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductDetailsIsMutable(); + productDetails_.add(index, value); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder addProductDetails( + com.google.shopping.css.v1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder addProductDetails( + int index, com.google.shopping.css.v1.ProductDetail.Builder builderForValue) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + productDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder addAllProductDetails( + java.lang.Iterable values) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productDetails_); + onChanged(); + } else { + productDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder clearProductDetails() { + if (productDetailsBuilder_ == null) { + productDetails_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000001); + onChanged(); + } else { + productDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public Builder removeProductDetails(int index) { + if (productDetailsBuilder_ == null) { + ensureProductDetailsIsMutable(); + productDetails_.remove(index); + onChanged(); + } else { + productDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public com.google.shopping.css.v1.ProductDetail.Builder getProductDetailsBuilder(int index) { + return getProductDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public com.google.shopping.css.v1.ProductDetailOrBuilder getProductDetailsOrBuilder(int index) { + if (productDetailsBuilder_ == null) { + return productDetails_.get(index); + } else { + return productDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public java.util.List + getProductDetailsOrBuilderList() { + if (productDetailsBuilder_ != null) { + return productDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(productDetails_); + } + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public com.google.shopping.css.v1.ProductDetail.Builder addProductDetailsBuilder() { + return getProductDetailsFieldBuilder() + .addBuilder(com.google.shopping.css.v1.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public com.google.shopping.css.v1.ProductDetail.Builder addProductDetailsBuilder(int index) { + return getProductDetailsFieldBuilder() + .addBuilder(index, com.google.shopping.css.v1.ProductDetail.getDefaultInstance()); + } + /** + * + * + *
+     * Technical specification or additional product details.
+     * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + public java.util.List + getProductDetailsBuilderList() { + return getProductDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.ProductDetail, + com.google.shopping.css.v1.ProductDetail.Builder, + com.google.shopping.css.v1.ProductDetailOrBuilder> + getProductDetailsFieldBuilder() { + if (productDetailsBuilder_ == null) { + productDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.ProductDetail, + com.google.shopping.css.v1.ProductDetail.Builder, + com.google.shopping.css.v1.ProductDetailOrBuilder>( + productDetails_, + ((bitField1_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + productDetails_ = null; + } + return productDetailsBuilder_; + } + + private com.google.shopping.css.v1.ProductWeight productWeight_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductWeight, + com.google.shopping.css.v1.ProductWeight.Builder, + com.google.shopping.css.v1.ProductWeightOrBuilder> + productWeightBuilder_; + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return Whether the productWeight field is set. + */ + public boolean hasProductWeight() { + return ((bitField1_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return The productWeight. + */ + public com.google.shopping.css.v1.ProductWeight getProductWeight() { + if (productWeightBuilder_ == null) { + return productWeight_ == null + ? com.google.shopping.css.v1.ProductWeight.getDefaultInstance() + : productWeight_; + } else { + return productWeightBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public Builder setProductWeight(com.google.shopping.css.v1.ProductWeight value) { + if (productWeightBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productWeight_ = value; + } else { + productWeightBuilder_.setMessage(value); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public Builder setProductWeight( + com.google.shopping.css.v1.ProductWeight.Builder builderForValue) { + if (productWeightBuilder_ == null) { + productWeight_ = builderForValue.build(); + } else { + productWeightBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public Builder mergeProductWeight(com.google.shopping.css.v1.ProductWeight value) { + if (productWeightBuilder_ == null) { + if (((bitField1_ & 0x00000002) != 0) + && productWeight_ != null + && productWeight_ != com.google.shopping.css.v1.ProductWeight.getDefaultInstance()) { + getProductWeightBuilder().mergeFrom(value); + } else { + productWeight_ = value; + } + } else { + productWeightBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public Builder clearProductWeight() { + bitField1_ = (bitField1_ & ~0x00000002); + productWeight_ = null; + if (productWeightBuilder_ != null) { + productWeightBuilder_.dispose(); + productWeightBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public com.google.shopping.css.v1.ProductWeight.Builder getProductWeightBuilder() { + bitField1_ |= 0x00000002; + onChanged(); + return getProductWeightFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + public com.google.shopping.css.v1.ProductWeightOrBuilder getProductWeightOrBuilder() { + if (productWeightBuilder_ != null) { + return productWeightBuilder_.getMessageOrBuilder(); + } else { + return productWeight_ == null + ? com.google.shopping.css.v1.ProductWeight.getDefaultInstance() + : productWeight_; + } + } + /** + * + * + *
+     * The weight of the product in the units provided. The value must be
+     * between 0 (exclusive) and 2000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductWeight, + com.google.shopping.css.v1.ProductWeight.Builder, + com.google.shopping.css.v1.ProductWeightOrBuilder> + getProductWeightFieldBuilder() { + if (productWeightBuilder_ == null) { + productWeightBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductWeight, + com.google.shopping.css.v1.ProductWeight.Builder, + com.google.shopping.css.v1.ProductWeightOrBuilder>( + getProductWeight(), getParentForChildren(), isClean()); + productWeight_ = null; + } + return productWeightBuilder_; + } + + private com.google.shopping.css.v1.ProductDimension productLength_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + productLengthBuilder_; + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return Whether the productLength field is set. + */ + public boolean hasProductLength() { + return ((bitField1_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return The productLength. + */ + public com.google.shopping.css.v1.ProductDimension getProductLength() { + if (productLengthBuilder_ == null) { + return productLength_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productLength_; + } else { + return productLengthBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public Builder setProductLength(com.google.shopping.css.v1.ProductDimension value) { + if (productLengthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productLength_ = value; + } else { + productLengthBuilder_.setMessage(value); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public Builder setProductLength( + com.google.shopping.css.v1.ProductDimension.Builder builderForValue) { + if (productLengthBuilder_ == null) { + productLength_ = builderForValue.build(); + } else { + productLengthBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public Builder mergeProductLength(com.google.shopping.css.v1.ProductDimension value) { + if (productLengthBuilder_ == null) { + if (((bitField1_ & 0x00000004) != 0) + && productLength_ != null + && productLength_ != com.google.shopping.css.v1.ProductDimension.getDefaultInstance()) { + getProductLengthBuilder().mergeFrom(value); + } else { + productLength_ = value; + } + } else { + productLengthBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public Builder clearProductLength() { + bitField1_ = (bitField1_ & ~0x00000004); + productLength_ = null; + if (productLengthBuilder_ != null) { + productLengthBuilder_.dispose(); + productLengthBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public com.google.shopping.css.v1.ProductDimension.Builder getProductLengthBuilder() { + bitField1_ |= 0x00000004; + onChanged(); + return getProductLengthFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductLengthOrBuilder() { + if (productLengthBuilder_ != null) { + return productLengthBuilder_.getMessageOrBuilder(); + } else { + return productLength_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productLength_; + } + } + /** + * + * + *
+     * The length of the product in the units provided. The value must be
+     * between 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + getProductLengthFieldBuilder() { + if (productLengthBuilder_ == null) { + productLengthBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder>( + getProductLength(), getParentForChildren(), isClean()); + productLength_ = null; + } + return productLengthBuilder_; + } + + private com.google.shopping.css.v1.ProductDimension productWidth_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + productWidthBuilder_; + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return Whether the productWidth field is set. + */ + public boolean hasProductWidth() { + return ((bitField1_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return The productWidth. + */ + public com.google.shopping.css.v1.ProductDimension getProductWidth() { + if (productWidthBuilder_ == null) { + return productWidth_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productWidth_; + } else { + return productWidthBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public Builder setProductWidth(com.google.shopping.css.v1.ProductDimension value) { + if (productWidthBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productWidth_ = value; + } else { + productWidthBuilder_.setMessage(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public Builder setProductWidth( + com.google.shopping.css.v1.ProductDimension.Builder builderForValue) { + if (productWidthBuilder_ == null) { + productWidth_ = builderForValue.build(); + } else { + productWidthBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public Builder mergeProductWidth(com.google.shopping.css.v1.ProductDimension value) { + if (productWidthBuilder_ == null) { + if (((bitField1_ & 0x00000008) != 0) + && productWidth_ != null + && productWidth_ != com.google.shopping.css.v1.ProductDimension.getDefaultInstance()) { + getProductWidthBuilder().mergeFrom(value); + } else { + productWidth_ = value; + } + } else { + productWidthBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public Builder clearProductWidth() { + bitField1_ = (bitField1_ & ~0x00000008); + productWidth_ = null; + if (productWidthBuilder_ != null) { + productWidthBuilder_.dispose(); + productWidthBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public com.google.shopping.css.v1.ProductDimension.Builder getProductWidthBuilder() { + bitField1_ |= 0x00000008; + onChanged(); + return getProductWidthFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductWidthOrBuilder() { + if (productWidthBuilder_ != null) { + return productWidthBuilder_.getMessageOrBuilder(); + } else { + return productWidth_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productWidth_; + } + } + /** + * + * + *
+     * The width of the product in the units provided. The value must be between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + getProductWidthFieldBuilder() { + if (productWidthBuilder_ == null) { + productWidthBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder>( + getProductWidth(), getParentForChildren(), isClean()); + productWidth_ = null; + } + return productWidthBuilder_; + } + + private com.google.shopping.css.v1.ProductDimension productHeight_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + productHeightBuilder_; + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return Whether the productHeight field is set. + */ + public boolean hasProductHeight() { + return ((bitField1_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return The productHeight. + */ + public com.google.shopping.css.v1.ProductDimension getProductHeight() { + if (productHeightBuilder_ == null) { + return productHeight_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productHeight_; + } else { + return productHeightBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public Builder setProductHeight(com.google.shopping.css.v1.ProductDimension value) { + if (productHeightBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + productHeight_ = value; + } else { + productHeightBuilder_.setMessage(value); + } + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public Builder setProductHeight( + com.google.shopping.css.v1.ProductDimension.Builder builderForValue) { + if (productHeightBuilder_ == null) { + productHeight_ = builderForValue.build(); + } else { + productHeightBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public Builder mergeProductHeight(com.google.shopping.css.v1.ProductDimension value) { + if (productHeightBuilder_ == null) { + if (((bitField1_ & 0x00000010) != 0) + && productHeight_ != null + && productHeight_ != com.google.shopping.css.v1.ProductDimension.getDefaultInstance()) { + getProductHeightBuilder().mergeFrom(value); + } else { + productHeight_ = value; + } + } else { + productHeightBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public Builder clearProductHeight() { + bitField1_ = (bitField1_ & ~0x00000010); + productHeight_ = null; + if (productHeightBuilder_ != null) { + productHeightBuilder_.dispose(); + productHeightBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public com.google.shopping.css.v1.ProductDimension.Builder getProductHeightBuilder() { + bitField1_ |= 0x00000010; + onChanged(); + return getProductHeightFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + public com.google.shopping.css.v1.ProductDimensionOrBuilder getProductHeightOrBuilder() { + if (productHeightBuilder_ != null) { + return productHeightBuilder_.getMessageOrBuilder(); + } else { + return productHeight_ == null + ? com.google.shopping.css.v1.ProductDimension.getDefaultInstance() + : productHeight_; + } + } + /** + * + * + *
+     * The height of the product in the units provided. The value must be
+     * between
+     * 0 (exclusive) and 3000 (inclusive).
+     * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder> + getProductHeightFieldBuilder() { + if (productHeightBuilder_ == null) { + productHeightBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.ProductDimension, + com.google.shopping.css.v1.ProductDimension.Builder, + com.google.shopping.css.v1.ProductDimensionOrBuilder>( + getProductHeight(), getParentForChildren(), isClean()); + productHeight_ = null; + } + return productHeightBuilder_; + } + + private com.google.protobuf.LazyStringArrayList productHighlights_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureProductHighlightsIsMutable() { + if (!productHighlights_.isModifiable()) { + productHighlights_ = new com.google.protobuf.LazyStringArrayList(productHighlights_); + } + bitField1_ |= 0x00000020; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @return A list containing the productHighlights. + */ + public com.google.protobuf.ProtocolStringList getProductHighlightsList() { + productHighlights_.makeImmutable(); + return productHighlights_; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @return The count of productHighlights. + */ + public int getProductHighlightsCount() { + return productHighlights_.size(); + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the element to return. + * @return The productHighlights at the given index. + */ + public java.lang.String getProductHighlights(int index) { + return productHighlights_.get(index); + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the value to return. + * @return The bytes of the productHighlights at the given index. + */ + public com.google.protobuf.ByteString getProductHighlightsBytes(int index) { + return productHighlights_.getByteString(index); + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index to set the value at. + * @param value The productHighlights to set. + * @return This builder for chaining. + */ + public Builder setProductHighlights(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductHighlightsIsMutable(); + productHighlights_.set(index, value); + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param value The productHighlights to add. + * @return This builder for chaining. + */ + public Builder addProductHighlights(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureProductHighlightsIsMutable(); + productHighlights_.add(value); + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param values The productHighlights to add. + * @return This builder for chaining. + */ + public Builder addAllProductHighlights(java.lang.Iterable values) { + ensureProductHighlightsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, productHighlights_); + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @return This builder for chaining. + */ + public Builder clearProductHighlights() { + productHighlights_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000020); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Bullet points describing the most relevant highlights of a product.
+     * 
+ * + * repeated string product_highlights = 35; + * + * @param value The bytes of the productHighlights to add. + * @return This builder for chaining. + */ + public Builder addProductHighlightsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureProductHighlightsIsMutable(); + productHighlights_.add(value); + bitField1_ |= 0x00000020; + onChanged(); + return this; + } + + private java.util.List certifications_ = + java.util.Collections.emptyList(); + + private void ensureCertificationsIsMutable() { + if (!((bitField1_ & 0x00000040) != 0)) { + certifications_ = + new java.util.ArrayList(certifications_); + bitField1_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Certification, + com.google.shopping.css.v1.Certification.Builder, + com.google.shopping.css.v1.CertificationOrBuilder> + certificationsBuilder_; + + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public java.util.List getCertificationsList() { + if (certificationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(certifications_); + } else { + return certificationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public int getCertificationsCount() { + if (certificationsBuilder_ == null) { + return certifications_.size(); + } else { + return certificationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public com.google.shopping.css.v1.Certification getCertifications(int index) { + if (certificationsBuilder_ == null) { + return certifications_.get(index); + } else { + return certificationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder setCertifications(int index, com.google.shopping.css.v1.Certification value) { + if (certificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificationsIsMutable(); + certifications_.set(index, value); + onChanged(); + } else { + certificationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder setCertifications( + int index, com.google.shopping.css.v1.Certification.Builder builderForValue) { + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + certifications_.set(index, builderForValue.build()); + onChanged(); + } else { + certificationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder addCertifications(com.google.shopping.css.v1.Certification value) { + if (certificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificationsIsMutable(); + certifications_.add(value); + onChanged(); + } else { + certificationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder addCertifications(int index, com.google.shopping.css.v1.Certification value) { + if (certificationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificationsIsMutable(); + certifications_.add(index, value); + onChanged(); + } else { + certificationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder addCertifications( + com.google.shopping.css.v1.Certification.Builder builderForValue) { + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + certifications_.add(builderForValue.build()); + onChanged(); + } else { + certificationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder addCertifications( + int index, com.google.shopping.css.v1.Certification.Builder builderForValue) { + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + certifications_.add(index, builderForValue.build()); + onChanged(); + } else { + certificationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder addAllCertifications( + java.lang.Iterable values) { + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certifications_); + onChanged(); + } else { + certificationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder clearCertifications() { + if (certificationsBuilder_ == null) { + certifications_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000040); + onChanged(); + } else { + certificationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public Builder removeCertifications(int index) { + if (certificationsBuilder_ == null) { + ensureCertificationsIsMutable(); + certifications_.remove(index); + onChanged(); + } else { + certificationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public com.google.shopping.css.v1.Certification.Builder getCertificationsBuilder(int index) { + return getCertificationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public com.google.shopping.css.v1.CertificationOrBuilder getCertificationsOrBuilder(int index) { + if (certificationsBuilder_ == null) { + return certifications_.get(index); + } else { + return certificationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public java.util.List + getCertificationsOrBuilderList() { + if (certificationsBuilder_ != null) { + return certificationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(certifications_); + } + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public com.google.shopping.css.v1.Certification.Builder addCertificationsBuilder() { + return getCertificationsFieldBuilder() + .addBuilder(com.google.shopping.css.v1.Certification.getDefaultInstance()); + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public com.google.shopping.css.v1.Certification.Builder addCertificationsBuilder(int index) { + return getCertificationsFieldBuilder() + .addBuilder(index, com.google.shopping.css.v1.Certification.getDefaultInstance()); + } + /** + * + * + *
+     * A list of certificates claimed by the CSS for the given product.
+     * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + public java.util.List + getCertificationsBuilderList() { + return getCertificationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Certification, + com.google.shopping.css.v1.Certification.Builder, + com.google.shopping.css.v1.CertificationOrBuilder> + getCertificationsFieldBuilder() { + if (certificationsBuilder_ == null) { + certificationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Certification, + com.google.shopping.css.v1.Certification.Builder, + com.google.shopping.css.v1.CertificationOrBuilder>( + certifications_, + ((bitField1_ & 0x00000040) != 0), + getParentForChildren(), + isClean()); + certifications_ = null; + } + return certificationsBuilder_; + } + + private com.google.protobuf.Timestamp expirationDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expirationDateBuilder_; + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return Whether the expirationDate field is set. + */ + public boolean hasExpirationDate() { + return ((bitField1_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return The expirationDate. + */ + public com.google.protobuf.Timestamp getExpirationDate() { + if (expirationDateBuilder_ == null) { + return expirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationDate_; + } else { + return expirationDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public Builder setExpirationDate(com.google.protobuf.Timestamp value) { + if (expirationDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationDate_ = value; + } else { + expirationDateBuilder_.setMessage(value); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public Builder setExpirationDate(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationDateBuilder_ == null) { + expirationDate_ = builderForValue.build(); + } else { + expirationDateBuilder_.setMessage(builderForValue.build()); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public Builder mergeExpirationDate(com.google.protobuf.Timestamp value) { + if (expirationDateBuilder_ == null) { + if (((bitField1_ & 0x00000080) != 0) + && expirationDate_ != null + && expirationDate_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpirationDateBuilder().mergeFrom(value); + } else { + expirationDate_ = value; + } + } else { + expirationDateBuilder_.mergeFrom(value); + } + bitField1_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public Builder clearExpirationDate() { + bitField1_ = (bitField1_ & ~0x00000080); + expirationDate_ = null; + if (expirationDateBuilder_ != null) { + expirationDateBuilder_.dispose(); + expirationDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public com.google.protobuf.Timestamp.Builder getExpirationDateBuilder() { + bitField1_ |= 0x00000080; + onChanged(); + return getExpirationDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationDateOrBuilder() { + if (expirationDateBuilder_ != null) { + return expirationDateBuilder_.getMessageOrBuilder(); + } else { + return expirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : expirationDate_; + } + } + /** + * + * + *
+     * Date on which the item should expire, as specified upon insertion, in
+     * [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+     * expiration date in Google Shopping is exposed in `productstatuses` as
+     * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+     * and might be earlier if `expirationDate` is too far in the future.
+     * Note: It may take 2+ days from the expiration date for the item to
+     * actually get deleted.
+     * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpirationDateFieldBuilder() { + if (expirationDateBuilder_ == null) { + expirationDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpirationDate(), getParentForChildren(), isClean()); + expirationDate_ = null; + } + return expirationDateBuilder_; + } + + private com.google.protobuf.LazyStringArrayList includedDestinations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureIncludedDestinationsIsMutable() { + if (!includedDestinations_.isModifiable()) { + includedDestinations_ = new com.google.protobuf.LazyStringArrayList(includedDestinations_); + } + bitField1_ |= 0x00000100; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @return A list containing the includedDestinations. + */ + public com.google.protobuf.ProtocolStringList getIncludedDestinationsList() { + includedDestinations_.makeImmutable(); + return includedDestinations_; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @return The count of includedDestinations. + */ + public int getIncludedDestinationsCount() { + return includedDestinations_.size(); + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the element to return. + * @return The includedDestinations at the given index. + */ + public java.lang.String getIncludedDestinations(int index) { + return includedDestinations_.get(index); + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the value to return. + * @return The bytes of the includedDestinations at the given index. + */ + public com.google.protobuf.ByteString getIncludedDestinationsBytes(int index) { + return includedDestinations_.getByteString(index); + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index to set the value at. + * @param value The includedDestinations to set. + * @return This builder for chaining. + */ + public Builder setIncludedDestinations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIncludedDestinationsIsMutable(); + includedDestinations_.set(index, value); + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param value The includedDestinations to add. + * @return This builder for chaining. + */ + public Builder addIncludedDestinations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIncludedDestinationsIsMutable(); + includedDestinations_.add(value); + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param values The includedDestinations to add. + * @return This builder for chaining. + */ + public Builder addAllIncludedDestinations(java.lang.Iterable values) { + ensureIncludedDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, includedDestinations_); + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @return This builder for chaining. + */ + public Builder clearIncludedDestinations() { + includedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000100); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to include for this target (corresponds to
+     * checked check boxes in Merchant Center). Default destinations are always
+     * included unless provided in `excludedDestinations`.
+     * 
+ * + * repeated string included_destinations = 43; + * + * @param value The bytes of the includedDestinations to add. + * @return This builder for chaining. + */ + public Builder addIncludedDestinationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIncludedDestinationsIsMutable(); + includedDestinations_.add(value); + bitField1_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList excludedDestinations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureExcludedDestinationsIsMutable() { + if (!excludedDestinations_.isModifiable()) { + excludedDestinations_ = new com.google.protobuf.LazyStringArrayList(excludedDestinations_); + } + bitField1_ |= 0x00000200; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @return A list containing the excludedDestinations. + */ + public com.google.protobuf.ProtocolStringList getExcludedDestinationsList() { + excludedDestinations_.makeImmutable(); + return excludedDestinations_; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @return The count of excludedDestinations. + */ + public int getExcludedDestinationsCount() { + return excludedDestinations_.size(); + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the element to return. + * @return The excludedDestinations at the given index. + */ + public java.lang.String getExcludedDestinations(int index) { + return excludedDestinations_.get(index); + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the value to return. + * @return The bytes of the excludedDestinations at the given index. + */ + public com.google.protobuf.ByteString getExcludedDestinationsBytes(int index) { + return excludedDestinations_.getByteString(index); + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index to set the value at. + * @param value The excludedDestinations to set. + * @return This builder for chaining. + */ + public Builder setExcludedDestinations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedDestinationsIsMutable(); + excludedDestinations_.set(index, value); + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param value The excludedDestinations to add. + * @return This builder for chaining. + */ + public Builder addExcludedDestinations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureExcludedDestinationsIsMutable(); + excludedDestinations_.add(value); + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param values The excludedDestinations to add. + * @return This builder for chaining. + */ + public Builder addAllExcludedDestinations(java.lang.Iterable values) { + ensureExcludedDestinationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, excludedDestinations_); + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @return This builder for chaining. + */ + public Builder clearExcludedDestinations() { + excludedDestinations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField1_ = (bitField1_ & ~0x00000200); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The list of destinations to exclude for this target (corresponds to
+     * unchecked check boxes in Merchant Center).
+     * 
+ * + * repeated string excluded_destinations = 44; + * + * @param value The bytes of the excludedDestinations to add. + * @return This builder for chaining. + */ + public Builder addExcludedDestinationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureExcludedDestinationsIsMutable(); + excludedDestinations_.add(value); + bitField1_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object pause_ = ""; + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @return Whether the pause field is set. + */ + public boolean hasPause() { + return ((bitField1_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @return The pause. + */ + public java.lang.String getPause() { + java.lang.Object ref = pause_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pause_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @return The bytes for pause. + */ + public com.google.protobuf.ByteString getPauseBytes() { + java.lang.Object ref = pause_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pause_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @param value The pause to set. + * @return This builder for chaining. + */ + public Builder setPause(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pause_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @return This builder for chaining. + */ + public Builder clearPause() { + pause_ = getDefaultInstance().getPause(); + bitField1_ = (bitField1_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Publication of this item will be temporarily paused.
+     * 
+ * + * optional string pause = 45; + * + * @param value The bytes for pause to set. + * @return This builder for chaining. + */ + public Builder setPauseBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pause_ = value; + bitField1_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object customLabel0_ = ""; + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @return Whether the customLabel0 field is set. + */ + public boolean hasCustomLabel0() { + return ((bitField1_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @return The customLabel0. + */ + public java.lang.String getCustomLabel0() { + java.lang.Object ref = customLabel0_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customLabel0_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @return The bytes for customLabel0. + */ + public com.google.protobuf.ByteString getCustomLabel0Bytes() { + java.lang.Object ref = customLabel0_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel0_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @param value The customLabel0 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel0(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customLabel0_ = value; + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @return This builder for chaining. + */ + public Builder clearCustomLabel0() { + customLabel0_ = getDefaultInstance().getCustomLabel0(); + bitField1_ = (bitField1_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 0 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_0 = 46; + * + * @param value The bytes for customLabel0 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel0Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customLabel0_ = value; + bitField1_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object customLabel1_ = ""; + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @return Whether the customLabel1 field is set. + */ + public boolean hasCustomLabel1() { + return ((bitField1_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @return The customLabel1. + */ + public java.lang.String getCustomLabel1() { + java.lang.Object ref = customLabel1_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customLabel1_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @return The bytes for customLabel1. + */ + public com.google.protobuf.ByteString getCustomLabel1Bytes() { + java.lang.Object ref = customLabel1_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel1_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @param value The customLabel1 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel1(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customLabel1_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @return This builder for chaining. + */ + public Builder clearCustomLabel1() { + customLabel1_ = getDefaultInstance().getCustomLabel1(); + bitField1_ = (bitField1_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 1 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_1 = 47; + * + * @param value The bytes for customLabel1 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel1Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customLabel1_ = value; + bitField1_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object customLabel2_ = ""; + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @return Whether the customLabel2 field is set. + */ + public boolean hasCustomLabel2() { + return ((bitField1_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @return The customLabel2. + */ + public java.lang.String getCustomLabel2() { + java.lang.Object ref = customLabel2_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customLabel2_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @return The bytes for customLabel2. + */ + public com.google.protobuf.ByteString getCustomLabel2Bytes() { + java.lang.Object ref = customLabel2_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel2_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @param value The customLabel2 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel2(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customLabel2_ = value; + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @return This builder for chaining. + */ + public Builder clearCustomLabel2() { + customLabel2_ = getDefaultInstance().getCustomLabel2(); + bitField1_ = (bitField1_ & ~0x00002000); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 2 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_2 = 48; + * + * @param value The bytes for customLabel2 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel2Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customLabel2_ = value; + bitField1_ |= 0x00002000; + onChanged(); + return this; + } + + private java.lang.Object customLabel3_ = ""; + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @return Whether the customLabel3 field is set. + */ + public boolean hasCustomLabel3() { + return ((bitField1_ & 0x00004000) != 0); + } + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @return The customLabel3. + */ + public java.lang.String getCustomLabel3() { + java.lang.Object ref = customLabel3_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customLabel3_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @return The bytes for customLabel3. + */ + public com.google.protobuf.ByteString getCustomLabel3Bytes() { + java.lang.Object ref = customLabel3_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel3_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @param value The customLabel3 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel3(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customLabel3_ = value; + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @return This builder for chaining. + */ + public Builder clearCustomLabel3() { + customLabel3_ = getDefaultInstance().getCustomLabel3(); + bitField1_ = (bitField1_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 3 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_3 = 49; + * + * @param value The bytes for customLabel3 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel3Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customLabel3_ = value; + bitField1_ |= 0x00004000; + onChanged(); + return this; + } + + private java.lang.Object customLabel4_ = ""; + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @return Whether the customLabel4 field is set. + */ + public boolean hasCustomLabel4() { + return ((bitField1_ & 0x00008000) != 0); + } + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @return The customLabel4. + */ + public java.lang.String getCustomLabel4() { + java.lang.Object ref = customLabel4_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customLabel4_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @return The bytes for customLabel4. + */ + public com.google.protobuf.ByteString getCustomLabel4Bytes() { + java.lang.Object ref = customLabel4_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customLabel4_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @param value The customLabel4 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel4(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customLabel4_ = value; + bitField1_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @return This builder for chaining. + */ + public Builder clearCustomLabel4() { + customLabel4_ = getDefaultInstance().getCustomLabel4(); + bitField1_ = (bitField1_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * Custom label 4 for custom grouping of items in a Shopping campaign.
+     * 
+ * + * optional string custom_label_4 = 50; + * + * @param value The bytes for customLabel4 to set. + * @return This builder for chaining. + */ + public Builder setCustomLabel4Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customLabel4_ = value; + bitField1_ |= 0x00008000; + 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.css.v1.Attributes) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.Attributes) + private static final com.google.shopping.css.v1.Attributes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.Attributes(); + } + + public static com.google.shopping.css.v1.Attributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attributes 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.css.v1.Attributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AttributesOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AttributesOrBuilder.java new file mode 100644 index 000000000000..b6bf328a8af3 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/AttributesOrBuilder.java @@ -0,0 +1,1950 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface AttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.Attributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return Whether the cppLink field is set. + */ + boolean hasCppLink(); + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return The cppLink. + */ + java.lang.String getCppLink(); + /** + * + * + *
+   * URL directly linking to your the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_link = 1; + * + * @return The bytes for cppLink. + */ + com.google.protobuf.ByteString getCppLinkBytes(); + + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return Whether the cppMobileLink field is set. + */ + boolean hasCppMobileLink(); + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The cppMobileLink. + */ + java.lang.String getCppMobileLink(); + /** + * + * + *
+   * URL for the mobile-optimized version of the Product Detail Page of the CSS.
+   * 
+ * + * optional string cpp_mobile_link = 2; + * + * @return The bytes for cppMobileLink. + */ + com.google.protobuf.ByteString getCppMobileLinkBytes(); + + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return Whether the cppAdsRedirect field is set. + */ + boolean hasCppAdsRedirect(); + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The cppAdsRedirect. + */ + java.lang.String getCppAdsRedirect(); + /** + * + * + *
+   * Allows advertisers to override the item URL when the product is shown
+   * within the context of Product Ads.
+   * 
+ * + * optional string cpp_ads_redirect = 42; + * + * @return The bytes for cppAdsRedirect. + */ + com.google.protobuf.ByteString getCppAdsRedirectBytes(); + + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return Whether the lowPrice field is set. + */ + boolean hasLowPrice(); + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + * + * @return The lowPrice. + */ + com.google.shopping.type.Price getLowPrice(); + /** + * + * + *
+   * Low Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price low_price = 3; + */ + com.google.shopping.type.PriceOrBuilder getLowPriceOrBuilder(); + + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return Whether the highPrice field is set. + */ + boolean hasHighPrice(); + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + * + * @return The highPrice. + */ + com.google.shopping.type.Price getHighPrice(); + /** + * + * + *
+   * High Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price high_price = 4; + */ + com.google.shopping.type.PriceOrBuilder getHighPriceOrBuilder(); + + /** + * + * + *
+   * The number of aggregate offers.
+   * 
+ * + * optional int64 number_of_offers = 5; + * + * @return Whether the numberOfOffers field is set. + */ + boolean hasNumberOfOffers(); + /** + * + * + *
+   * The number of aggregate offers.
+   * 
+ * + * optional int64 number_of_offers = 5; + * + * @return The numberOfOffers. + */ + long getNumberOfOffers(); + + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return Whether the headlineOfferCondition field is set. + */ + boolean hasHeadlineOfferCondition(); + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The headlineOfferCondition. + */ + java.lang.String getHeadlineOfferCondition(); + /** + * + * + *
+   * Condition of the headline offer.
+   * 
+ * + * optional string headline_offer_condition = 6; + * + * @return The bytes for headlineOfferCondition. + */ + com.google.protobuf.ByteString getHeadlineOfferConditionBytes(); + + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return Whether the headlineOfferPrice field is set. + */ + boolean hasHeadlineOfferPrice(); + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + * + * @return The headlineOfferPrice. + */ + com.google.shopping.type.Price getHeadlineOfferPrice(); + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_price = 7; + */ + com.google.shopping.type.PriceOrBuilder getHeadlineOfferPriceOrBuilder(); + + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return Whether the headlineOfferLink field is set. + */ + boolean hasHeadlineOfferLink(); + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return The headlineOfferLink. + */ + java.lang.String getHeadlineOfferLink(); + /** + * + * + *
+   * Link to the headline offer.
+   * 
+ * + * optional string headline_offer_link = 8; + * + * @return The bytes for headlineOfferLink. + */ + com.google.protobuf.ByteString getHeadlineOfferLinkBytes(); + + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return Whether the headlineOfferMobileLink field is set. + */ + boolean hasHeadlineOfferMobileLink(); + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The headlineOfferMobileLink. + */ + java.lang.String getHeadlineOfferMobileLink(); + /** + * + * + *
+   * Mobile Link to the headline offer.
+   * 
+ * + * optional string headline_offer_mobile_link = 9; + * + * @return The bytes for headlineOfferMobileLink. + */ + com.google.protobuf.ByteString getHeadlineOfferMobileLinkBytes(); + + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return Whether the headlineOfferShippingPrice field is set. + */ + boolean hasHeadlineOfferShippingPrice(); + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + * + * @return The headlineOfferShippingPrice. + */ + com.google.shopping.type.Price getHeadlineOfferShippingPrice(); + /** + * + * + *
+   * Headline Price of the aggregate offer.
+   * 
+ * + * .google.shopping.type.Price headline_offer_shipping_price = 41; + */ + com.google.shopping.type.PriceOrBuilder getHeadlineOfferShippingPriceOrBuilder(); + + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @return Whether the title field is set. + */ + boolean hasTitle(); + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+   * Title of the item.
+   * 
+ * + * optional string title = 10; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); + + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return Whether the imageLink field is set. + */ + boolean hasImageLink(); + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return The imageLink. + */ + java.lang.String getImageLink(); + /** + * + * + *
+   * URL of an image of the item.
+   * 
+ * + * optional string image_link = 11; + * + * @return The bytes for imageLink. + */ + com.google.protobuf.ByteString getImageLinkBytes(); + + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @return A list containing the additionalImageLinks. + */ + java.util.List getAdditionalImageLinksList(); + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @return The count of additionalImageLinks. + */ + int getAdditionalImageLinksCount(); + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the element to return. + * @return The additionalImageLinks at the given index. + */ + java.lang.String getAdditionalImageLinks(int index); + /** + * + * + *
+   * Additional URL of images of the item.
+   * 
+ * + * repeated string additional_image_links = 12; + * + * @param index The index of the value to return. + * @return The bytes of the additionalImageLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalImageLinksBytes(int index); + + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @return Whether the description field is set. + */ + boolean hasDescription(); + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the item.
+   * 
+ * + * optional string description = 13; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return Whether the brand field is set. + */ + boolean hasBrand(); + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return The brand. + */ + java.lang.String getBrand(); + /** + * + * + *
+   * Product Related Attributes.[14-36]
+   * Brand of the item.
+   * 
+ * + * optional string brand = 14; + * + * @return The bytes for brand. + */ + com.google.protobuf.ByteString getBrandBytes(); + + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return Whether the mpn field is set. + */ + boolean hasMpn(); + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return The mpn. + */ + java.lang.String getMpn(); + /** + * + * + *
+   * Manufacturer Part Number
+   * ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the
+   * item.
+   * 
+ * + * optional string mpn = 15; + * + * @return The bytes for mpn. + */ + com.google.protobuf.ByteString getMpnBytes(); + + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return Whether the gtin field is set. + */ + boolean hasGtin(); + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return The gtin. + */ + java.lang.String getGtin(); + /** + * + * + *
+   * Global Trade Item Number
+   * ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the
+   * item.
+   * 
+ * + * optional string gtin = 16; + * + * @return The bytes for gtin. + */ + com.google.protobuf.ByteString getGtinBytes(); + + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @return A list containing the productTypes. + */ + java.util.List getProductTypesList(); + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @return The count of productTypes. + */ + int getProductTypesCount(); + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the element to return. + * @return The productTypes at the given index. + */ + java.lang.String getProductTypes(int index); + /** + * + * + *
+   * Categories of the item (formatted as in [products data
+   * specification](https://support.google.com/merchants/answer/6324406)).
+   * 
+ * + * repeated string product_types = 36; + * + * @param index The index of the value to return. + * @return The bytes of the productTypes at the given index. + */ + com.google.protobuf.ByteString getProductTypesBytes(int index); + + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return Whether the googleProductCategory field is set. + */ + boolean hasGoogleProductCategory(); + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return The googleProductCategory. + */ + java.lang.String getGoogleProductCategory(); + /** + * + * + *
+   * Google's category of the item (see [Google product
+   * taxonomy](https://support.google.com/merchants/answer/1705911)). When
+   * querying products, this field will contain the user provided value. There
+   * is currently no way to get back the auto assigned google product
+   * categories through the API.
+   * 
+ * + * optional string google_product_category = 17; + * + * @return The bytes for googleProductCategory. + */ + com.google.protobuf.ByteString getGoogleProductCategoryBytes(); + + /** + * + * + *
+   * Set to true if the item is targeted towards adults.
+   * 
+ * + * optional bool adult = 18; + * + * @return Whether the adult field is set. + */ + boolean hasAdult(); + /** + * + * + *
+   * Set to true if the item is targeted towards adults.
+   * 
+ * + * optional bool adult = 18; + * + * @return The adult. + */ + boolean getAdult(); + + /** + * + * + *
+   * The number of identical products in a merchant-defined multipack.
+   * 
+ * + * optional int64 multipack = 19; + * + * @return Whether the multipack field is set. + */ + boolean hasMultipack(); + /** + * + * + *
+   * The number of identical products in a merchant-defined multipack.
+   * 
+ * + * optional int64 multipack = 19; + * + * @return The multipack. + */ + long getMultipack(); + + /** + * + * + *
+   * Whether the item is a merchant-defined bundle. A bundle is a custom
+   * grouping of different products sold by a merchant for a single price.
+   * 
+ * + * optional bool is_bundle = 20; + * + * @return Whether the isBundle field is set. + */ + boolean hasIsBundle(); + /** + * + * + *
+   * Whether the item is a merchant-defined bundle. A bundle is a custom
+   * grouping of different products sold by a merchant for a single price.
+   * 
+ * + * optional bool is_bundle = 20; + * + * @return The isBundle. + */ + boolean getIsBundle(); + + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return Whether the ageGroup field is set. + */ + boolean hasAgeGroup(); + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return The ageGroup. + */ + java.lang.String getAgeGroup(); + /** + * + * + *
+   * Target age group of the item.
+   * 
+ * + * optional string age_group = 21; + * + * @return The bytes for ageGroup. + */ + com.google.protobuf.ByteString getAgeGroupBytes(); + + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return Whether the color field is set. + */ + boolean hasColor(); + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return The color. + */ + java.lang.String getColor(); + /** + * + * + *
+   * Color of the item.
+   * 
+ * + * optional string color = 22; + * + * @return The bytes for color. + */ + com.google.protobuf.ByteString getColorBytes(); + + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return Whether the gender field is set. + */ + boolean hasGender(); + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return The gender. + */ + java.lang.String getGender(); + /** + * + * + *
+   * Target gender of the item.
+   * 
+ * + * optional string gender = 23; + * + * @return The bytes for gender. + */ + com.google.protobuf.ByteString getGenderBytes(); + + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return Whether the material field is set. + */ + boolean hasMaterial(); + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return The material. + */ + java.lang.String getMaterial(); + /** + * + * + *
+   * The material of which the item is made.
+   * 
+ * + * optional string material = 24; + * + * @return The bytes for material. + */ + com.google.protobuf.ByteString getMaterialBytes(); + + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return Whether the pattern field is set. + */ + boolean hasPattern(); + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return The pattern. + */ + java.lang.String getPattern(); + /** + * + * + *
+   * The item's pattern (e.g. polka dots).
+   * 
+ * + * optional string pattern = 25; + * + * @return The bytes for pattern. + */ + com.google.protobuf.ByteString getPatternBytes(); + + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return Whether the size field is set. + */ + boolean hasSize(); + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return The size. + */ + java.lang.String getSize(); + /** + * + * + *
+   * Size of the item. Only one value is allowed. For variants with different
+   * sizes, insert a separate product for each size with the same
+   * `itemGroupId` value (see
+   * [https://support.google.com/merchants/answer/6324492](size definition)).
+   * 
+ * + * optional string size = 26; + * + * @return The bytes for size. + */ + com.google.protobuf.ByteString getSizeBytes(); + + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return Whether the sizeSystem field is set. + */ + boolean hasSizeSystem(); + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return The sizeSystem. + */ + java.lang.String getSizeSystem(); + /** + * + * + *
+   * System in which the size is specified. Recommended for apparel items.
+   * 
+ * + * optional string size_system = 27; + * + * @return The bytes for sizeSystem. + */ + com.google.protobuf.ByteString getSizeSystemBytes(); + + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @return A list containing the sizeTypes. + */ + java.util.List getSizeTypesList(); + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @return The count of sizeTypes. + */ + int getSizeTypesCount(); + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the element to return. + * @return The sizeTypes at the given index. + */ + java.lang.String getSizeTypes(int index); + /** + * + * + *
+   * The cut of the item. It can be used to represent combined size types for
+   * apparel items. Maximum two of size types can be provided (see
+   * [https://support.google.com/merchants/answer/6324497](size type)).
+   * 
+ * + * repeated string size_types = 28; + * + * @param index The index of the value to return. + * @return The bytes of the sizeTypes at the given index. + */ + com.google.protobuf.ByteString getSizeTypesBytes(int index); + + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return Whether the itemGroupId field is set. + */ + boolean hasItemGroupId(); + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return The itemGroupId. + */ + java.lang.String getItemGroupId(); + /** + * + * + *
+   * Shared identifier for all variants of the same product.
+   * 
+ * + * optional string item_group_id = 29; + * + * @return The bytes for itemGroupId. + */ + com.google.protobuf.ByteString getItemGroupIdBytes(); + + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + java.util.List getProductDetailsList(); + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + com.google.shopping.css.v1.ProductDetail getProductDetails(int index); + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + int getProductDetailsCount(); + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + java.util.List + getProductDetailsOrBuilderList(); + /** + * + * + *
+   * Technical specification or additional product details.
+   * 
+ * + * repeated .google.shopping.css.v1.ProductDetail product_details = 30; + */ + com.google.shopping.css.v1.ProductDetailOrBuilder getProductDetailsOrBuilder(int index); + + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return Whether the productWeight field is set. + */ + boolean hasProductWeight(); + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + * + * @return The productWeight. + */ + com.google.shopping.css.v1.ProductWeight getProductWeight(); + /** + * + * + *
+   * The weight of the product in the units provided. The value must be
+   * between 0 (exclusive) and 2000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductWeight product_weight = 31; + */ + com.google.shopping.css.v1.ProductWeightOrBuilder getProductWeightOrBuilder(); + + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return Whether the productLength field is set. + */ + boolean hasProductLength(); + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + * + * @return The productLength. + */ + com.google.shopping.css.v1.ProductDimension getProductLength(); + /** + * + * + *
+   * The length of the product in the units provided. The value must be
+   * between 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_length = 32; + */ + com.google.shopping.css.v1.ProductDimensionOrBuilder getProductLengthOrBuilder(); + + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return Whether the productWidth field is set. + */ + boolean hasProductWidth(); + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + * + * @return The productWidth. + */ + com.google.shopping.css.v1.ProductDimension getProductWidth(); + /** + * + * + *
+   * The width of the product in the units provided. The value must be between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_width = 33; + */ + com.google.shopping.css.v1.ProductDimensionOrBuilder getProductWidthOrBuilder(); + + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return Whether the productHeight field is set. + */ + boolean hasProductHeight(); + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + * + * @return The productHeight. + */ + com.google.shopping.css.v1.ProductDimension getProductHeight(); + /** + * + * + *
+   * The height of the product in the units provided. The value must be
+   * between
+   * 0 (exclusive) and 3000 (inclusive).
+   * 
+ * + * .google.shopping.css.v1.ProductDimension product_height = 34; + */ + com.google.shopping.css.v1.ProductDimensionOrBuilder getProductHeightOrBuilder(); + + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @return A list containing the productHighlights. + */ + java.util.List getProductHighlightsList(); + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @return The count of productHighlights. + */ + int getProductHighlightsCount(); + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the element to return. + * @return The productHighlights at the given index. + */ + java.lang.String getProductHighlights(int index); + /** + * + * + *
+   * Bullet points describing the most relevant highlights of a product.
+   * 
+ * + * repeated string product_highlights = 35; + * + * @param index The index of the value to return. + * @return The bytes of the productHighlights at the given index. + */ + com.google.protobuf.ByteString getProductHighlightsBytes(int index); + + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + java.util.List getCertificationsList(); + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + com.google.shopping.css.v1.Certification getCertifications(int index); + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + int getCertificationsCount(); + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + java.util.List + getCertificationsOrBuilderList(); + /** + * + * + *
+   * A list of certificates claimed by the CSS for the given product.
+   * 
+ * + * repeated .google.shopping.css.v1.Certification certifications = 39; + */ + com.google.shopping.css.v1.CertificationOrBuilder getCertificationsOrBuilder(int index); + + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return Whether the expirationDate field is set. + */ + boolean hasExpirationDate(); + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + * + * @return The expirationDate. + */ + com.google.protobuf.Timestamp getExpirationDate(); + /** + * + * + *
+   * Date on which the item should expire, as specified upon insertion, in
+   * [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual
+   * expiration date in Google Shopping is exposed in `productstatuses` as
+   * [googleExpirationDate](https://support.google.com/merchants/answer/6324499)
+   * and might be earlier if `expirationDate` is too far in the future.
+   * Note: It may take 2+ days from the expiration date for the item to
+   * actually get deleted.
+   * 
+ * + * .google.protobuf.Timestamp expiration_date = 40; + */ + com.google.protobuf.TimestampOrBuilder getExpirationDateOrBuilder(); + + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @return A list containing the includedDestinations. + */ + java.util.List getIncludedDestinationsList(); + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @return The count of includedDestinations. + */ + int getIncludedDestinationsCount(); + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the element to return. + * @return The includedDestinations at the given index. + */ + java.lang.String getIncludedDestinations(int index); + /** + * + * + *
+   * The list of destinations to include for this target (corresponds to
+   * checked check boxes in Merchant Center). Default destinations are always
+   * included unless provided in `excludedDestinations`.
+   * 
+ * + * repeated string included_destinations = 43; + * + * @param index The index of the value to return. + * @return The bytes of the includedDestinations at the given index. + */ + com.google.protobuf.ByteString getIncludedDestinationsBytes(int index); + + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @return A list containing the excludedDestinations. + */ + java.util.List getExcludedDestinationsList(); + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @return The count of excludedDestinations. + */ + int getExcludedDestinationsCount(); + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the element to return. + * @return The excludedDestinations at the given index. + */ + java.lang.String getExcludedDestinations(int index); + /** + * + * + *
+   * The list of destinations to exclude for this target (corresponds to
+   * unchecked check boxes in Merchant Center).
+   * 
+ * + * repeated string excluded_destinations = 44; + * + * @param index The index of the value to return. + * @return The bytes of the excludedDestinations at the given index. + */ + com.google.protobuf.ByteString getExcludedDestinationsBytes(int index); + + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return Whether the pause field is set. + */ + boolean hasPause(); + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return The pause. + */ + java.lang.String getPause(); + /** + * + * + *
+   * Publication of this item will be temporarily paused.
+   * 
+ * + * optional string pause = 45; + * + * @return The bytes for pause. + */ + com.google.protobuf.ByteString getPauseBytes(); + + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return Whether the customLabel0 field is set. + */ + boolean hasCustomLabel0(); + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return The customLabel0. + */ + java.lang.String getCustomLabel0(); + /** + * + * + *
+   * Custom label 0 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_0 = 46; + * + * @return The bytes for customLabel0. + */ + com.google.protobuf.ByteString getCustomLabel0Bytes(); + + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return Whether the customLabel1 field is set. + */ + boolean hasCustomLabel1(); + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return The customLabel1. + */ + java.lang.String getCustomLabel1(); + /** + * + * + *
+   * Custom label 1 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_1 = 47; + * + * @return The bytes for customLabel1. + */ + com.google.protobuf.ByteString getCustomLabel1Bytes(); + + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return Whether the customLabel2 field is set. + */ + boolean hasCustomLabel2(); + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return The customLabel2. + */ + java.lang.String getCustomLabel2(); + /** + * + * + *
+   * Custom label 2 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_2 = 48; + * + * @return The bytes for customLabel2. + */ + com.google.protobuf.ByteString getCustomLabel2Bytes(); + + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return Whether the customLabel3 field is set. + */ + boolean hasCustomLabel3(); + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return The customLabel3. + */ + java.lang.String getCustomLabel3(); + /** + * + * + *
+   * Custom label 3 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_3 = 49; + * + * @return The bytes for customLabel3. + */ + com.google.protobuf.ByteString getCustomLabel3Bytes(); + + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return Whether the customLabel4 field is set. + */ + boolean hasCustomLabel4(); + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return The customLabel4. + */ + java.lang.String getCustomLabel4(); + /** + * + * + *
+   * Custom label 4 for custom grouping of items in a Shopping campaign.
+   * 
+ * + * optional string custom_label_4 = 50; + * + * @return The bytes for customLabel4. + */ + com.google.protobuf.ByteString getCustomLabel4Bytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java new file mode 100644 index 000000000000..5fb3ff9a762c --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/Certification.java @@ -0,0 +1,986 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The certification for the product.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.Certification} + */ +public final class Certification extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.Certification) + CertificationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Certification.newBuilder() to construct. + private Certification(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Certification() { + name_ = ""; + authority_ = ""; + code_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Certification(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Certification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Certification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Certification.class, + com.google.shopping.css.v1.Certification.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Name of the certification.
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * Name of the certification.
+   * 
+ * + * string name = 1; + * + * @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 AUTHORITY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object authority_ = ""; + /** + * + * + *
+   * Name of the certification body.
+   * 
+ * + * string authority = 2; + * + * @return The authority. + */ + @java.lang.Override + public java.lang.String getAuthority() { + java.lang.Object ref = authority_; + 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(); + authority_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the certification body.
+   * 
+ * + * string authority = 2; + * + * @return The bytes for authority. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorityBytes() { + java.lang.Object ref = authority_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authority_ = 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_ = ""; + /** + * + * + *
+   * A unique code to identify the certification.
+   * 
+ * + * string code = 3; + * + * @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; + } + } + /** + * + * + *
+   * A unique code to identify the certification.
+   * 
+ * + * string code = 3; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authority_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, authority_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, code_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authority_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, authority_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, code_); + } + 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.css.v1.Certification)) { + return super.equals(obj); + } + com.google.shopping.css.v1.Certification other = (com.google.shopping.css.v1.Certification) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAuthority().equals(other.getAuthority())) return false; + if (!getCode().equals(other.getCode())) 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) + AUTHORITY_FIELD_NUMBER; + hash = (53 * hash) + getAuthority().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.Certification parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Certification 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.css.v1.Certification parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Certification 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.css.v1.Certification parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.Certification parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.Certification parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Certification 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.css.v1.Certification parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Certification 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.css.v1.Certification parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.Certification 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.css.v1.Certification 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 certification for the product.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.Certification} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.Certification) + com.google.shopping.css.v1.CertificationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Certification_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Certification_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.Certification.class, + com.google.shopping.css.v1.Certification.Builder.class); + } + + // Construct using com.google.shopping.css.v1.Certification.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + authority_ = ""; + code_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_Certification_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.Certification getDefaultInstanceForType() { + return com.google.shopping.css.v1.Certification.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.Certification build() { + com.google.shopping.css.v1.Certification result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.Certification buildPartial() { + com.google.shopping.css.v1.Certification result = + new com.google.shopping.css.v1.Certification(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.Certification result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.authority_ = authority_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.code_ = code_; + } + } + + @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.css.v1.Certification) { + return mergeFrom((com.google.shopping.css.v1.Certification) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.Certification other) { + if (other == com.google.shopping.css.v1.Certification.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthority().isEmpty()) { + authority_ = other.authority_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getCode().isEmpty()) { + code_ = other.code_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + authority_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + code_ = 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 name_ = ""; + /** + * + * + *
+     * Name of the certification.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * Name of the certification.
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * Name of the certification.
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * Name of the certification.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the certification.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object authority_ = ""; + /** + * + * + *
+     * Name of the certification body.
+     * 
+ * + * string authority = 2; + * + * @return The authority. + */ + public java.lang.String getAuthority() { + java.lang.Object ref = authority_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authority_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the certification body.
+     * 
+ * + * string authority = 2; + * + * @return The bytes for authority. + */ + public com.google.protobuf.ByteString getAuthorityBytes() { + java.lang.Object ref = authority_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authority_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the certification body.
+     * 
+ * + * string authority = 2; + * + * @param value The authority to set. + * @return This builder for chaining. + */ + public Builder setAuthority(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authority_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the certification body.
+     * 
+ * + * string authority = 2; + * + * @return This builder for chaining. + */ + public Builder clearAuthority() { + authority_ = getDefaultInstance().getAuthority(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the certification body.
+     * 
+ * + * string authority = 2; + * + * @param value The bytes for authority to set. + * @return This builder for chaining. + */ + public Builder setAuthorityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authority_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object code_ = ""; + /** + * + * + *
+     * A unique code to identify the certification.
+     * 
+ * + * string code = 3; + * + * @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; + } + } + /** + * + * + *
+     * A unique code to identify the certification.
+     * 
+ * + * string code = 3; + * + * @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; + } + } + /** + * + * + *
+     * A unique code to identify the certification.
+     * 
+ * + * string code = 3; + * + * @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; + } + /** + * + * + *
+     * A unique code to identify the certification.
+     * 
+ * + * string code = 3; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A unique code to identify the certification.
+     * 
+ * + * string code = 3; + * + * @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; + } + + @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.css.v1.Certification) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.Certification) + private static final com.google.shopping.css.v1.Certification DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.Certification(); + } + + public static com.google.shopping.css.v1.Certification getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Certification 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.css.v1.Certification getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java new file mode 100644 index 000000000000..5daa64bbc076 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CertificationOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface CertificationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.Certification) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the certification.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Name of the certification.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Name of the certification body.
+   * 
+ * + * string authority = 2; + * + * @return The authority. + */ + java.lang.String getAuthority(); + /** + * + * + *
+   * Name of the certification body.
+   * 
+ * + * string authority = 2; + * + * @return The bytes for authority. + */ + com.google.protobuf.ByteString getAuthorityBytes(); + + /** + * + * + *
+   * A unique code to identify the certification.
+   * 
+ * + * string code = 3; + * + * @return The code. + */ + java.lang.String getCode(); + /** + * + * + *
+   * A unique code to identify the certification.
+   * 
+ * + * string code = 3; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequest.java new file mode 100644 index 000000000000..22d25e8cabed --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequest.java @@ -0,0 +1,935 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the 'CreateAccountLanel' method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.CreateAccountLabelRequest} + */ +public final class CreateAccountLabelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CreateAccountLabelRequest) + CreateAccountLabelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAccountLabelRequest.newBuilder() to construct. + private CreateAccountLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAccountLabelRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAccountLabelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_CreateAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CreateAccountLabelRequest.class, + com.google.shopping.css.v1.CreateAccountLabelRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent account.
+   * 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 parent account.
+   * 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 ACCOUNT_LABEL_FIELD_NUMBER = 2; + private com.google.shopping.css.v1.AccountLabel accountLabel_; + /** + * + * + *
+   * Required. The label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + @java.lang.Override + public boolean hasAccountLabel() { + return accountLabel_ != null; + } + /** + * + * + *
+   * Required. The label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel getAccountLabel() { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + /** + * + * + *
+   * Required. The label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder() { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + + 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 (accountLabel_ != null) { + output.writeMessage(2, getAccountLabel()); + } + 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 (accountLabel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAccountLabel()); + } + 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.css.v1.CreateAccountLabelRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CreateAccountLabelRequest other = + (com.google.shopping.css.v1.CreateAccountLabelRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAccountLabel() != other.hasAccountLabel()) return false; + if (hasAccountLabel()) { + if (!getAccountLabel().equals(other.getAccountLabel())) 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 (hasAccountLabel()) { + hash = (37 * hash) + ACCOUNT_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getAccountLabel().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest 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 'CreateAccountLanel' method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CreateAccountLabelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CreateAccountLabelRequest) + com.google.shopping.css.v1.CreateAccountLabelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_CreateAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CreateAccountLabelRequest.class, + com.google.shopping.css.v1.CreateAccountLabelRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CreateAccountLabelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + accountLabel_ = null; + if (accountLabelBuilder_ != null) { + accountLabelBuilder_.dispose(); + accountLabelBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_CreateAccountLabelRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CreateAccountLabelRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.CreateAccountLabelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CreateAccountLabelRequest build() { + com.google.shopping.css.v1.CreateAccountLabelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CreateAccountLabelRequest buildPartial() { + com.google.shopping.css.v1.CreateAccountLabelRequest result = + new com.google.shopping.css.v1.CreateAccountLabelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.CreateAccountLabelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.accountLabel_ = + accountLabelBuilder_ == null ? accountLabel_ : accountLabelBuilder_.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.css.v1.CreateAccountLabelRequest) { + return mergeFrom((com.google.shopping.css.v1.CreateAccountLabelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.CreateAccountLabelRequest other) { + if (other == com.google.shopping.css.v1.CreateAccountLabelRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasAccountLabel()) { + mergeAccountLabel(other.getAccountLabel()); + } + 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(getAccountLabelFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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.css.v1.AccountLabel accountLabel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + accountLabelBuilder_; + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + public boolean hasAccountLabel() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + public com.google.shopping.css.v1.AccountLabel getAccountLabel() { + if (accountLabelBuilder_ == null) { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } else { + return accountLabelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAccountLabel(com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accountLabel_ = value; + } else { + accountLabelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAccountLabel( + com.google.shopping.css.v1.AccountLabel.Builder builderForValue) { + if (accountLabelBuilder_ == null) { + accountLabel_ = builderForValue.build(); + } else { + accountLabelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAccountLabel(com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && accountLabel_ != null + && accountLabel_ != com.google.shopping.css.v1.AccountLabel.getDefaultInstance()) { + getAccountLabelBuilder().mergeFrom(value); + } else { + accountLabel_ = value; + } + } else { + accountLabelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAccountLabel() { + bitField0_ = (bitField0_ & ~0x00000002); + accountLabel_ = null; + if (accountLabelBuilder_ != null) { + accountLabelBuilder_.dispose(); + accountLabelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.AccountLabel.Builder getAccountLabelBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getAccountLabelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder() { + if (accountLabelBuilder_ != null) { + return accountLabelBuilder_.getMessageOrBuilder(); + } else { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + } + /** + * + * + *
+     * Required. The label to create.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + getAccountLabelFieldBuilder() { + if (accountLabelBuilder_ == null) { + accountLabelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder>( + getAccountLabel(), getParentForChildren(), isClean()); + accountLabel_ = null; + } + return accountLabelBuilder_; + } + + @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.css.v1.CreateAccountLabelRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CreateAccountLabelRequest) + private static final com.google.shopping.css.v1.CreateAccountLabelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CreateAccountLabelRequest(); + } + + public static com.google.shopping.css.v1.CreateAccountLabelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAccountLabelRequest 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.css.v1.CreateAccountLabelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequestOrBuilder.java new file mode 100644 index 000000000000..8e80c8c43dbc --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CreateAccountLabelRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface CreateAccountLabelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CreateAccountLabelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent account.
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent account.
+   * 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 label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + boolean hasAccountLabel(); + /** + * + * + *
+   * Required. The label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + com.google.shopping.css.v1.AccountLabel getAccountLabel(); + /** + * + * + *
+   * Required. The label to create.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProduct.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProduct.java new file mode 100644 index 000000000000..ba72f6f0001d --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProduct.java @@ -0,0 +1,2446 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The processed CSS Product(a.k.a Aggregate Offer internally).
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProduct} + */ +public final class CssProduct extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CssProduct) + CssProductOrBuilder { + private static final long serialVersionUID = 0L; + // Use CssProduct.newBuilder() to construct. + private CssProduct(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CssProduct() { + name_ = ""; + rawProvidedId_ = ""; + contentLanguage_ = ""; + feedLabel_ = ""; + customAttributes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CssProduct(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_CssProduct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_CssProduct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProduct.class, + com.google.shopping.css.v1.CssProduct.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the CSS Product.
+   * Format:
+   * `"accounts/{account}/cssProducts/{css_product}"`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The name of the CSS Product.
+   * Format:
+   * `"accounts/{account}/cssProducts/{css_product}"`
+   * 
+ * + * string name = 1; + * + * @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 RAW_PROVIDED_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object rawProvidedId_ = ""; + /** + * + * + *
+   * Output only. Your unique raw identifier for the product.
+   * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawProvidedId. + */ + @java.lang.Override + public java.lang.String getRawProvidedId() { + java.lang.Object ref = rawProvidedId_; + 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(); + rawProvidedId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Your unique raw identifier for the product.
+   * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for rawProvidedId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawProvidedIdBytes() { + java.lang.Object ref = rawProvidedId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawProvidedId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + /** + * + * + *
+   * Output only. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+   * product.
+   * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+   * product.
+   * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 FEED_LABEL_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + /** + * + * + *
+   * Output only. The feed label for the product.
+   * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The feed label for the product.
+   * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 ATTRIBUTES_FIELD_NUMBER = 5; + private com.google.shopping.css.v1.Attributes attributes_; + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributes field is set. + */ + @java.lang.Override + public boolean hasAttributes() { + return attributes_ != null; + } + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributes. + */ + @java.lang.Override + public com.google.shopping.css.v1.Attributes getAttributes() { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder() { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + + public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private java.util.List customAttributes_; + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getCustomAttributesList() { + return customAttributes_; + } + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getCustomAttributesOrBuilderList() { + return customAttributes_; + } + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getCustomAttributesCount() { + return customAttributes_.size(); + } + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + return customAttributes_.get(index); + } + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index) { + return customAttributes_.get(index); + } + + public static final int CSS_PRODUCT_STATUS_FIELD_NUMBER = 8; + private com.google.shopping.css.v1.CssProductStatus cssProductStatus_; + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the cssProductStatus field is set. + */ + @java.lang.Override + public boolean hasCssProductStatus() { + return cssProductStatus_ != null; + } + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The cssProductStatus. + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus getCssProductStatus() { + return cssProductStatus_ == null + ? com.google.shopping.css.v1.CssProductStatus.getDefaultInstance() + : cssProductStatus_; + } + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatusOrBuilder getCssProductStatusOrBuilder() { + return cssProductStatus_ == null + ? com.google.shopping.css.v1.CssProductStatus.getDefaultInstance() + : cssProductStatus_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawProvidedId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rawProvidedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, contentLanguage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(feedLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, feedLabel_); + } + if (attributes_ != null) { + output.writeMessage(5, getAttributes()); + } + for (int i = 0; i < customAttributes_.size(); i++) { + output.writeMessage(6, customAttributes_.get(i)); + } + if (cssProductStatus_ != null) { + output.writeMessage(8, getCssProductStatus()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawProvidedId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, rawProvidedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, contentLanguage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(feedLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, feedLabel_); + } + if (attributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAttributes()); + } + for (int i = 0; i < customAttributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, customAttributes_.get(i)); + } + if (cssProductStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCssProductStatus()); + } + 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.css.v1.CssProduct)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CssProduct other = (com.google.shopping.css.v1.CssProduct) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRawProvidedId().equals(other.getRawProvidedId())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) return false; + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + if (hasAttributes() != other.hasAttributes()) return false; + if (hasAttributes()) { + if (!getAttributes().equals(other.getAttributes())) return false; + } + if (!getCustomAttributesList().equals(other.getCustomAttributesList())) return false; + if (hasCssProductStatus() != other.hasCssProductStatus()) return false; + if (hasCssProductStatus()) { + if (!getCssProductStatus().equals(other.getCssProductStatus())) 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) + RAW_PROVIDED_ID_FIELD_NUMBER; + hash = (53 * hash) + getRawProvidedId().hashCode(); + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + hash = (37 * hash) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + if (hasAttributes()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributes().hashCode(); + } + if (getCustomAttributesCount() > 0) { + hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getCustomAttributesList().hashCode(); + } + if (hasCssProductStatus()) { + hash = (37 * hash) + CSS_PRODUCT_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getCssProductStatus().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CssProduct parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProduct 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.css.v1.CssProduct parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProduct 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.css.v1.CssProduct parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProduct parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CssProduct parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProduct 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.css.v1.CssProduct parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProduct 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.css.v1.CssProduct parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProduct 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.css.v1.CssProduct 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 processed CSS Product(a.k.a Aggregate Offer internally).
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProduct} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CssProduct) + com.google.shopping.css.v1.CssProductOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_CssProduct_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_CssProduct_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProduct.class, + com.google.shopping.css.v1.CssProduct.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CssProduct.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + rawProvidedId_ = ""; + contentLanguage_ = ""; + feedLabel_ = ""; + attributes_ = null; + if (attributesBuilder_ != null) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + } + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + } else { + customAttributes_ = null; + customAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + cssProductStatus_ = null; + if (cssProductStatusBuilder_ != null) { + cssProductStatusBuilder_.dispose(); + cssProductStatusBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_CssProduct_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProduct getDefaultInstanceForType() { + return com.google.shopping.css.v1.CssProduct.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProduct build() { + com.google.shopping.css.v1.CssProduct result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProduct buildPartial() { + com.google.shopping.css.v1.CssProduct result = + new com.google.shopping.css.v1.CssProduct(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.css.v1.CssProduct result) { + if (customAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + customAttributes_ = java.util.Collections.unmodifiableList(customAttributes_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.customAttributes_ = customAttributes_; + } else { + result.customAttributes_ = customAttributesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.CssProduct result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rawProvidedId_ = rawProvidedId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.contentLanguage_ = contentLanguage_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.feedLabel_ = feedLabel_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.attributes_ = attributesBuilder_ == null ? attributes_ : attributesBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.cssProductStatus_ = + cssProductStatusBuilder_ == null ? cssProductStatus_ : cssProductStatusBuilder_.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.css.v1.CssProduct) { + return mergeFrom((com.google.shopping.css.v1.CssProduct) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.CssProduct other) { + if (other == com.google.shopping.css.v1.CssProduct.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRawProvidedId().isEmpty()) { + rawProvidedId_ = other.rawProvidedId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFeedLabel().isEmpty()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasAttributes()) { + mergeAttributes(other.getAttributes()); + } + if (customAttributesBuilder_ == null) { + if (!other.customAttributes_.isEmpty()) { + if (customAttributes_.isEmpty()) { + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureCustomAttributesIsMutable(); + customAttributes_.addAll(other.customAttributes_); + } + onChanged(); + } + } else { + if (!other.customAttributes_.isEmpty()) { + if (customAttributesBuilder_.isEmpty()) { + customAttributesBuilder_.dispose(); + customAttributesBuilder_ = null; + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000020); + customAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomAttributesFieldBuilder() + : null; + } else { + customAttributesBuilder_.addAllMessages(other.customAttributes_); + } + } + } + if (other.hasCssProductStatus()) { + mergeCssProductStatus(other.getCssProductStatus()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + rawProvidedId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(m); + } else { + customAttributesBuilder_.addMessage(m); + } + break; + } // case 50 + case 66: + { + input.readMessage( + getCssProductStatusFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + 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_ = ""; + /** + * + * + *
+     * The name of the CSS Product.
+     * Format:
+     * `"accounts/{account}/cssProducts/{css_product}"`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the CSS Product.
+     * Format:
+     * `"accounts/{account}/cssProducts/{css_product}"`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the CSS Product.
+     * Format:
+     * `"accounts/{account}/cssProducts/{css_product}"`
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The name of the CSS Product.
+     * Format:
+     * `"accounts/{account}/cssProducts/{css_product}"`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the CSS Product.
+     * Format:
+     * `"accounts/{account}/cssProducts/{css_product}"`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object rawProvidedId_ = ""; + /** + * + * + *
+     * Output only. Your unique raw identifier for the product.
+     * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawProvidedId. + */ + public java.lang.String getRawProvidedId() { + java.lang.Object ref = rawProvidedId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawProvidedId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Your unique raw identifier for the product.
+     * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for rawProvidedId. + */ + public com.google.protobuf.ByteString getRawProvidedIdBytes() { + java.lang.Object ref = rawProvidedId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawProvidedId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Your unique raw identifier for the product.
+     * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The rawProvidedId to set. + * @return This builder for chaining. + */ + public Builder setRawProvidedId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rawProvidedId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Your unique raw identifier for the product.
+     * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRawProvidedId() { + rawProvidedId_ = getDefaultInstance().getRawProvidedId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Your unique raw identifier for the product.
+     * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for rawProvidedId to set. + * @return This builder for chaining. + */ + public Builder setRawProvidedIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rawProvidedId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + /** + * + * + *
+     * Output only. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+     * product.
+     * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+     * product.
+     * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+     * product.
+     * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + /** + * + * + *
+     * Output only. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+     * product.
+     * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+     * product.
+     * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 java.lang.Object feedLabel_ = ""; + /** + * + * + *
+     * Output only. The feed label for the product.
+     * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The feed label for the product.
+     * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The feed label for the product.
+     * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The feed label for the product.
+     * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The feed label for the product.
+     * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.shopping.css.v1.Attributes attributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder> + attributesBuilder_; + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributes field is set. + */ + public boolean hasAttributes() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributes. + */ + public com.google.shopping.css.v1.Attributes getAttributes() { + if (attributesBuilder_ == null) { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } else { + return attributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributes(com.google.shopping.css.v1.Attributes value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributes_ = value; + } else { + attributesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setAttributes(com.google.shopping.css.v1.Attributes.Builder builderForValue) { + if (attributesBuilder_ == null) { + attributes_ = builderForValue.build(); + } else { + attributesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeAttributes(com.google.shopping.css.v1.Attributes value) { + if (attributesBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && attributes_ != null + && attributes_ != com.google.shopping.css.v1.Attributes.getDefaultInstance()) { + getAttributesBuilder().mergeFrom(value); + } else { + attributes_ = value; + } + } else { + attributesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000010); + attributes_ = null; + if (attributesBuilder_ != null) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.css.v1.Attributes.Builder getAttributesBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilder(); + } else { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + } + /** + * + * + *
+     * Output only. A list of product attributes.
+     * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder>( + getAttributes(), getParentForChildren(), isClean()); + attributes_ = null; + } + return attributesBuilder_; + } + + private java.util.List customAttributes_ = + java.util.Collections.emptyList(); + + private void ensureCustomAttributesIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + customAttributes_ = + new java.util.ArrayList(customAttributes_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + customAttributesBuilder_; + + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getCustomAttributesList() { + if (customAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customAttributes_); + } else { + return customAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getCustomAttributesCount() { + if (customAttributesBuilder_ == null) { + return customAttributes_.size(); + } else { + return customAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, value); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCustomAttributes(com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCustomAttributes( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllCustomAttributes( + java.lang.Iterable values) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAttributes_); + onChanged(); + } else { + customAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCustomAttributes() { + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + customAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.remove(index); + onChanged(); + } else { + customAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.type.CustomAttribute.Builder getCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder( + int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCustomAttributesOrBuilderList() { + if (customAttributesBuilder_ != null) { + return customAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customAttributes_); + } + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder() { + return getCustomAttributesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of custom (CSS-provided) attributes. It can also be
+     * used to submit any attribute of the feed specification in its generic form
+     * (for example,
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getCustomAttributesBuilderList() { + return getCustomAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getCustomAttributesFieldBuilder() { + if (customAttributesBuilder_ == null) { + customAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + customAttributes_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + customAttributes_ = null; + } + return customAttributesBuilder_; + } + + private com.google.shopping.css.v1.CssProductStatus cssProductStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus, + com.google.shopping.css.v1.CssProductStatus.Builder, + com.google.shopping.css.v1.CssProductStatusOrBuilder> + cssProductStatusBuilder_; + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the cssProductStatus field is set. + */ + public boolean hasCssProductStatus() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The cssProductStatus. + */ + public com.google.shopping.css.v1.CssProductStatus getCssProductStatus() { + if (cssProductStatusBuilder_ == null) { + return cssProductStatus_ == null + ? com.google.shopping.css.v1.CssProductStatus.getDefaultInstance() + : cssProductStatus_; + } else { + return cssProductStatusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCssProductStatus(com.google.shopping.css.v1.CssProductStatus value) { + if (cssProductStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cssProductStatus_ = value; + } else { + cssProductStatusBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCssProductStatus( + com.google.shopping.css.v1.CssProductStatus.Builder builderForValue) { + if (cssProductStatusBuilder_ == null) { + cssProductStatus_ = builderForValue.build(); + } else { + cssProductStatusBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCssProductStatus(com.google.shopping.css.v1.CssProductStatus value) { + if (cssProductStatusBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && cssProductStatus_ != null + && cssProductStatus_ + != com.google.shopping.css.v1.CssProductStatus.getDefaultInstance()) { + getCssProductStatusBuilder().mergeFrom(value); + } else { + cssProductStatus_ = value; + } + } else { + cssProductStatusBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCssProductStatus() { + bitField0_ = (bitField0_ & ~0x00000040); + cssProductStatus_ = null; + if (cssProductStatusBuilder_ != null) { + cssProductStatusBuilder_.dispose(); + cssProductStatusBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.css.v1.CssProductStatus.Builder getCssProductStatusBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getCssProductStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.css.v1.CssProductStatusOrBuilder getCssProductStatusOrBuilder() { + if (cssProductStatusBuilder_ != null) { + return cssProductStatusBuilder_.getMessageOrBuilder(); + } else { + return cssProductStatus_ == null + ? com.google.shopping.css.v1.CssProductStatus.getDefaultInstance() + : cssProductStatus_; + } + } + /** + * + * + *
+     * Output only. The status of a product, data validation issues, that is,
+     * information about a product computed asynchronously.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus, + com.google.shopping.css.v1.CssProductStatus.Builder, + com.google.shopping.css.v1.CssProductStatusOrBuilder> + getCssProductStatusFieldBuilder() { + if (cssProductStatusBuilder_ == null) { + cssProductStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus, + com.google.shopping.css.v1.CssProductStatus.Builder, + com.google.shopping.css.v1.CssProductStatusOrBuilder>( + getCssProductStatus(), getParentForChildren(), isClean()); + cssProductStatus_ = null; + } + return cssProductStatusBuilder_; + } + + @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.css.v1.CssProduct) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CssProduct) + private static final com.google.shopping.css.v1.CssProduct DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CssProduct(); + } + + public static com.google.shopping.css.v1.CssProduct getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CssProduct 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.css.v1.CssProduct getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductCommonProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductCommonProto.java new file mode 100644 index 000000000000..84ee233a4e54 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductCommonProto.java @@ -0,0 +1,333 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public final class CssProductCommonProto { + private CssProductCommonProto() {} + + 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_css_v1_Attributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_Attributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_Certification_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_Certification_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ProductDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ProductDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ProductDimension_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ProductDimension_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ProductWeight_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ProductWeight_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_CssProductStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CssProductStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_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/css/v1/css_product_com" + + "mon.proto\022\026google.shopping.css.v1\032\037googl" + + "e/api/field_behavior.proto\032\037google/proto" + + "buf/timestamp.proto\032 google/shopping/typ" + + "e/types.proto\"\351\020\n\nAttributes\022\025\n\010cpp_link" + + "\030\001 \001(\tH\000\210\001\001\022\034\n\017cpp_mobile_link\030\002 \001(\tH\001\210\001" + + "\001\022\035\n\020cpp_ads_redirect\030* \001(\tH\002\210\001\001\022.\n\tlow_" + + "price\030\003 \001(\0132\033.google.shopping.type.Price" + + "\022/\n\nhigh_price\030\004 \001(\0132\033.google.shopping.t" + + "ype.Price\022\035\n\020number_of_offers\030\005 \001(\003H\003\210\001\001" + + "\022%\n\030headline_offer_condition\030\006 \001(\tH\004\210\001\001\022" + + "9\n\024headline_offer_price\030\007 \001(\0132\033.google.s" + + "hopping.type.Price\022 \n\023headline_offer_lin" + + "k\030\010 \001(\tH\005\210\001\001\022\'\n\032headline_offer_mobile_li" + + "nk\030\t \001(\tH\006\210\001\001\022B\n\035headline_offer_shipping" + + "_price\030) \001(\0132\033.google.shopping.type.Pric" + + "e\022\022\n\005title\030\n \001(\tH\007\210\001\001\022\027\n\nimage_link\030\013 \001(" + + "\tH\010\210\001\001\022\036\n\026additional_image_links\030\014 \003(\t\022\030" + + "\n\013description\030\r \001(\tH\t\210\001\001\022\022\n\005brand\030\016 \001(\tH" + + "\n\210\001\001\022\020\n\003mpn\030\017 \001(\tH\013\210\001\001\022\021\n\004gtin\030\020 \001(\tH\014\210\001" + + "\001\022\025\n\rproduct_types\030$ \003(\t\022$\n\027google_produ" + + "ct_category\030\021 \001(\tH\r\210\001\001\022\022\n\005adult\030\022 \001(\010H\016\210" + + "\001\001\022\026\n\tmultipack\030\023 \001(\003H\017\210\001\001\022\026\n\tis_bundle\030" + + "\024 \001(\010H\020\210\001\001\022\026\n\tage_group\030\025 \001(\tH\021\210\001\001\022\022\n\005co" + + "lor\030\026 \001(\tH\022\210\001\001\022\023\n\006gender\030\027 \001(\tH\023\210\001\001\022\025\n\010m" + + "aterial\030\030 \001(\tH\024\210\001\001\022\024\n\007pattern\030\031 \001(\tH\025\210\001\001" + + "\022\021\n\004size\030\032 \001(\tH\026\210\001\001\022\030\n\013size_system\030\033 \001(\t" + + "H\027\210\001\001\022\022\n\nsize_types\030\034 \003(\t\022\032\n\ritem_group_" + + "id\030\035 \001(\tH\030\210\001\001\022>\n\017product_details\030\036 \003(\0132%" + + ".google.shopping.css.v1.ProductDetail\022=\n" + + "\016product_weight\030\037 \001(\0132%.google.shopping." + + "css.v1.ProductWeight\022@\n\016product_length\030 " + + " \001(\0132(.google.shopping.css.v1.ProductDim" + + "ension\022?\n\rproduct_width\030! \001(\0132(.google.s" + + "hopping.css.v1.ProductDimension\022@\n\016produ" + + "ct_height\030\" \001(\0132(.google.shopping.css.v1" + + ".ProductDimension\022\032\n\022product_highlights\030" + + "# \003(\t\022=\n\016certifications\030\' \003(\0132%.google.s" + + "hopping.css.v1.Certification\0223\n\017expirati" + + "on_date\030( \001(\0132\032.google.protobuf.Timestam" + + "p\022\035\n\025included_destinations\030+ \003(\t\022\035\n\025excl" + + "uded_destinations\030, \003(\t\022\022\n\005pause\030- \001(\tH\031" + + "\210\001\001\022\033\n\016custom_label_0\030. \001(\tH\032\210\001\001\022\033\n\016cust" + + "om_label_1\030/ \001(\tH\033\210\001\001\022\033\n\016custom_label_2\030" + + "0 \001(\tH\034\210\001\001\022\033\n\016custom_label_3\0301 \001(\tH\035\210\001\001\022" + + "\033\n\016custom_label_4\0302 \001(\tH\036\210\001\001B\013\n\t_cpp_lin" + + "kB\022\n\020_cpp_mobile_linkB\023\n\021_cpp_ads_redire" + + "ctB\023\n\021_number_of_offersB\033\n\031_headline_off" + + "er_conditionB\026\n\024_headline_offer_linkB\035\n\033" + + "_headline_offer_mobile_linkB\010\n\006_titleB\r\n" + + "\013_image_linkB\016\n\014_descriptionB\010\n\006_brandB\006" + + "\n\004_mpnB\007\n\005_gtinB\032\n\030_google_product_categ" + + "oryB\010\n\006_adultB\014\n\n_multipackB\014\n\n_is_bundl" + + "eB\014\n\n_age_groupB\010\n\006_colorB\t\n\007_genderB\013\n\t" + + "_materialB\n\n\010_patternB\007\n\005_sizeB\016\n\014_size_" + + "systemB\020\n\016_item_group_idB\010\n\006_pauseB\021\n\017_c" + + "ustom_label_0B\021\n\017_custom_label_1B\021\n\017_cus" + + "tom_label_2B\021\n\017_custom_label_3B\021\n\017_custo" + + "m_label_4\">\n\rCertification\022\014\n\004name\030\001 \001(\t" + + "\022\021\n\tauthority\030\002 \001(\t\022\014\n\004code\030\003 \001(\t\"V\n\rPro" + + "ductDetail\022\024\n\014section_name\030\001 \001(\t\022\026\n\016attr" + + "ibute_name\030\002 \001(\t\022\027\n\017attribute_value\030\003 \001(" + + "\t\";\n\020ProductDimension\022\023\n\005value\030\001 \001(\001B\004\342A" + + "\001\002\022\022\n\004unit\030\002 \001(\tB\004\342A\001\002\"8\n\rProductWeight\022" + + "\023\n\005value\030\001 \001(\001B\004\342A\001\002\022\022\n\004unit\030\002 \001(\tB\004\342A\001\002" + + "\"\261\005\n\020CssProductStatus\022X\n\024destination_sta" + + "tuses\030\003 \003(\0132:.google.shopping.css.v1.Css" + + "ProductStatus.DestinationStatus\022R\n\021item_" + + "level_issues\030\004 \003(\01327.google.shopping.css" + + ".v1.CssProductStatus.ItemLevelIssue\0221\n\rc" + + "reation_date\030\005 \001(\0132\032.google.protobuf.Tim" + + "estamp\0224\n\020last_update_date\030\006 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022:\n\026google_expiratio" + + "n_date\030\007 \001(\0132\032.google.protobuf.Timestamp" + + "\032~\n\021DestinationStatus\022\023\n\013destination\030\001 \001" + + "(\t\022\032\n\022approved_countries\030\002 \003(\t\022\031\n\021pendin" + + "g_countries\030\003 \003(\t\022\035\n\025disapproved_countri" + + "es\030\004 \003(\t\032\311\001\n\016ItemLevelIssue\022\014\n\004code\030\001 \001(" + + "\t\022\023\n\013servability\030\002 \001(\t\022\022\n\nresolution\030\003 \001" + + "(\t\022\021\n\tattribute\030\004 \001(\t\022\023\n\013destination\030\005 \001" + + "(\t\022\023\n\013description\030\006 \001(\t\022\016\n\006detail\030\007 \001(\t\022" + + "\025\n\rdocumentation\030\010 \001(\t\022\034\n\024applicable_cou" + + "ntries\030\t \003(\tB\267\001\n\032com.google.shopping.css" + + ".v1B\025CssProductCommonProtoP\001Z2cloud.goog" + + "le.com/go/shopping/css/apiv1/csspb;csspb" + + "\252\002\026Google.Shopping.Css.V1\312\002\026Google\\Shopp" + + "ing\\Css\\V1\352\002\031Google::Shopping::Css::V1b\006" + + "proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + }); + internal_static_google_shopping_css_v1_Attributes_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_css_v1_Attributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_Attributes_descriptor, + new java.lang.String[] { + "CppLink", + "CppMobileLink", + "CppAdsRedirect", + "LowPrice", + "HighPrice", + "NumberOfOffers", + "HeadlineOfferCondition", + "HeadlineOfferPrice", + "HeadlineOfferLink", + "HeadlineOfferMobileLink", + "HeadlineOfferShippingPrice", + "Title", + "ImageLink", + "AdditionalImageLinks", + "Description", + "Brand", + "Mpn", + "Gtin", + "ProductTypes", + "GoogleProductCategory", + "Adult", + "Multipack", + "IsBundle", + "AgeGroup", + "Color", + "Gender", + "Material", + "Pattern", + "Size", + "SizeSystem", + "SizeTypes", + "ItemGroupId", + "ProductDetails", + "ProductWeight", + "ProductLength", + "ProductWidth", + "ProductHeight", + "ProductHighlights", + "Certifications", + "ExpirationDate", + "IncludedDestinations", + "ExcludedDestinations", + "Pause", + "CustomLabel0", + "CustomLabel1", + "CustomLabel2", + "CustomLabel3", + "CustomLabel4", + "CppLink", + "CppMobileLink", + "CppAdsRedirect", + "NumberOfOffers", + "HeadlineOfferCondition", + "HeadlineOfferLink", + "HeadlineOfferMobileLink", + "Title", + "ImageLink", + "Description", + "Brand", + "Mpn", + "Gtin", + "GoogleProductCategory", + "Adult", + "Multipack", + "IsBundle", + "AgeGroup", + "Color", + "Gender", + "Material", + "Pattern", + "Size", + "SizeSystem", + "ItemGroupId", + "Pause", + "CustomLabel0", + "CustomLabel1", + "CustomLabel2", + "CustomLabel3", + "CustomLabel4", + }); + internal_static_google_shopping_css_v1_Certification_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_css_v1_Certification_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_Certification_descriptor, + new java.lang.String[] { + "Name", "Authority", "Code", + }); + internal_static_google_shopping_css_v1_ProductDetail_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_css_v1_ProductDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ProductDetail_descriptor, + new java.lang.String[] { + "SectionName", "AttributeName", "AttributeValue", + }); + internal_static_google_shopping_css_v1_ProductDimension_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_css_v1_ProductDimension_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ProductDimension_descriptor, + new java.lang.String[] { + "Value", "Unit", + }); + internal_static_google_shopping_css_v1_ProductWeight_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_css_v1_ProductWeight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ProductWeight_descriptor, + new java.lang.String[] { + "Value", "Unit", + }); + internal_static_google_shopping_css_v1_CssProductStatus_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_shopping_css_v1_CssProductStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CssProductStatus_descriptor, + new java.lang.String[] { + "DestinationStatuses", + "ItemLevelIssues", + "CreationDate", + "LastUpdateDate", + "GoogleExpirationDate", + }); + internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor = + internal_static_google_shopping_css_v1_CssProductStatus_descriptor.getNestedTypes().get(0); + internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor, + new java.lang.String[] { + "Destination", "ApprovedCountries", "PendingCountries", "DisapprovedCountries", + }); + internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor = + internal_static_google_shopping_css_v1_CssProductStatus_descriptor.getNestedTypes().get(1); + internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor, + new java.lang.String[] { + "Code", + "Servability", + "Resolution", + "Attribute", + "Destination", + "Description", + "Detail", + "Documentation", + "ApplicableCountries", + }); + 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.protobuf.TimestampProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInput.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInput.java new file mode 100644 index 000000000000..8d3b24b1fb63 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInput.java @@ -0,0 +1,2794 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * This resource represents input data you submit for a CSS Product, not
+ * the processed CSS Product that you see in CSS Center, in Shopping Ads, or
+ * across Google surfaces.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductInput} + */ +public final class CssProductInput extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CssProductInput) + CssProductInputOrBuilder { + private static final long serialVersionUID = 0L; + // Use CssProductInput.newBuilder() to construct. + private CssProductInput(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CssProductInput() { + name_ = ""; + finalName_ = ""; + rawProvidedId_ = ""; + contentLanguage_ = ""; + feedLabel_ = ""; + customAttributes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CssProductInput(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_CssProductInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_CssProductInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductInput.class, + com.google.shopping.css.v1.CssProductInput.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the CSS Product input.
+   * Format:
+   * `accounts/{account}/cssProductInputs/{css_product_input}`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The name of the CSS Product input.
+   * Format:
+   * `accounts/{account}/cssProductInputs/{css_product_input}`
+   * 
+ * + * string name = 1; + * + * @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 FINAL_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object finalName_ = ""; + /** + * + * + *
+   * Output only. The name of the processed CSS Product.
+   * Format:
+   * `accounts/{account}/cssProducts/{css_product}`
+   * "
+   * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finalName. + */ + @java.lang.Override + public java.lang.String getFinalName() { + java.lang.Object ref = finalName_; + 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(); + finalName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the processed CSS Product.
+   * Format:
+   * `accounts/{account}/cssProducts/{css_product}`
+   * "
+   * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finalName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFinalNameBytes() { + java.lang.Object ref = finalName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RAW_PROVIDED_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object rawProvidedId_ = ""; + /** + * + * + *
+   * Required. Your unique identifier for the CSS Product. This is the same for
+   * the CSS Product input and processed CSS Product. We only allow ids with
+   * alphanumerics, underscores and dashes. See the [products feed
+   * specification](https://support.google.com/merchants/answer/188494#id) for
+   * details.
+   * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rawProvidedId. + */ + @java.lang.Override + public java.lang.String getRawProvidedId() { + java.lang.Object ref = rawProvidedId_; + 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(); + rawProvidedId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Your unique identifier for the CSS Product. This is the same for
+   * the CSS Product input and processed CSS Product. We only allow ids with
+   * alphanumerics, underscores and dashes. See the [products feed
+   * specification](https://support.google.com/merchants/answer/188494#id) for
+   * details.
+   * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for rawProvidedId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRawProvidedIdBytes() { + java.lang.Object ref = rawProvidedId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawProvidedId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object contentLanguage_ = ""; + /** + * + * + *
+   * Required. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+   * Product.
+   * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+   * Product.
+   * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 FEED_LABEL_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object feedLabel_ = ""; + /** + * + * + *
+   * Required. The [feed
+   * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+   * for the CSS Product.
+   * Feed Label is synonymous to "target country" and hence should always be a
+   * valid region code. For example: 'DE' for Germany, 'FR' for France.
+   * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The [feed
+   * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+   * for the CSS Product.
+   * Feed Label is synonymous to "target country" and hence should always be a
+   * valid region code. For example: 'DE' for Germany, 'FR' for France.
+   * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 FRESHNESS_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp freshnessTime_; + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return Whether the freshnessTime field is set. + */ + @java.lang.Override + public boolean hasFreshnessTime() { + return freshnessTime_ != null; + } + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return The freshnessTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getFreshnessTime() { + return freshnessTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : freshnessTime_; + } + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getFreshnessTimeOrBuilder() { + return freshnessTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : freshnessTime_; + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 7; + private com.google.shopping.css.v1.Attributes attributes_; + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return Whether the attributes field is set. + */ + @java.lang.Override + public boolean hasAttributes() { + return attributes_ != null; + } + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return The attributes. + */ + @java.lang.Override + public com.google.shopping.css.v1.Attributes getAttributes() { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + @java.lang.Override + public com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder() { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + + public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List customAttributes_; + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public java.util.List getCustomAttributesList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public java.util.List + getCustomAttributesOrBuilderList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public int getCustomAttributesCount() { + return customAttributes_.size(); + } + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + return customAttributes_.get(index); + } + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index) { + return customAttributes_.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(finalName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, finalName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawProvidedId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, rawProvidedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, contentLanguage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(feedLabel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, feedLabel_); + } + if (freshnessTime_ != null) { + output.writeMessage(6, getFreshnessTime()); + } + if (attributes_ != null) { + output.writeMessage(7, getAttributes()); + } + for (int i = 0; i < customAttributes_.size(); i++) { + output.writeMessage(8, customAttributes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(finalName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, finalName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rawProvidedId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, rawProvidedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(contentLanguage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, contentLanguage_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(feedLabel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, feedLabel_); + } + if (freshnessTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getFreshnessTime()); + } + if (attributes_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getAttributes()); + } + for (int i = 0; i < customAttributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, customAttributes_.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.css.v1.CssProductInput)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CssProductInput other = + (com.google.shopping.css.v1.CssProductInput) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFinalName().equals(other.getFinalName())) return false; + if (!getRawProvidedId().equals(other.getRawProvidedId())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) return false; + if (!getFeedLabel().equals(other.getFeedLabel())) return false; + if (hasFreshnessTime() != other.hasFreshnessTime()) return false; + if (hasFreshnessTime()) { + if (!getFreshnessTime().equals(other.getFreshnessTime())) return false; + } + if (hasAttributes() != other.hasAttributes()) return false; + if (hasAttributes()) { + if (!getAttributes().equals(other.getAttributes())) return false; + } + if (!getCustomAttributesList().equals(other.getCustomAttributesList())) 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) + FINAL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFinalName().hashCode(); + hash = (37 * hash) + RAW_PROVIDED_ID_FIELD_NUMBER; + hash = (53 * hash) + getRawProvidedId().hashCode(); + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + hash = (37 * hash) + FEED_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getFeedLabel().hashCode(); + if (hasFreshnessTime()) { + hash = (37 * hash) + FRESHNESS_TIME_FIELD_NUMBER; + hash = (53 * hash) + getFreshnessTime().hashCode(); + } + if (hasAttributes()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getAttributes().hashCode(); + } + if (getCustomAttributesCount() > 0) { + hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getCustomAttributesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CssProductInput parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductInput 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.css.v1.CssProductInput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductInput 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.css.v1.CssProductInput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductInput parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CssProductInput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductInput 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.css.v1.CssProductInput parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductInput 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.css.v1.CssProductInput parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductInput 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.css.v1.CssProductInput 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; + } + /** + * + * + *
+   * This resource represents input data you submit for a CSS Product, not
+   * the processed CSS Product that you see in CSS Center, in Shopping Ads, or
+   * across Google surfaces.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductInput} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CssProductInput) + com.google.shopping.css.v1.CssProductInputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_CssProductInput_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_CssProductInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductInput.class, + com.google.shopping.css.v1.CssProductInput.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CssProductInput.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + finalName_ = ""; + rawProvidedId_ = ""; + contentLanguage_ = ""; + feedLabel_ = ""; + freshnessTime_ = null; + if (freshnessTimeBuilder_ != null) { + freshnessTimeBuilder_.dispose(); + freshnessTimeBuilder_ = null; + } + attributes_ = null; + if (attributesBuilder_ != null) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + } + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + } else { + customAttributes_ = null; + customAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_CssProductInput_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductInput getDefaultInstanceForType() { + return com.google.shopping.css.v1.CssProductInput.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductInput build() { + com.google.shopping.css.v1.CssProductInput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductInput buildPartial() { + com.google.shopping.css.v1.CssProductInput result = + new com.google.shopping.css.v1.CssProductInput(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.css.v1.CssProductInput result) { + if (customAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + customAttributes_ = java.util.Collections.unmodifiableList(customAttributes_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.customAttributes_ = customAttributes_; + } else { + result.customAttributes_ = customAttributesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.CssProductInput result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.finalName_ = finalName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rawProvidedId_ = rawProvidedId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.contentLanguage_ = contentLanguage_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.feedLabel_ = feedLabel_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.freshnessTime_ = + freshnessTimeBuilder_ == null ? freshnessTime_ : freshnessTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.attributes_ = attributesBuilder_ == null ? attributes_ : attributesBuilder_.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.css.v1.CssProductInput) { + return mergeFrom((com.google.shopping.css.v1.CssProductInput) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.CssProductInput other) { + if (other == com.google.shopping.css.v1.CssProductInput.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFinalName().isEmpty()) { + finalName_ = other.finalName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRawProvidedId().isEmpty()) { + rawProvidedId_ = other.rawProvidedId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getFeedLabel().isEmpty()) { + feedLabel_ = other.feedLabel_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasFreshnessTime()) { + mergeFreshnessTime(other.getFreshnessTime()); + } + if (other.hasAttributes()) { + mergeAttributes(other.getAttributes()); + } + if (customAttributesBuilder_ == null) { + if (!other.customAttributes_.isEmpty()) { + if (customAttributes_.isEmpty()) { + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureCustomAttributesIsMutable(); + customAttributes_.addAll(other.customAttributes_); + } + onChanged(); + } + } else { + if (!other.customAttributes_.isEmpty()) { + if (customAttributesBuilder_.isEmpty()) { + customAttributesBuilder_.dispose(); + customAttributesBuilder_ = null; + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000080); + customAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomAttributesFieldBuilder() + : null; + } else { + customAttributesBuilder_.addAllMessages(other.customAttributes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + finalName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + rawProvidedId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + contentLanguage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + feedLabel_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getFreshnessTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage(getAttributesFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(m); + } else { + customAttributesBuilder_.addMessage(m); + } + 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_ = ""; + /** + * + * + *
+     * The name of the CSS Product input.
+     * Format:
+     * `accounts/{account}/cssProductInputs/{css_product_input}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the CSS Product input.
+     * Format:
+     * `accounts/{account}/cssProductInputs/{css_product_input}`
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the CSS Product input.
+     * Format:
+     * `accounts/{account}/cssProductInputs/{css_product_input}`
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The name of the CSS Product input.
+     * Format:
+     * `accounts/{account}/cssProductInputs/{css_product_input}`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the CSS Product input.
+     * Format:
+     * `accounts/{account}/cssProductInputs/{css_product_input}`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object finalName_ = ""; + /** + * + * + *
+     * Output only. The name of the processed CSS Product.
+     * Format:
+     * `accounts/{account}/cssProducts/{css_product}`
+     * "
+     * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finalName. + */ + public java.lang.String getFinalName() { + java.lang.Object ref = finalName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the processed CSS Product.
+     * Format:
+     * `accounts/{account}/cssProducts/{css_product}`
+     * "
+     * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finalName. + */ + public com.google.protobuf.ByteString getFinalNameBytes() { + java.lang.Object ref = finalName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the processed CSS Product.
+     * Format:
+     * `accounts/{account}/cssProducts/{css_product}`
+     * "
+     * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The finalName to set. + * @return This builder for chaining. + */ + public Builder setFinalName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + finalName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the processed CSS Product.
+     * Format:
+     * `accounts/{account}/cssProducts/{css_product}`
+     * "
+     * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFinalName() { + finalName_ = getDefaultInstance().getFinalName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the processed CSS Product.
+     * Format:
+     * `accounts/{account}/cssProducts/{css_product}`
+     * "
+     * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for finalName to set. + * @return This builder for chaining. + */ + public Builder setFinalNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + finalName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object rawProvidedId_ = ""; + /** + * + * + *
+     * Required. Your unique identifier for the CSS Product. This is the same for
+     * the CSS Product input and processed CSS Product. We only allow ids with
+     * alphanumerics, underscores and dashes. See the [products feed
+     * specification](https://support.google.com/merchants/answer/188494#id) for
+     * details.
+     * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rawProvidedId. + */ + public java.lang.String getRawProvidedId() { + java.lang.Object ref = rawProvidedId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + rawProvidedId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Your unique identifier for the CSS Product. This is the same for
+     * the CSS Product input and processed CSS Product. We only allow ids with
+     * alphanumerics, underscores and dashes. See the [products feed
+     * specification](https://support.google.com/merchants/answer/188494#id) for
+     * details.
+     * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for rawProvidedId. + */ + public com.google.protobuf.ByteString getRawProvidedIdBytes() { + java.lang.Object ref = rawProvidedId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + rawProvidedId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Your unique identifier for the CSS Product. This is the same for
+     * the CSS Product input and processed CSS Product. We only allow ids with
+     * alphanumerics, underscores and dashes. See the [products feed
+     * specification](https://support.google.com/merchants/answer/188494#id) for
+     * details.
+     * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The rawProvidedId to set. + * @return This builder for chaining. + */ + public Builder setRawProvidedId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + rawProvidedId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Your unique identifier for the CSS Product. This is the same for
+     * the CSS Product input and processed CSS Product. We only allow ids with
+     * alphanumerics, underscores and dashes. See the [products feed
+     * specification](https://support.google.com/merchants/answer/188494#id) for
+     * details.
+     * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRawProvidedId() { + rawProvidedId_ = getDefaultInstance().getRawProvidedId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Your unique identifier for the CSS Product. This is the same for
+     * the CSS Product input and processed CSS Product. We only allow ids with
+     * alphanumerics, underscores and dashes. See the [products feed
+     * specification](https://support.google.com/merchants/answer/188494#id) for
+     * details.
+     * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for rawProvidedId to set. + * @return This builder for chaining. + */ + public Builder setRawProvidedIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + rawProvidedId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object contentLanguage_ = ""; + /** + * + * + *
+     * Required. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+     * Product.
+     * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+     * Product.
+     * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+     * Product.
+     * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+     * Product.
+     * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + contentLanguage_ = getDefaultInstance().getContentLanguage(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The two-letter [ISO
+     * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+     * Product.
+     * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object feedLabel_ = ""; + /** + * + * + *
+     * Required. The [feed
+     * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+     * for the CSS Product.
+     * Feed Label is synonymous to "target country" and hence should always be a
+     * valid region code. For example: 'DE' for Germany, 'FR' for France.
+     * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The [feed
+     * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+     * for the CSS Product.
+     * Feed Label is synonymous to "target country" and hence should always be a
+     * valid region code. For example: 'DE' for Germany, 'FR' for France.
+     * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. The [feed
+     * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+     * for the CSS Product.
+     * Feed Label is synonymous to "target country" and hence should always be a
+     * valid region code. For example: 'DE' for Germany, 'FR' for France.
+     * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [feed
+     * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+     * for the CSS Product.
+     * Feed Label is synonymous to "target country" and hence should always be a
+     * valid region code. For example: 'DE' for Germany, 'FR' for France.
+     * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFeedLabel() { + feedLabel_ = getDefaultInstance().getFeedLabel(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The [feed
+     * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+     * for the CSS Product.
+     * Feed Label is synonymous to "target country" and hence should always be a
+     * valid region code. For example: 'DE' for Germany, 'FR' for France.
+     * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp freshnessTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + freshnessTimeBuilder_; + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return Whether the freshnessTime field is set. + */ + public boolean hasFreshnessTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return The freshnessTime. + */ + public com.google.protobuf.Timestamp getFreshnessTime() { + if (freshnessTimeBuilder_ == null) { + return freshnessTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : freshnessTime_; + } else { + return freshnessTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public Builder setFreshnessTime(com.google.protobuf.Timestamp value) { + if (freshnessTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + freshnessTime_ = value; + } else { + freshnessTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public Builder setFreshnessTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (freshnessTimeBuilder_ == null) { + freshnessTime_ = builderForValue.build(); + } else { + freshnessTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public Builder mergeFreshnessTime(com.google.protobuf.Timestamp value) { + if (freshnessTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && freshnessTime_ != null + && freshnessTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFreshnessTimeBuilder().mergeFrom(value); + } else { + freshnessTime_ = value; + } + } else { + freshnessTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public Builder clearFreshnessTime() { + bitField0_ = (bitField0_ & ~0x00000020); + freshnessTime_ = null; + if (freshnessTimeBuilder_ != null) { + freshnessTimeBuilder_.dispose(); + freshnessTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getFreshnessTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getFreshnessTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getFreshnessTimeOrBuilder() { + if (freshnessTimeBuilder_ != null) { + return freshnessTimeBuilder_.getMessageOrBuilder(); + } else { + return freshnessTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : freshnessTime_; + } + } + /** + * + * + *
+     * Represents the existing version (freshness) of the CSS Product, which
+     * can be used to preserve the right order when multiple updates are done at
+     * the same time.
+     *
+     * This field must not be set to the future time.
+     *
+     * If set, the update is prevented if a newer version of the item already
+     * exists in our system (that is the last update time of the existing
+     * CSS products is later than the freshness time set in the update). If
+     * the update happens, the last update time is then set to this freshness
+     * time.
+     *
+     * If not set, the update will not be prevented and the last update time will
+     * default to when this request was received by the CSS API.
+     *
+     * If the operation is prevented, the aborted exception will be
+     * thrown.
+     * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getFreshnessTimeFieldBuilder() { + if (freshnessTimeBuilder_ == null) { + freshnessTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFreshnessTime(), getParentForChildren(), isClean()); + freshnessTime_ = null; + } + return freshnessTimeBuilder_; + } + + private com.google.shopping.css.v1.Attributes attributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder> + attributesBuilder_; + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return Whether the attributes field is set. + */ + public boolean hasAttributes() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return The attributes. + */ + public com.google.shopping.css.v1.Attributes getAttributes() { + if (attributesBuilder_ == null) { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } else { + return attributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public Builder setAttributes(com.google.shopping.css.v1.Attributes value) { + if (attributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attributes_ = value; + } else { + attributesBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public Builder setAttributes(com.google.shopping.css.v1.Attributes.Builder builderForValue) { + if (attributesBuilder_ == null) { + attributes_ = builderForValue.build(); + } else { + attributesBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public Builder mergeAttributes(com.google.shopping.css.v1.Attributes value) { + if (attributesBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && attributes_ != null + && attributes_ != com.google.shopping.css.v1.Attributes.getDefaultInstance()) { + getAttributesBuilder().mergeFrom(value); + } else { + attributes_ = value; + } + } else { + attributesBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public Builder clearAttributes() { + bitField0_ = (bitField0_ & ~0x00000040); + attributes_ = null; + if (attributesBuilder_ != null) { + attributesBuilder_.dispose(); + attributesBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public com.google.shopping.css.v1.Attributes.Builder getAttributesBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + public com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder() { + if (attributesBuilder_ != null) { + return attributesBuilder_.getMessageOrBuilder(); + } else { + return attributes_ == null + ? com.google.shopping.css.v1.Attributes.getDefaultInstance() + : attributes_; + } + } + /** + * + * + *
+     * A list of CSS Product attributes.
+     * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder> + getAttributesFieldBuilder() { + if (attributesBuilder_ == null) { + attributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.Attributes, + com.google.shopping.css.v1.Attributes.Builder, + com.google.shopping.css.v1.AttributesOrBuilder>( + getAttributes(), getParentForChildren(), isClean()); + attributes_ = null; + } + return attributesBuilder_; + } + + private java.util.List customAttributes_ = + java.util.Collections.emptyList(); + + private void ensureCustomAttributesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + customAttributes_ = + new java.util.ArrayList(customAttributes_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + customAttributesBuilder_; + + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List getCustomAttributesList() { + if (customAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customAttributes_); + } else { + return customAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public int getCustomAttributesCount() { + if (customAttributesBuilder_ == null) { + return customAttributes_.size(); + } else { + return customAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder setCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, value); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder setCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes(com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addAllCustomAttributes( + java.lang.Iterable values) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAttributes_); + onChanged(); + } else { + customAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder clearCustomAttributes() { + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + customAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder removeCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.remove(index); + onChanged(); + } else { + customAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder getCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder( + int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List + getCustomAttributesOrBuilderList() { + if (customAttributesBuilder_ != null) { + return customAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customAttributes_); + } + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder() { + return getCustomAttributesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (CSS-provided) attributes. It can also be used for
+     * submitting any attribute of the feed specification in its generic
+     * form (for example:
+     * `{ "name": "size type", "value": "regular" }`).
+     * This is useful for submitting attributes not explicitly exposed by the
+     * API, such as additional attributes used for Buy on Google.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List + getCustomAttributesBuilderList() { + return getCustomAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getCustomAttributesFieldBuilder() { + if (customAttributesBuilder_ == null) { + customAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + customAttributes_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + customAttributes_ = null; + } + return customAttributesBuilder_; + } + + @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.css.v1.CssProductInput) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CssProductInput) + private static final com.google.shopping.css.v1.CssProductInput DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CssProductInput(); + } + + public static com.google.shopping.css.v1.CssProductInput getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CssProductInput 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.css.v1.CssProductInput getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputName.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputName.java new file mode 100644 index 000000000000..c28327252507 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputName.java @@ -0,0 +1,194 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 CssProductInputName implements ResourceName { + private static final PathTemplate ACCOUNT_CSS_PRODUCT_INPUT = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/cssProductInputs/{css_product_input}"); + private volatile Map fieldValuesMap; + private final String account; + private final String cssProductInput; + + @Deprecated + protected CssProductInputName() { + account = null; + cssProductInput = null; + } + + private CssProductInputName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + cssProductInput = Preconditions.checkNotNull(builder.getCssProductInput()); + } + + public String getAccount() { + return account; + } + + public String getCssProductInput() { + return cssProductInput; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CssProductInputName of(String account, String cssProductInput) { + return newBuilder().setAccount(account).setCssProductInput(cssProductInput).build(); + } + + public static String format(String account, String cssProductInput) { + return newBuilder().setAccount(account).setCssProductInput(cssProductInput).build().toString(); + } + + public static CssProductInputName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_CSS_PRODUCT_INPUT.validatedMatch( + formattedString, "CssProductInputName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("css_product_input")); + } + + 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 (CssProductInputName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_CSS_PRODUCT_INPUT.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 (cssProductInput != null) { + fieldMapBuilder.put("css_product_input", cssProductInput); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_CSS_PRODUCT_INPUT.instantiate( + "account", account, "css_product_input", cssProductInput); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + CssProductInputName that = ((CssProductInputName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.cssProductInput, that.cssProductInput); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(cssProductInput); + return h; + } + + /** Builder for accounts/{account}/cssProductInputs/{css_product_input}. */ + public static class Builder { + private String account; + private String cssProductInput; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getCssProductInput() { + return cssProductInput; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setCssProductInput(String cssProductInput) { + this.cssProductInput = cssProductInput; + return this; + } + + private Builder(CssProductInputName cssProductInputName) { + this.account = cssProductInputName.account; + this.cssProductInput = cssProductInputName.cssProductInput; + } + + public CssProductInputName build() { + return new CssProductInputName(this); + } + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputOrBuilder.java new file mode 100644 index 000000000000..07ce9c1b46dc --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputOrBuilder.java @@ -0,0 +1,375 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +public interface CssProductInputOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CssProductInput) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the CSS Product input.
+   * Format:
+   * `accounts/{account}/cssProductInputs/{css_product_input}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the CSS Product input.
+   * Format:
+   * `accounts/{account}/cssProductInputs/{css_product_input}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The name of the processed CSS Product.
+   * Format:
+   * `accounts/{account}/cssProducts/{css_product}`
+   * "
+   * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The finalName. + */ + java.lang.String getFinalName(); + /** + * + * + *
+   * Output only. The name of the processed CSS Product.
+   * Format:
+   * `accounts/{account}/cssProducts/{css_product}`
+   * "
+   * 
+ * + * string final_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for finalName. + */ + com.google.protobuf.ByteString getFinalNameBytes(); + + /** + * + * + *
+   * Required. Your unique identifier for the CSS Product. This is the same for
+   * the CSS Product input and processed CSS Product. We only allow ids with
+   * alphanumerics, underscores and dashes. See the [products feed
+   * specification](https://support.google.com/merchants/answer/188494#id) for
+   * details.
+   * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The rawProvidedId. + */ + java.lang.String getRawProvidedId(); + /** + * + * + *
+   * Required. Your unique identifier for the CSS Product. This is the same for
+   * the CSS Product input and processed CSS Product. We only allow ids with
+   * alphanumerics, underscores and dashes. See the [products feed
+   * specification](https://support.google.com/merchants/answer/188494#id) for
+   * details.
+   * 
+ * + * string raw_provided_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for rawProvidedId. + */ + com.google.protobuf.ByteString getRawProvidedIdBytes(); + + /** + * + * + *
+   * Required. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+   * Product.
+   * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + /** + * + * + *
+   * Required. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS
+   * Product.
+   * 
+ * + * string content_language = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); + + /** + * + * + *
+   * Required. The [feed
+   * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+   * for the CSS Product.
+   * Feed Label is synonymous to "target country" and hence should always be a
+   * valid region code. For example: 'DE' for Germany, 'FR' for France.
+   * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + /** + * + * + *
+   * Required. The [feed
+   * label](https://developers.google.com/shopping-content/guides/products/feed-labels)
+   * for the CSS Product.
+   * Feed Label is synonymous to "target country" and hence should always be a
+   * valid region code. For example: 'DE' for Germany, 'FR' for France.
+   * 
+ * + * string feed_label = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return Whether the freshnessTime field is set. + */ + boolean hasFreshnessTime(); + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + * + * @return The freshnessTime. + */ + com.google.protobuf.Timestamp getFreshnessTime(); + /** + * + * + *
+   * Represents the existing version (freshness) of the CSS Product, which
+   * can be used to preserve the right order when multiple updates are done at
+   * the same time.
+   *
+   * This field must not be set to the future time.
+   *
+   * If set, the update is prevented if a newer version of the item already
+   * exists in our system (that is the last update time of the existing
+   * CSS products is later than the freshness time set in the update). If
+   * the update happens, the last update time is then set to this freshness
+   * time.
+   *
+   * If not set, the update will not be prevented and the last update time will
+   * default to when this request was received by the CSS API.
+   *
+   * If the operation is prevented, the aborted exception will be
+   * thrown.
+   * 
+ * + * .google.protobuf.Timestamp freshness_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getFreshnessTimeOrBuilder(); + + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return Whether the attributes field is set. + */ + boolean hasAttributes(); + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + * + * @return The attributes. + */ + com.google.shopping.css.v1.Attributes getAttributes(); + /** + * + * + *
+   * A list of CSS Product attributes.
+   * 
+ * + * .google.shopping.css.v1.Attributes attributes = 7; + */ + com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder(); + + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + java.util.List getCustomAttributesList(); + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + com.google.shopping.type.CustomAttribute getCustomAttributes(int index); + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + int getCustomAttributesCount(); + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + java.util.List + getCustomAttributesOrBuilderList(); + /** + * + * + *
+   * A list of custom (CSS-provided) attributes. It can also be used for
+   * submitting any attribute of the feed specification in its generic
+   * form (for example:
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsProto.java new file mode 100644 index 000000000000..6f0b737b3f48 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductInputsProto.java @@ -0,0 +1,162 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +public final class CssProductInputsProto { + private CssProductInputsProto() {} + + 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_css_v1_CssProductInput_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CssProductInput_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_InsertCssProductInputRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_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/css/v1/css_product_inp" + + "uts.proto\022\026google.shopping.css.v1\032\034googl" + + "e/api/annotations.proto\032\027google/api/clie" + + "nt.proto\032\037google/api/field_behavior.prot" + + "o\032\031google/api/resource.proto\032\033google/pro" + + "tobuf/empty.proto\032\037google/protobuf/times" + + "tamp.proto\032/google/shopping/css/v1/css_p" + + "roduct_common.proto\032 google/shopping/typ" + + "e/types.proto\"\242\003\n\017CssProductInput\022\014\n\004nam" + + "e\030\001 \001(\t\022\030\n\nfinal_name\030\002 \001(\tB\004\342A\001\003\022\035\n\017raw" + + "_provided_id\030\003 \001(\tB\004\342A\001\002\022\036\n\020content_lang" + + "uage\030\004 \001(\tB\004\342A\001\002\022\030\n\nfeed_label\030\005 \001(\tB\004\342A" + + "\001\002\0222\n\016freshness_time\030\006 \001(\0132\032.google.prot" + + "obuf.Timestamp\0226\n\nattributes\030\007 \001(\0132\".goo" + + "gle.shopping.css.v1.Attributes\022@\n\021custom" + + "_attributes\030\010 \003(\0132%.google.shopping.type" + + ".CustomAttribute:`\352A]\n\"css.googleapis.co" + + "m/CssProductInput\0227accounts/{account}/cs" + + "sProductInputs/{css_product_input}\"\274\001\n\034I" + + "nsertCssProductInputRequest\022;\n\006parent\030\001 " + + "\001(\tB+\342A\001\002\372A$\022\"css.googleapis.com/CssProd" + + "uctInput\022H\n\021css_product_input\030\002 \001(\0132\'.go" + + "ogle.shopping.css.v1.CssProductInputB\004\342A" + + "\001\002\022\025\n\007feed_id\030\003 \001(\003B\004\342A\001\002\"\225\001\n\034DeleteCssP" + + "roductInputRequest\0229\n\004name\030\001 \001(\tB+\342A\001\002\372A" + + "$\n\"css.googleapis.com/CssProductInput\022!\n" + + "\024supplemental_feed_id\030\002 \001(\003H\000\210\001\001B\027\n\025_sup" + + "plemental_feed_id2\300\003\n\027CssProductInputsSe" + + "rvice\022\302\001\n\025InsertCssProductInput\0224.google" + + ".shopping.css.v1.InsertCssProductInputRe" + + "quest\032\'.google.shopping.css.v1.CssProduc" + + "tInput\"J\202\323\344\223\002D\"//v1/{parent=accounts/*}/" + + "cssProductInputs:insert:\021css_product_inp" + + "ut\022\236\001\n\025DeleteCssProductInput\0224.google.sh" + + "opping.css.v1.DeleteCssProductInputReque" + + "st\032\026.google.protobuf.Empty\"7\332A\004name\202\323\344\223\002" + + "**(/v1/{name=accounts/*/cssProductInputs" + + "/*}\032?\312A\022css.googleapis.com\322A\'https://www" + + ".googleapis.com/auth/contentB\267\001\n\032com.goo" + + "gle.shopping.css.v1B\025CssProductInputsPro" + + "toP\001Z2cloud.google.com/go/shopping/css/a" + + "piv1/csspb;csspb\252\002\026Google.Shopping.Css.V" + + "1\312\002\026Google\\Shopping\\Css\\V1\352\002\031Google::Sho" + + "pping::Css::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.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.shopping.css.v1.CssProductCommonProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + }); + internal_static_google_shopping_css_v1_CssProductInput_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_css_v1_CssProductInput_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CssProductInput_descriptor, + new java.lang.String[] { + "Name", + "FinalName", + "RawProvidedId", + "ContentLanguage", + "FeedLabel", + "FreshnessTime", + "Attributes", + "CustomAttributes", + }); + internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_css_v1_InsertCssProductInputRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor, + new java.lang.String[] { + "Parent", "CssProductInput", "FeedId", + }); + internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor, + new java.lang.String[] { + "Name", "SupplementalFeedId", "SupplementalFeedId", + }); + 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.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.shopping.css.v1.CssProductCommonProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductName.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductName.java new file mode 100644 index 000000000000..871b3c0de2af --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.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 CssProductName implements ResourceName { + private static final PathTemplate ACCOUNT_CSS_PRODUCT = + PathTemplate.createWithoutUrlEncoding("accounts/{account}/cssProducts/{css_product}"); + private volatile Map fieldValuesMap; + private final String account; + private final String cssProduct; + + @Deprecated + protected CssProductName() { + account = null; + cssProduct = null; + } + + private CssProductName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + cssProduct = Preconditions.checkNotNull(builder.getCssProduct()); + } + + public String getAccount() { + return account; + } + + public String getCssProduct() { + return cssProduct; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CssProductName of(String account, String cssProduct) { + return newBuilder().setAccount(account).setCssProduct(cssProduct).build(); + } + + public static String format(String account, String cssProduct) { + return newBuilder().setAccount(account).setCssProduct(cssProduct).build().toString(); + } + + public static CssProductName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_CSS_PRODUCT.validatedMatch( + formattedString, "CssProductName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("css_product")); + } + + 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 (CssProductName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_CSS_PRODUCT.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 (cssProduct != null) { + fieldMapBuilder.put("css_product", cssProduct); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_CSS_PRODUCT.instantiate("account", account, "css_product", cssProduct); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + CssProductName that = ((CssProductName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.cssProduct, that.cssProduct); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(cssProduct); + return h; + } + + /** Builder for accounts/{account}/cssProducts/{css_product}. */ + public static class Builder { + private String account; + private String cssProduct; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getCssProduct() { + return cssProduct; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setCssProduct(String cssProduct) { + this.cssProduct = cssProduct; + return this; + } + + private Builder(CssProductName cssProductName) { + this.account = cssProductName.account; + this.cssProduct = cssProductName.cssProduct; + } + + public CssProductName build() { + return new CssProductName(this); + } + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductOrBuilder.java new file mode 100644 index 000000000000..08ba59ae25c4 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductOrBuilder.java @@ -0,0 +1,305 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +public interface CssProductOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CssProduct) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the CSS Product.
+   * Format:
+   * `"accounts/{account}/cssProducts/{css_product}"`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the CSS Product.
+   * Format:
+   * `"accounts/{account}/cssProducts/{css_product}"`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Your unique raw identifier for the product.
+   * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The rawProvidedId. + */ + java.lang.String getRawProvidedId(); + /** + * + * + *
+   * Output only. Your unique raw identifier for the product.
+   * 
+ * + * string raw_provided_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for rawProvidedId. + */ + com.google.protobuf.ByteString getRawProvidedIdBytes(); + + /** + * + * + *
+   * Output only. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+   * product.
+   * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + /** + * + * + *
+   * Output only. The two-letter [ISO
+   * 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
+   * product.
+   * 
+ * + * string content_language = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); + + /** + * + * + *
+   * Output only. The feed label for the product.
+   * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The feedLabel. + */ + java.lang.String getFeedLabel(); + /** + * + * + *
+   * Output only. The feed label for the product.
+   * 
+ * + * string feed_label = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for feedLabel. + */ + com.google.protobuf.ByteString getFeedLabelBytes(); + + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the attributes field is set. + */ + boolean hasAttributes(); + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The attributes. + */ + com.google.shopping.css.v1.Attributes getAttributes(); + /** + * + * + *
+   * Output only. A list of product attributes.
+   * 
+ * + * + * .google.shopping.css.v1.Attributes attributes = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.css.v1.AttributesOrBuilder getAttributesOrBuilder(); + + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getCustomAttributesList(); + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.type.CustomAttribute getCustomAttributes(int index); + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getCustomAttributesCount(); + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getCustomAttributesOrBuilderList(); + /** + * + * + *
+   * Output only. A list of custom (CSS-provided) attributes. It can also be
+   * used to submit any attribute of the feed specification in its generic form
+   * (for example,
+   * `{ "name": "size type", "value": "regular" }`).
+   * This is useful for submitting attributes not explicitly exposed by the
+   * API, such as additional attributes used for Buy on Google.
+   * 
+ * + * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the cssProductStatus field is set. + */ + boolean hasCssProductStatus(); + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The cssProductStatus. + */ + com.google.shopping.css.v1.CssProductStatus getCssProductStatus(); + /** + * + * + *
+   * Output only. The status of a product, data validation issues, that is,
+   * information about a product computed asynchronously.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductStatus css_product_status = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.css.v1.CssProductStatusOrBuilder getCssProductStatusOrBuilder(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatus.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatus.java new file mode 100644 index 000000000000..8231f882e4a8 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatus.java @@ -0,0 +1,6510 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The status of the Css Product, data validation issues, that is,
+ * information about the Css Product computed asynchronously.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus} + */ +public final class CssProductStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CssProductStatus) + CssProductStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use CssProductStatus.newBuilder() to construct. + private CssProductStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CssProductStatus() { + destinationStatuses_ = java.util.Collections.emptyList(); + itemLevelIssues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CssProductStatus(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.class, + com.google.shopping.css.v1.CssProductStatus.Builder.class); + } + + public interface DestinationStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CssProductStatus.DestinationStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the destination
+     * 
+ * + * string destination = 1; + * + * @return The destination. + */ + java.lang.String getDestination(); + /** + * + * + *
+     * The name of the destination
+     * 
+ * + * string destination = 1; + * + * @return The bytes for destination. + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @return A list containing the approvedCountries. + */ + java.util.List getApprovedCountriesList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @return The count of approvedCountries. + */ + int getApprovedCountriesCount(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the element to return. + * @return The approvedCountries at the given index. + */ + java.lang.String getApprovedCountries(int index); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the value to return. + * @return The bytes of the approvedCountries at the given index. + */ + com.google.protobuf.ByteString getApprovedCountriesBytes(int index); + + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @return A list containing the pendingCountries. + */ + java.util.List getPendingCountriesList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @return The count of pendingCountries. + */ + int getPendingCountriesCount(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the element to return. + * @return The pendingCountries at the given index. + */ + java.lang.String getPendingCountries(int index); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the value to return. + * @return The bytes of the pendingCountries at the given index. + */ + com.google.protobuf.ByteString getPendingCountriesBytes(int index); + + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @return A list containing the disapprovedCountries. + */ + java.util.List getDisapprovedCountriesList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @return The count of disapprovedCountries. + */ + int getDisapprovedCountriesCount(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the element to return. + * @return The disapprovedCountries at the given index. + */ + java.lang.String getDisapprovedCountries(int index); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the disapprovedCountries at the given index. + */ + com.google.protobuf.ByteString getDisapprovedCountriesBytes(int index); + } + /** + * + * + *
+   * The destination status of the product status.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus.DestinationStatus} + */ + public static final class DestinationStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CssProductStatus.DestinationStatus) + DestinationStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use DestinationStatus.newBuilder() to construct. + private DestinationStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DestinationStatus() { + destination_ = ""; + approvedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pendingCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + disapprovedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DestinationStatus(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.class, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder.class); + } + + public static final int DESTINATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object destination_ = ""; + /** + * + * + *
+     * The name of the destination
+     * 
+ * + * string destination = 1; + * + * @return The destination. + */ + @java.lang.Override + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the destination
+     * 
+ * + * string destination = 1; + * + * @return The bytes for destination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPROVED_COUNTRIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList approvedCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @return A list containing the approvedCountries. + */ + public com.google.protobuf.ProtocolStringList getApprovedCountriesList() { + return approvedCountries_; + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @return The count of approvedCountries. + */ + public int getApprovedCountriesCount() { + return approvedCountries_.size(); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the element to return. + * @return The approvedCountries at the given index. + */ + public java.lang.String getApprovedCountries(int index) { + return approvedCountries_.get(index); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * approved.
+     * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the value to return. + * @return The bytes of the approvedCountries at the given index. + */ + public com.google.protobuf.ByteString getApprovedCountriesBytes(int index) { + return approvedCountries_.getByteString(index); + } + + public static final int PENDING_COUNTRIES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList pendingCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @return A list containing the pendingCountries. + */ + public com.google.protobuf.ProtocolStringList getPendingCountriesList() { + return pendingCountries_; + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @return The count of pendingCountries. + */ + public int getPendingCountriesCount() { + return pendingCountries_.size(); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the element to return. + * @return The pendingCountries at the given index. + */ + public java.lang.String getPendingCountries(int index) { + return pendingCountries_.get(index); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * pending approval.
+     * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the value to return. + * @return The bytes of the pendingCountries at the given index. + */ + public com.google.protobuf.ByteString getPendingCountriesBytes(int index) { + return pendingCountries_.getByteString(index); + } + + public static final int DISAPPROVED_COUNTRIES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList disapprovedCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @return A list containing the disapprovedCountries. + */ + public com.google.protobuf.ProtocolStringList getDisapprovedCountriesList() { + return disapprovedCountries_; + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @return The count of disapprovedCountries. + */ + public int getDisapprovedCountriesCount() { + return disapprovedCountries_.size(); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the element to return. + * @return The disapprovedCountries at the given index. + */ + public java.lang.String getDisapprovedCountries(int index) { + return disapprovedCountries_.get(index); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+     * disapproved.
+     * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the disapprovedCountries at the given index. + */ + public com.google.protobuf.ByteString getDisapprovedCountriesBytes(int index) { + return disapprovedCountries_.getByteString(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); + } + for (int i = 0; i < approvedCountries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, approvedCountries_.getRaw(i)); + } + for (int i = 0; i < pendingCountries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pendingCountries_.getRaw(i)); + } + for (int i = 0; i < disapprovedCountries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 4, disapprovedCountries_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, destination_); + } + { + int dataSize = 0; + for (int i = 0; i < approvedCountries_.size(); i++) { + dataSize += computeStringSizeNoTag(approvedCountries_.getRaw(i)); + } + size += dataSize; + size += 1 * getApprovedCountriesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < pendingCountries_.size(); i++) { + dataSize += computeStringSizeNoTag(pendingCountries_.getRaw(i)); + } + size += dataSize; + size += 1 * getPendingCountriesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < disapprovedCountries_.size(); i++) { + dataSize += computeStringSizeNoTag(disapprovedCountries_.getRaw(i)); + } + size += dataSize; + size += 1 * getDisapprovedCountriesList().size(); + } + 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.css.v1.CssProductStatus.DestinationStatus)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CssProductStatus.DestinationStatus other = + (com.google.shopping.css.v1.CssProductStatus.DestinationStatus) obj; + + if (!getDestination().equals(other.getDestination())) return false; + if (!getApprovedCountriesList().equals(other.getApprovedCountriesList())) return false; + if (!getPendingCountriesList().equals(other.getPendingCountriesList())) return false; + if (!getDisapprovedCountriesList().equals(other.getDisapprovedCountriesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + if (getApprovedCountriesCount() > 0) { + hash = (37 * hash) + APPROVED_COUNTRIES_FIELD_NUMBER; + hash = (53 * hash) + getApprovedCountriesList().hashCode(); + } + if (getPendingCountriesCount() > 0) { + hash = (37 * hash) + PENDING_COUNTRIES_FIELD_NUMBER; + hash = (53 * hash) + getPendingCountriesList().hashCode(); + } + if (getDisapprovedCountriesCount() > 0) { + hash = (37 * hash) + DISAPPROVED_COUNTRIES_FIELD_NUMBER; + hash = (53 * hash) + getDisapprovedCountriesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus 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 destination status of the product status.
+     * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus.DestinationStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CssProductStatus.DestinationStatus) + com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.class, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CssProductStatus.DestinationStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + destination_ = ""; + approvedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pendingCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + disapprovedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_DestinationStatus_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus + getDefaultInstanceForType() { + return com.google.shopping.css.v1.CssProductStatus.DestinationStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus build() { + com.google.shopping.css.v1.CssProductStatus.DestinationStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus buildPartial() { + com.google.shopping.css.v1.CssProductStatus.DestinationStatus result = + new com.google.shopping.css.v1.CssProductStatus.DestinationStatus(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.destination_ = destination_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + approvedCountries_.makeImmutable(); + result.approvedCountries_ = approvedCountries_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + pendingCountries_.makeImmutable(); + result.pendingCountries_ = pendingCountries_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + disapprovedCountries_.makeImmutable(); + result.disapprovedCountries_ = disapprovedCountries_; + } + } + + @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.css.v1.CssProductStatus.DestinationStatus) { + return mergeFrom((com.google.shopping.css.v1.CssProductStatus.DestinationStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus other) { + if (other + == com.google.shopping.css.v1.CssProductStatus.DestinationStatus.getDefaultInstance()) + return this; + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.approvedCountries_.isEmpty()) { + if (approvedCountries_.isEmpty()) { + approvedCountries_ = other.approvedCountries_; + bitField0_ |= 0x00000002; + } else { + ensureApprovedCountriesIsMutable(); + approvedCountries_.addAll(other.approvedCountries_); + } + onChanged(); + } + if (!other.pendingCountries_.isEmpty()) { + if (pendingCountries_.isEmpty()) { + pendingCountries_ = other.pendingCountries_; + bitField0_ |= 0x00000004; + } else { + ensurePendingCountriesIsMutable(); + pendingCountries_.addAll(other.pendingCountries_); + } + onChanged(); + } + if (!other.disapprovedCountries_.isEmpty()) { + if (disapprovedCountries_.isEmpty()) { + disapprovedCountries_ = other.disapprovedCountries_; + bitField0_ |= 0x00000008; + } else { + ensureDisapprovedCountriesIsMutable(); + disapprovedCountries_.addAll(other.disapprovedCountries_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + destination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApprovedCountriesIsMutable(); + approvedCountries_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePendingCountriesIsMutable(); + pendingCountries_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDisapprovedCountriesIsMutable(); + disapprovedCountries_.add(s); + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object destination_ = ""; + /** + * + * + *
+       * The name of the destination
+       * 
+ * + * string destination = 1; + * + * @return The destination. + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the destination
+       * 
+ * + * string destination = 1; + * + * @return The bytes for destination. + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the destination
+       * 
+ * + * string destination = 1; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the destination
+       * 
+ * + * string destination = 1; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + destination_ = getDefaultInstance().getDestination(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the destination
+       * 
+ * + * string destination = 1; + * + * @param value The bytes for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destination_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList approvedCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApprovedCountriesIsMutable() { + if (!approvedCountries_.isModifiable()) { + approvedCountries_ = new com.google.protobuf.LazyStringArrayList(approvedCountries_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @return A list containing the approvedCountries. + */ + public com.google.protobuf.ProtocolStringList getApprovedCountriesList() { + approvedCountries_.makeImmutable(); + return approvedCountries_; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @return The count of approvedCountries. + */ + public int getApprovedCountriesCount() { + return approvedCountries_.size(); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the element to return. + * @return The approvedCountries at the given index. + */ + public java.lang.String getApprovedCountries(int index) { + return approvedCountries_.get(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index of the value to return. + * @return The bytes of the approvedCountries at the given index. + */ + public com.google.protobuf.ByteString getApprovedCountriesBytes(int index) { + return approvedCountries_.getByteString(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param index The index to set the value at. + * @param value The approvedCountries to set. + * @return This builder for chaining. + */ + public Builder setApprovedCountries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApprovedCountriesIsMutable(); + approvedCountries_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param value The approvedCountries to add. + * @return This builder for chaining. + */ + public Builder addApprovedCountries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApprovedCountriesIsMutable(); + approvedCountries_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param values The approvedCountries to add. + * @return This builder for chaining. + */ + public Builder addAllApprovedCountries(java.lang.Iterable values) { + ensureApprovedCountriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, approvedCountries_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @return This builder for chaining. + */ + public Builder clearApprovedCountries() { + approvedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * approved.
+       * 
+ * + * repeated string approved_countries = 2; + * + * @param value The bytes of the approvedCountries to add. + * @return This builder for chaining. + */ + public Builder addApprovedCountriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApprovedCountriesIsMutable(); + approvedCountries_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList pendingCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePendingCountriesIsMutable() { + if (!pendingCountries_.isModifiable()) { + pendingCountries_ = new com.google.protobuf.LazyStringArrayList(pendingCountries_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @return A list containing the pendingCountries. + */ + public com.google.protobuf.ProtocolStringList getPendingCountriesList() { + pendingCountries_.makeImmutable(); + return pendingCountries_; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @return The count of pendingCountries. + */ + public int getPendingCountriesCount() { + return pendingCountries_.size(); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the element to return. + * @return The pendingCountries at the given index. + */ + public java.lang.String getPendingCountries(int index) { + return pendingCountries_.get(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index of the value to return. + * @return The bytes of the pendingCountries at the given index. + */ + public com.google.protobuf.ByteString getPendingCountriesBytes(int index) { + return pendingCountries_.getByteString(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param index The index to set the value at. + * @param value The pendingCountries to set. + * @return This builder for chaining. + */ + public Builder setPendingCountries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePendingCountriesIsMutable(); + pendingCountries_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param value The pendingCountries to add. + * @return This builder for chaining. + */ + public Builder addPendingCountries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePendingCountriesIsMutable(); + pendingCountries_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param values The pendingCountries to add. + * @return This builder for chaining. + */ + public Builder addAllPendingCountries(java.lang.Iterable values) { + ensurePendingCountriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pendingCountries_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @return This builder for chaining. + */ + public Builder clearPendingCountries() { + pendingCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * pending approval.
+       * 
+ * + * repeated string pending_countries = 3; + * + * @param value The bytes of the pendingCountries to add. + * @return This builder for chaining. + */ + public Builder addPendingCountriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePendingCountriesIsMutable(); + pendingCountries_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList disapprovedCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDisapprovedCountriesIsMutable() { + if (!disapprovedCountries_.isModifiable()) { + disapprovedCountries_ = + new com.google.protobuf.LazyStringArrayList(disapprovedCountries_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @return A list containing the disapprovedCountries. + */ + public com.google.protobuf.ProtocolStringList getDisapprovedCountriesList() { + disapprovedCountries_.makeImmutable(); + return disapprovedCountries_; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @return The count of disapprovedCountries. + */ + public int getDisapprovedCountriesCount() { + return disapprovedCountries_.size(); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the element to return. + * @return The disapprovedCountries at the given index. + */ + public java.lang.String getDisapprovedCountries(int index) { + return disapprovedCountries_.get(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index of the value to return. + * @return The bytes of the disapprovedCountries at the given index. + */ + public com.google.protobuf.ByteString getDisapprovedCountriesBytes(int index) { + return disapprovedCountries_.getByteString(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param index The index to set the value at. + * @param value The disapprovedCountries to set. + * @return This builder for chaining. + */ + public Builder setDisapprovedCountries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisapprovedCountriesIsMutable(); + disapprovedCountries_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param value The disapprovedCountries to add. + * @return This builder for chaining. + */ + public Builder addDisapprovedCountries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDisapprovedCountriesIsMutable(); + disapprovedCountries_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param values The disapprovedCountries to add. + * @return This builder for chaining. + */ + public Builder addAllDisapprovedCountries(java.lang.Iterable values) { + ensureDisapprovedCountriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, disapprovedCountries_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @return This builder for chaining. + */ + public Builder clearDisapprovedCountries() { + disapprovedCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is
+       * disapproved.
+       * 
+ * + * repeated string disapproved_countries = 4; + * + * @param value The bytes of the disapprovedCountries to add. + * @return This builder for chaining. + */ + public Builder addDisapprovedCountriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDisapprovedCountriesIsMutable(); + disapprovedCountries_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.css.v1.CssProductStatus.DestinationStatus) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CssProductStatus.DestinationStatus) + private static final com.google.shopping.css.v1.CssProductStatus.DestinationStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CssProductStatus.DestinationStatus(); + } + + public static com.google.shopping.css.v1.CssProductStatus.DestinationStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DestinationStatus 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.css.v1.CssProductStatus.DestinationStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ItemLevelIssueOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CssProductStatus.ItemLevelIssue) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The error code of the issue.
+     * 
+ * + * string code = 1; + * + * @return The code. + */ + java.lang.String getCode(); + /** + * + * + *
+     * The error code of the issue.
+     * 
+ * + * string code = 1; + * + * @return The bytes for code. + */ + com.google.protobuf.ByteString getCodeBytes(); + + /** + * + * + *
+     * How this issue affects serving of the aggregate offer.
+     * 
+ * + * string servability = 2; + * + * @return The servability. + */ + java.lang.String getServability(); + /** + * + * + *
+     * How this issue affects serving of the aggregate offer.
+     * 
+ * + * string servability = 2; + * + * @return The bytes for servability. + */ + com.google.protobuf.ByteString getServabilityBytes(); + + /** + * + * + *
+     * Whether the issue can be resolved by the merchant.
+     * 
+ * + * string resolution = 3; + * + * @return The resolution. + */ + java.lang.String getResolution(); + /** + * + * + *
+     * Whether the issue can be resolved by the merchant.
+     * 
+ * + * string resolution = 3; + * + * @return The bytes for resolution. + */ + com.google.protobuf.ByteString getResolutionBytes(); + + /** + * + * + *
+     * The attribute's name, if the issue is caused by a single attribute.
+     * 
+ * + * string attribute = 4; + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+     * The attribute's name, if the issue is caused by a single attribute.
+     * 
+ * + * string attribute = 4; + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + /** + * + * + *
+     * The destination the issue applies to.
+     * 
+ * + * string destination = 5; + * + * @return The destination. + */ + java.lang.String getDestination(); + /** + * + * + *
+     * The destination the issue applies to.
+     * 
+ * + * string destination = 5; + * + * @return The bytes for destination. + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * + * + *
+     * A short issue description in English.
+     * 
+ * + * string description = 6; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+     * A short issue description in English.
+     * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+     * A detailed issue description in English.
+     * 
+ * + * string detail = 7; + * + * @return The detail. + */ + java.lang.String getDetail(); + /** + * + * + *
+     * A detailed issue description in English.
+     * 
+ * + * string detail = 7; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); + + /** + * + * + *
+     * The URL of a web page to help with resolving this issue.
+     * 
+ * + * string documentation = 8; + * + * @return The documentation. + */ + java.lang.String getDocumentation(); + /** + * + * + *
+     * The URL of a web page to help with resolving this issue.
+     * 
+ * + * string documentation = 8; + * + * @return The bytes for documentation. + */ + com.google.protobuf.ByteString getDocumentationBytes(); + + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @return A list containing the applicableCountries. + */ + java.util.List getApplicableCountriesList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @return The count of applicableCountries. + */ + int getApplicableCountriesCount(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the element to return. + * @return The applicableCountries at the given index. + */ + java.lang.String getApplicableCountries(int index); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the value to return. + * @return The bytes of the applicableCountries at the given index. + */ + com.google.protobuf.ByteString getApplicableCountriesBytes(int index); + } + /** + * + * + *
+   * The ItemLevelIssue of the product status.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus.ItemLevelIssue} + */ + public static final class ItemLevelIssue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.CssProductStatus.ItemLevelIssue) + ItemLevelIssueOrBuilder { + private static final long serialVersionUID = 0L; + // Use ItemLevelIssue.newBuilder() to construct. + private ItemLevelIssue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ItemLevelIssue() { + code_ = ""; + servability_ = ""; + resolution_ = ""; + attribute_ = ""; + destination_ = ""; + description_ = ""; + detail_ = ""; + documentation_ = ""; + applicableCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ItemLevelIssue(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.class, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object code_ = ""; + /** + * + * + *
+     * The error code of the issue.
+     * 
+ * + * string code = 1; + * + * @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; + } + } + /** + * + * + *
+     * The error code of the issue.
+     * 
+ * + * string code = 1; + * + * @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 SERVABILITY_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object servability_ = ""; + /** + * + * + *
+     * How this issue affects serving of the aggregate offer.
+     * 
+ * + * string servability = 2; + * + * @return The servability. + */ + @java.lang.Override + public java.lang.String getServability() { + java.lang.Object ref = servability_; + 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(); + servability_ = s; + return s; + } + } + /** + * + * + *
+     * How this issue affects serving of the aggregate offer.
+     * 
+ * + * string servability = 2; + * + * @return The bytes for servability. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServabilityBytes() { + java.lang.Object ref = servability_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOLUTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object resolution_ = ""; + /** + * + * + *
+     * Whether the issue can be resolved by the merchant.
+     * 
+ * + * string resolution = 3; + * + * @return The resolution. + */ + @java.lang.Override + public java.lang.String getResolution() { + java.lang.Object ref = resolution_; + 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(); + resolution_ = s; + return s; + } + } + /** + * + * + *
+     * Whether the issue can be resolved by the merchant.
+     * 
+ * + * string resolution = 3; + * + * @return The bytes for resolution. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResolutionBytes() { + java.lang.Object ref = resolution_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resolution_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object attribute_ = ""; + /** + * + * + *
+     * The attribute's name, if the issue is caused by a single attribute.
+     * 
+ * + * string attribute = 4; + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + 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(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+     * The attribute's name, if the issue is caused by a single attribute.
+     * 
+ * + * string attribute = 4; + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object destination_ = ""; + /** + * + * + *
+     * The destination the issue applies to.
+     * 
+ * + * string destination = 5; + * + * @return The destination. + */ + @java.lang.Override + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } + } + /** + * + * + *
+     * The destination the issue applies to.
+     * 
+ * + * string destination = 5; + * + * @return The bytes for destination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+     * A short issue description in English.
+     * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+     * A short issue description in English.
+     * 
+ * + * string description = 6; + * + * @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 DETAIL_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + /** + * + * + *
+     * A detailed issue description in English.
+     * 
+ * + * string detail = 7; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + 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(); + detail_ = s; + return s; + } + } + /** + * + * + *
+     * A detailed issue description in English.
+     * 
+ * + * string detail = 7; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOCUMENTATION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object documentation_ = ""; + /** + * + * + *
+     * The URL of a web page to help with resolving this issue.
+     * 
+ * + * string documentation = 8; + * + * @return The documentation. + */ + @java.lang.Override + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + 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(); + documentation_ = s; + return s; + } + } + /** + * + * + *
+     * The URL of a web page to help with resolving this issue.
+     * 
+ * + * string documentation = 8; + * + * @return The bytes for documentation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APPLICABLE_COUNTRIES_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList applicableCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @return A list containing the applicableCountries. + */ + public com.google.protobuf.ProtocolStringList getApplicableCountriesList() { + return applicableCountries_; + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @return The count of applicableCountries. + */ + public int getApplicableCountriesCount() { + return applicableCountries_.size(); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the element to return. + * @return The applicableCountries at the given index. + */ + public java.lang.String getApplicableCountries(int index) { + return applicableCountries_.get(index); + } + /** + * + * + *
+     * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+     * aggregate offer.
+     * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the value to return. + * @return The bytes of the applicableCountries at the given index. + */ + public com.google.protobuf.ByteString getApplicableCountriesBytes(int index) { + return applicableCountries_.getByteString(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(code_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servability_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, servability_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resolution_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, resolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, detail_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, documentation_); + } + for (int i = 0; i < applicableCountries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 9, applicableCountries_.getRaw(i)); + } + 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(code_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servability_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, servability_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resolution_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, resolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, detail_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(documentation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, documentation_); + } + { + int dataSize = 0; + for (int i = 0; i < applicableCountries_.size(); i++) { + dataSize += computeStringSizeNoTag(applicableCountries_.getRaw(i)); + } + size += dataSize; + size += 1 * getApplicableCountriesList().size(); + } + 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.css.v1.CssProductStatus.ItemLevelIssue)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue other = + (com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue) obj; + + if (!getCode().equals(other.getCode())) return false; + if (!getServability().equals(other.getServability())) return false; + if (!getResolution().equals(other.getResolution())) return false; + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getDestination().equals(other.getDestination())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getDetail().equals(other.getDetail())) return false; + if (!getDocumentation().equals(other.getDocumentation())) return false; + if (!getApplicableCountriesList().equals(other.getApplicableCountriesList())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode().hashCode(); + hash = (37 * hash) + SERVABILITY_FIELD_NUMBER; + hash = (53 * hash) + getServability().hashCode(); + hash = (37 * hash) + RESOLUTION_FIELD_NUMBER; + hash = (53 * hash) + getResolution().hashCode(); + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (37 * hash) + DOCUMENTATION_FIELD_NUMBER; + hash = (53 * hash) + getDocumentation().hashCode(); + if (getApplicableCountriesCount() > 0) { + hash = (37 * hash) + APPLICABLE_COUNTRIES_FIELD_NUMBER; + hash = (53 * hash) + getApplicableCountriesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue 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 ItemLevelIssue of the product status.
+     * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus.ItemLevelIssue} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CssProductStatus.ItemLevelIssue) + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.class, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = ""; + servability_ = ""; + resolution_ = ""; + attribute_ = ""; + destination_ = ""; + description_ = ""; + detail_ = ""; + documentation_ = ""; + applicableCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_ItemLevelIssue_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue + getDefaultInstanceForType() { + return com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue build() { + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue buildPartial() { + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue result = + new com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.servability_ = servability_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resolution_ = resolution_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.attribute_ = attribute_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.destination_ = destination_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.detail_ = detail_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.documentation_ = documentation_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + applicableCountries_.makeImmutable(); + result.applicableCountries_ = applicableCountries_; + } + } + + @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.css.v1.CssProductStatus.ItemLevelIssue) { + return mergeFrom((com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue other) { + if (other + == com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.getDefaultInstance()) + return this; + if (!other.getCode().isEmpty()) { + code_ = other.code_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getServability().isEmpty()) { + servability_ = other.servability_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getResolution().isEmpty()) { + resolution_ = other.resolution_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getDocumentation().isEmpty()) { + documentation_ = other.documentation_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.applicableCountries_.isEmpty()) { + if (applicableCountries_.isEmpty()) { + applicableCountries_ = other.applicableCountries_; + bitField0_ |= 0x00000100; + } else { + ensureApplicableCountriesIsMutable(); + applicableCountries_.addAll(other.applicableCountries_); + } + 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: + { + code_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + servability_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + resolution_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + attribute_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + destination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + detail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + documentation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApplicableCountriesIsMutable(); + applicableCountries_.add(s); + 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 java.lang.Object code_ = ""; + /** + * + * + *
+       * The error code of the issue.
+       * 
+ * + * string code = 1; + * + * @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; + } + } + /** + * + * + *
+       * The error code of the issue.
+       * 
+ * + * string code = 1; + * + * @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; + } + } + /** + * + * + *
+       * The error code of the issue.
+       * 
+ * + * string code = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The error code of the issue.
+       * 
+ * + * string code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + code_ = getDefaultInstance().getCode(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The error code of the issue.
+       * 
+ * + * string code = 1; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object servability_ = ""; + /** + * + * + *
+       * How this issue affects serving of the aggregate offer.
+       * 
+ * + * string servability = 2; + * + * @return The servability. + */ + public java.lang.String getServability() { + java.lang.Object ref = servability_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servability_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * How this issue affects serving of the aggregate offer.
+       * 
+ * + * string servability = 2; + * + * @return The bytes for servability. + */ + public com.google.protobuf.ByteString getServabilityBytes() { + java.lang.Object ref = servability_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + servability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * How this issue affects serving of the aggregate offer.
+       * 
+ * + * string servability = 2; + * + * @param value The servability to set. + * @return This builder for chaining. + */ + public Builder setServability(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + servability_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * How this issue affects serving of the aggregate offer.
+       * 
+ * + * string servability = 2; + * + * @return This builder for chaining. + */ + public Builder clearServability() { + servability_ = getDefaultInstance().getServability(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * How this issue affects serving of the aggregate offer.
+       * 
+ * + * string servability = 2; + * + * @param value The bytes for servability to set. + * @return This builder for chaining. + */ + public Builder setServabilityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + servability_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object resolution_ = ""; + /** + * + * + *
+       * Whether the issue can be resolved by the merchant.
+       * 
+ * + * string resolution = 3; + * + * @return The resolution. + */ + public java.lang.String getResolution() { + java.lang.Object ref = resolution_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resolution_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Whether the issue can be resolved by the merchant.
+       * 
+ * + * string resolution = 3; + * + * @return The bytes for resolution. + */ + public com.google.protobuf.ByteString getResolutionBytes() { + java.lang.Object ref = resolution_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resolution_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Whether the issue can be resolved by the merchant.
+       * 
+ * + * string resolution = 3; + * + * @param value The resolution to set. + * @return This builder for chaining. + */ + public Builder setResolution(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + resolution_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the issue can be resolved by the merchant.
+       * 
+ * + * string resolution = 3; + * + * @return This builder for chaining. + */ + public Builder clearResolution() { + resolution_ = getDefaultInstance().getResolution(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Whether the issue can be resolved by the merchant.
+       * 
+ * + * string resolution = 3; + * + * @param value The bytes for resolution to set. + * @return This builder for chaining. + */ + public Builder setResolutionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + resolution_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+       * The attribute's name, if the issue is caused by a single attribute.
+       * 
+ * + * string attribute = 4; + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The attribute's name, if the issue is caused by a single attribute.
+       * 
+ * + * string attribute = 4; + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The attribute's name, if the issue is caused by a single attribute.
+       * 
+ * + * string attribute = 4; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attribute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+       * The attribute's name, if the issue is caused by a single attribute.
+       * 
+ * + * string attribute = 4; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + attribute_ = getDefaultInstance().getAttribute(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+       * The attribute's name, if the issue is caused by a single attribute.
+       * 
+ * + * string attribute = 4; + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attribute_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + /** + * + * + *
+       * The destination the issue applies to.
+       * 
+ * + * string destination = 5; + * + * @return The destination. + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The destination the issue applies to.
+       * 
+ * + * string destination = 5; + * + * @return The bytes for destination. + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The destination the issue applies to.
+       * 
+ * + * string destination = 5; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+       * The destination the issue applies to.
+       * 
+ * + * string destination = 5; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + destination_ = getDefaultInstance().getDestination(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+       * The destination the issue applies to.
+       * 
+ * + * string destination = 5; + * + * @param value The bytes for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destination_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+       * A short issue description in English.
+       * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+       * A short issue description in English.
+       * 
+ * + * string description = 6; + * + * @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; + } + } + /** + * + * + *
+       * A short issue description in English.
+       * 
+ * + * string description = 6; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+       * A short issue description in English.
+       * 
+ * + * string description = 6; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+       * A short issue description in English.
+       * 
+ * + * string description = 6; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * + * + *
+       * A detailed issue description in English.
+       * 
+ * + * string detail = 7; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * A detailed issue description in English.
+       * 
+ * + * string detail = 7; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * A detailed issue description in English.
+       * 
+ * + * string detail = 7; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+       * A detailed issue description in English.
+       * 
+ * + * string detail = 7; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+       * A detailed issue description in English.
+       * 
+ * + * string detail = 7; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + detail_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object documentation_ = ""; + /** + * + * + *
+       * The URL of a web page to help with resolving this issue.
+       * 
+ * + * string documentation = 8; + * + * @return The documentation. + */ + public java.lang.String getDocumentation() { + java.lang.Object ref = documentation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + documentation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The URL of a web page to help with resolving this issue.
+       * 
+ * + * string documentation = 8; + * + * @return The bytes for documentation. + */ + public com.google.protobuf.ByteString getDocumentationBytes() { + java.lang.Object ref = documentation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + documentation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The URL of a web page to help with resolving this issue.
+       * 
+ * + * string documentation = 8; + * + * @param value The documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + documentation_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of a web page to help with resolving this issue.
+       * 
+ * + * string documentation = 8; + * + * @return This builder for chaining. + */ + public Builder clearDocumentation() { + documentation_ = getDefaultInstance().getDocumentation(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+       * The URL of a web page to help with resolving this issue.
+       * 
+ * + * string documentation = 8; + * + * @param value The bytes for documentation to set. + * @return This builder for chaining. + */ + public Builder setDocumentationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + documentation_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList applicableCountries_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApplicableCountriesIsMutable() { + if (!applicableCountries_.isModifiable()) { + applicableCountries_ = new com.google.protobuf.LazyStringArrayList(applicableCountries_); + } + bitField0_ |= 0x00000100; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @return A list containing the applicableCountries. + */ + public com.google.protobuf.ProtocolStringList getApplicableCountriesList() { + applicableCountries_.makeImmutable(); + return applicableCountries_; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @return The count of applicableCountries. + */ + public int getApplicableCountriesCount() { + return applicableCountries_.size(); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the element to return. + * @return The applicableCountries at the given index. + */ + public java.lang.String getApplicableCountries(int index) { + return applicableCountries_.get(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index of the value to return. + * @return The bytes of the applicableCountries at the given index. + */ + public com.google.protobuf.ByteString getApplicableCountriesBytes(int index) { + return applicableCountries_.getByteString(index); + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param index The index to set the value at. + * @param value The applicableCountries to set. + * @return This builder for chaining. + */ + public Builder setApplicableCountries(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableCountriesIsMutable(); + applicableCountries_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param value The applicableCountries to add. + * @return This builder for chaining. + */ + public Builder addApplicableCountries(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableCountriesIsMutable(); + applicableCountries_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param values The applicableCountries to add. + * @return This builder for chaining. + */ + public Builder addAllApplicableCountries(java.lang.Iterable values) { + ensureApplicableCountriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, applicableCountries_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @return This builder for chaining. + */ + public Builder clearApplicableCountries() { + applicableCountries_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of country codes (ISO 3166-1 alpha-2) where issue applies to the
+       * aggregate offer.
+       * 
+ * + * repeated string applicable_countries = 9; + * + * @param value The bytes of the applicableCountries to add. + * @return This builder for chaining. + */ + public Builder addApplicableCountriesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApplicableCountriesIsMutable(); + applicableCountries_.add(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.css.v1.CssProductStatus.ItemLevelIssue) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CssProductStatus.ItemLevelIssue) + private static final com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue(); + } + + public static com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ItemLevelIssue 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.css.v1.CssProductStatus.ItemLevelIssue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DESTINATION_STATUSES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List + destinationStatuses_; + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + @java.lang.Override + public java.util.List + getDestinationStatusesList() { + return destinationStatuses_; + } + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder> + getDestinationStatusesOrBuilderList() { + return destinationStatuses_; + } + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + @java.lang.Override + public int getDestinationStatusesCount() { + return destinationStatuses_.size(); + } + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus getDestinationStatuses( + int index) { + return destinationStatuses_.get(index); + } + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder + getDestinationStatusesOrBuilder(int index) { + return destinationStatuses_.get(index); + } + + public static final int ITEM_LEVEL_ISSUES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List + itemLevelIssues_; + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + @java.lang.Override + public java.util.List + getItemLevelIssuesList() { + return itemLevelIssues_; + } + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder> + getItemLevelIssuesOrBuilderList() { + return itemLevelIssues_; + } + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + @java.lang.Override + public int getItemLevelIssuesCount() { + return itemLevelIssues_.size(); + } + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue getItemLevelIssues(int index) { + return itemLevelIssues_.get(index); + } + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder + getItemLevelIssuesOrBuilder(int index) { + return itemLevelIssues_.get(index); + } + + public static final int CREATION_DATE_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp creationDate_; + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return Whether the creationDate field is set. + */ + @java.lang.Override + public boolean hasCreationDate() { + return creationDate_ != null; + } + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return The creationDate. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreationDate() { + return creationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationDate_; + } + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreationDateOrBuilder() { + return creationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationDate_; + } + + public static final int LAST_UPDATE_DATE_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp lastUpdateDate_; + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return Whether the lastUpdateDate field is set. + */ + @java.lang.Override + public boolean hasLastUpdateDate() { + return lastUpdateDate_ != null; + } + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return The lastUpdateDate. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLastUpdateDate() { + return lastUpdateDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastUpdateDate_; + } + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLastUpdateDateOrBuilder() { + return lastUpdateDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastUpdateDate_; + } + + public static final int GOOGLE_EXPIRATION_DATE_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp googleExpirationDate_; + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return Whether the googleExpirationDate field is set. + */ + @java.lang.Override + public boolean hasGoogleExpirationDate() { + return googleExpirationDate_ != null; + } + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return The googleExpirationDate. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getGoogleExpirationDate() { + return googleExpirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : googleExpirationDate_; + } + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getGoogleExpirationDateOrBuilder() { + return googleExpirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : googleExpirationDate_; + } + + 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 < destinationStatuses_.size(); i++) { + output.writeMessage(3, destinationStatuses_.get(i)); + } + for (int i = 0; i < itemLevelIssues_.size(); i++) { + output.writeMessage(4, itemLevelIssues_.get(i)); + } + if (creationDate_ != null) { + output.writeMessage(5, getCreationDate()); + } + if (lastUpdateDate_ != null) { + output.writeMessage(6, getLastUpdateDate()); + } + if (googleExpirationDate_ != null) { + output.writeMessage(7, getGoogleExpirationDate()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < destinationStatuses_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, destinationStatuses_.get(i)); + } + for (int i = 0; i < itemLevelIssues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, itemLevelIssues_.get(i)); + } + if (creationDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreationDate()); + } + if (lastUpdateDate_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getLastUpdateDate()); + } + if (googleExpirationDate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getGoogleExpirationDate()); + } + 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.css.v1.CssProductStatus)) { + return super.equals(obj); + } + com.google.shopping.css.v1.CssProductStatus other = + (com.google.shopping.css.v1.CssProductStatus) obj; + + if (!getDestinationStatusesList().equals(other.getDestinationStatusesList())) return false; + if (!getItemLevelIssuesList().equals(other.getItemLevelIssuesList())) return false; + if (hasCreationDate() != other.hasCreationDate()) return false; + if (hasCreationDate()) { + if (!getCreationDate().equals(other.getCreationDate())) return false; + } + if (hasLastUpdateDate() != other.hasLastUpdateDate()) return false; + if (hasLastUpdateDate()) { + if (!getLastUpdateDate().equals(other.getLastUpdateDate())) return false; + } + if (hasGoogleExpirationDate() != other.hasGoogleExpirationDate()) return false; + if (hasGoogleExpirationDate()) { + if (!getGoogleExpirationDate().equals(other.getGoogleExpirationDate())) 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 (getDestinationStatusesCount() > 0) { + hash = (37 * hash) + DESTINATION_STATUSES_FIELD_NUMBER; + hash = (53 * hash) + getDestinationStatusesList().hashCode(); + } + if (getItemLevelIssuesCount() > 0) { + hash = (37 * hash) + ITEM_LEVEL_ISSUES_FIELD_NUMBER; + hash = (53 * hash) + getItemLevelIssuesList().hashCode(); + } + if (hasCreationDate()) { + hash = (37 * hash) + CREATION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getCreationDate().hashCode(); + } + if (hasLastUpdateDate()) { + hash = (37 * hash) + LAST_UPDATE_DATE_FIELD_NUMBER; + hash = (53 * hash) + getLastUpdateDate().hashCode(); + } + if (hasGoogleExpirationDate()) { + hash = (37 * hash) + GOOGLE_EXPIRATION_DATE_FIELD_NUMBER; + hash = (53 * hash) + getGoogleExpirationDate().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.CssProductStatus parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus 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.css.v1.CssProductStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus 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.css.v1.CssProductStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.CssProductStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.CssProductStatus parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus 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.css.v1.CssProductStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus 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.css.v1.CssProductStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.CssProductStatus 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.css.v1.CssProductStatus 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 status of the Css Product, data validation issues, that is,
+   * information about the Css Product computed asynchronously.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.CssProductStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.CssProductStatus) + com.google.shopping.css.v1.CssProductStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.CssProductStatus.class, + com.google.shopping.css.v1.CssProductStatus.Builder.class); + } + + // Construct using com.google.shopping.css.v1.CssProductStatus.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (destinationStatusesBuilder_ == null) { + destinationStatuses_ = java.util.Collections.emptyList(); + } else { + destinationStatuses_ = null; + destinationStatusesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (itemLevelIssuesBuilder_ == null) { + itemLevelIssues_ = java.util.Collections.emptyList(); + } else { + itemLevelIssues_ = null; + itemLevelIssuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + creationDate_ = null; + if (creationDateBuilder_ != null) { + creationDateBuilder_.dispose(); + creationDateBuilder_ = null; + } + lastUpdateDate_ = null; + if (lastUpdateDateBuilder_ != null) { + lastUpdateDateBuilder_.dispose(); + lastUpdateDateBuilder_ = null; + } + googleExpirationDate_ = null; + if (googleExpirationDateBuilder_ != null) { + googleExpirationDateBuilder_.dispose(); + googleExpirationDateBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_CssProductStatus_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus getDefaultInstanceForType() { + return com.google.shopping.css.v1.CssProductStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus build() { + com.google.shopping.css.v1.CssProductStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.CssProductStatus buildPartial() { + com.google.shopping.css.v1.CssProductStatus result = + new com.google.shopping.css.v1.CssProductStatus(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.css.v1.CssProductStatus result) { + if (destinationStatusesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + destinationStatuses_ = java.util.Collections.unmodifiableList(destinationStatuses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.destinationStatuses_ = destinationStatuses_; + } else { + result.destinationStatuses_ = destinationStatusesBuilder_.build(); + } + if (itemLevelIssuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + itemLevelIssues_ = java.util.Collections.unmodifiableList(itemLevelIssues_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.itemLevelIssues_ = itemLevelIssues_; + } else { + result.itemLevelIssues_ = itemLevelIssuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.CssProductStatus result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.creationDate_ = + creationDateBuilder_ == null ? creationDate_ : creationDateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.lastUpdateDate_ = + lastUpdateDateBuilder_ == null ? lastUpdateDate_ : lastUpdateDateBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.googleExpirationDate_ = + googleExpirationDateBuilder_ == null + ? googleExpirationDate_ + : googleExpirationDateBuilder_.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.css.v1.CssProductStatus) { + return mergeFrom((com.google.shopping.css.v1.CssProductStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.CssProductStatus other) { + if (other == com.google.shopping.css.v1.CssProductStatus.getDefaultInstance()) return this; + if (destinationStatusesBuilder_ == null) { + if (!other.destinationStatuses_.isEmpty()) { + if (destinationStatuses_.isEmpty()) { + destinationStatuses_ = other.destinationStatuses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.addAll(other.destinationStatuses_); + } + onChanged(); + } + } else { + if (!other.destinationStatuses_.isEmpty()) { + if (destinationStatusesBuilder_.isEmpty()) { + destinationStatusesBuilder_.dispose(); + destinationStatusesBuilder_ = null; + destinationStatuses_ = other.destinationStatuses_; + bitField0_ = (bitField0_ & ~0x00000001); + destinationStatusesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDestinationStatusesFieldBuilder() + : null; + } else { + destinationStatusesBuilder_.addAllMessages(other.destinationStatuses_); + } + } + } + if (itemLevelIssuesBuilder_ == null) { + if (!other.itemLevelIssues_.isEmpty()) { + if (itemLevelIssues_.isEmpty()) { + itemLevelIssues_ = other.itemLevelIssues_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.addAll(other.itemLevelIssues_); + } + onChanged(); + } + } else { + if (!other.itemLevelIssues_.isEmpty()) { + if (itemLevelIssuesBuilder_.isEmpty()) { + itemLevelIssuesBuilder_.dispose(); + itemLevelIssuesBuilder_ = null; + itemLevelIssues_ = other.itemLevelIssues_; + bitField0_ = (bitField0_ & ~0x00000002); + itemLevelIssuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getItemLevelIssuesFieldBuilder() + : null; + } else { + itemLevelIssuesBuilder_.addAllMessages(other.itemLevelIssues_); + } + } + } + if (other.hasCreationDate()) { + mergeCreationDate(other.getCreationDate()); + } + if (other.hasLastUpdateDate()) { + mergeLastUpdateDate(other.getLastUpdateDate()); + } + if (other.hasGoogleExpirationDate()) { + mergeGoogleExpirationDate(other.getGoogleExpirationDate()); + } + 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 26: + { + com.google.shopping.css.v1.CssProductStatus.DestinationStatus m = + input.readMessage( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.parser(), + extensionRegistry); + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.add(m); + } else { + destinationStatusesBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue m = + input.readMessage( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.parser(), + extensionRegistry); + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.add(m); + } else { + itemLevelIssuesBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + input.readMessage(getCreationDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + input.readMessage(getLastUpdateDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 + case 58: + { + input.readMessage( + getGoogleExpirationDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + 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.util.List + destinationStatuses_ = java.util.Collections.emptyList(); + + private void ensureDestinationStatusesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + destinationStatuses_ = + new java.util.ArrayList( + destinationStatuses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.DestinationStatus, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder, + com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder> + destinationStatusesBuilder_; + + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public java.util.List + getDestinationStatusesList() { + if (destinationStatusesBuilder_ == null) { + return java.util.Collections.unmodifiableList(destinationStatuses_); + } else { + return destinationStatusesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public int getDestinationStatusesCount() { + if (destinationStatusesBuilder_ == null) { + return destinationStatuses_.size(); + } else { + return destinationStatusesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus getDestinationStatuses( + int index) { + if (destinationStatusesBuilder_ == null) { + return destinationStatuses_.get(index); + } else { + return destinationStatusesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder setDestinationStatuses( + int index, com.google.shopping.css.v1.CssProductStatus.DestinationStatus value) { + if (destinationStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationStatusesIsMutable(); + destinationStatuses_.set(index, value); + onChanged(); + } else { + destinationStatusesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder setDestinationStatuses( + int index, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder builderForValue) { + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.set(index, builderForValue.build()); + onChanged(); + } else { + destinationStatusesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder addDestinationStatuses( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus value) { + if (destinationStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationStatusesIsMutable(); + destinationStatuses_.add(value); + onChanged(); + } else { + destinationStatusesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder addDestinationStatuses( + int index, com.google.shopping.css.v1.CssProductStatus.DestinationStatus value) { + if (destinationStatusesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDestinationStatusesIsMutable(); + destinationStatuses_.add(index, value); + onChanged(); + } else { + destinationStatusesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder addDestinationStatuses( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder builderForValue) { + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.add(builderForValue.build()); + onChanged(); + } else { + destinationStatusesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder addDestinationStatuses( + int index, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder builderForValue) { + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.add(index, builderForValue.build()); + onChanged(); + } else { + destinationStatusesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder addAllDestinationStatuses( + java.lang.Iterable + values) { + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, destinationStatuses_); + onChanged(); + } else { + destinationStatusesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder clearDestinationStatuses() { + if (destinationStatusesBuilder_ == null) { + destinationStatuses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + destinationStatusesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public Builder removeDestinationStatuses(int index) { + if (destinationStatusesBuilder_ == null) { + ensureDestinationStatusesIsMutable(); + destinationStatuses_.remove(index); + onChanged(); + } else { + destinationStatusesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder + getDestinationStatusesBuilder(int index) { + return getDestinationStatusesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder + getDestinationStatusesOrBuilder(int index) { + if (destinationStatusesBuilder_ == null) { + return destinationStatuses_.get(index); + } else { + return destinationStatusesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public java.util.List< + ? extends com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder> + getDestinationStatusesOrBuilderList() { + if (destinationStatusesBuilder_ != null) { + return destinationStatusesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(destinationStatuses_); + } + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder + addDestinationStatusesBuilder() { + return getDestinationStatusesFieldBuilder() + .addBuilder( + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.getDefaultInstance()); + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder + addDestinationStatusesBuilder(int index) { + return getDestinationStatusesFieldBuilder() + .addBuilder( + index, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.getDefaultInstance()); + } + /** + * + * + *
+     * The intended destinations for the product.
+     * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + public java.util.List + getDestinationStatusesBuilderList() { + return getDestinationStatusesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.DestinationStatus, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder, + com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder> + getDestinationStatusesFieldBuilder() { + if (destinationStatusesBuilder_ == null) { + destinationStatusesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.DestinationStatus, + com.google.shopping.css.v1.CssProductStatus.DestinationStatus.Builder, + com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder>( + destinationStatuses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + destinationStatuses_ = null; + } + return destinationStatusesBuilder_; + } + + private java.util.List + itemLevelIssues_ = java.util.Collections.emptyList(); + + private void ensureItemLevelIssuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + itemLevelIssues_ = + new java.util.ArrayList( + itemLevelIssues_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder> + itemLevelIssuesBuilder_; + + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public java.util.List + getItemLevelIssuesList() { + if (itemLevelIssuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(itemLevelIssues_); + } else { + return itemLevelIssuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public int getItemLevelIssuesCount() { + if (itemLevelIssuesBuilder_ == null) { + return itemLevelIssues_.size(); + } else { + return itemLevelIssuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue getItemLevelIssues( + int index) { + if (itemLevelIssuesBuilder_ == null) { + return itemLevelIssues_.get(index); + } else { + return itemLevelIssuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder setItemLevelIssues( + int index, com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue value) { + if (itemLevelIssuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.set(index, value); + onChanged(); + } else { + itemLevelIssuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder setItemLevelIssues( + int index, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder builderForValue) { + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.set(index, builderForValue.build()); + onChanged(); + } else { + itemLevelIssuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder addItemLevelIssues( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue value) { + if (itemLevelIssuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.add(value); + onChanged(); + } else { + itemLevelIssuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder addItemLevelIssues( + int index, com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue value) { + if (itemLevelIssuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.add(index, value); + onChanged(); + } else { + itemLevelIssuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder addItemLevelIssues( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder builderForValue) { + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.add(builderForValue.build()); + onChanged(); + } else { + itemLevelIssuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder addItemLevelIssues( + int index, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder builderForValue) { + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.add(index, builderForValue.build()); + onChanged(); + } else { + itemLevelIssuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder addAllItemLevelIssues( + java.lang.Iterable + values) { + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, itemLevelIssues_); + onChanged(); + } else { + itemLevelIssuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder clearItemLevelIssues() { + if (itemLevelIssuesBuilder_ == null) { + itemLevelIssues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + itemLevelIssuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public Builder removeItemLevelIssues(int index) { + if (itemLevelIssuesBuilder_ == null) { + ensureItemLevelIssuesIsMutable(); + itemLevelIssues_.remove(index); + onChanged(); + } else { + itemLevelIssuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder + getItemLevelIssuesBuilder(int index) { + return getItemLevelIssuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder + getItemLevelIssuesOrBuilder(int index) { + if (itemLevelIssuesBuilder_ == null) { + return itemLevelIssues_.get(index); + } else { + return itemLevelIssuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public java.util.List< + ? extends com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder> + getItemLevelIssuesOrBuilderList() { + if (itemLevelIssuesBuilder_ != null) { + return itemLevelIssuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(itemLevelIssues_); + } + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder + addItemLevelIssuesBuilder() { + return getItemLevelIssuesFieldBuilder() + .addBuilder( + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.getDefaultInstance()); + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder + addItemLevelIssuesBuilder(int index) { + return getItemLevelIssuesFieldBuilder() + .addBuilder( + index, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.getDefaultInstance()); + } + /** + * + * + *
+     * A list of all issues associated with the product.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + public java.util.List + getItemLevelIssuesBuilderList() { + return getItemLevelIssuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder> + getItemLevelIssuesFieldBuilder() { + if (itemLevelIssuesBuilder_ == null) { + itemLevelIssuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue.Builder, + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder>( + itemLevelIssues_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + itemLevelIssues_ = null; + } + return itemLevelIssuesBuilder_; + } + + private com.google.protobuf.Timestamp creationDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + creationDateBuilder_; + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return Whether the creationDate field is set. + */ + public boolean hasCreationDate() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return The creationDate. + */ + public com.google.protobuf.Timestamp getCreationDate() { + if (creationDateBuilder_ == null) { + return creationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationDate_; + } else { + return creationDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public Builder setCreationDate(com.google.protobuf.Timestamp value) { + if (creationDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + creationDate_ = value; + } else { + creationDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public Builder setCreationDate(com.google.protobuf.Timestamp.Builder builderForValue) { + if (creationDateBuilder_ == null) { + creationDate_ = builderForValue.build(); + } else { + creationDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public Builder mergeCreationDate(com.google.protobuf.Timestamp value) { + if (creationDateBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && creationDate_ != null + && creationDate_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreationDateBuilder().mergeFrom(value); + } else { + creationDate_ = value; + } + } else { + creationDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public Builder clearCreationDate() { + bitField0_ = (bitField0_ & ~0x00000004); + creationDate_ = null; + if (creationDateBuilder_ != null) { + creationDateBuilder_.dispose(); + creationDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public com.google.protobuf.Timestamp.Builder getCreationDateBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreationDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreationDateOrBuilder() { + if (creationDateBuilder_ != null) { + return creationDateBuilder_.getMessageOrBuilder(); + } else { + return creationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : creationDate_; + } + } + /** + * + * + *
+     * Date on which the item has been created, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreationDateFieldBuilder() { + if (creationDateBuilder_ == null) { + creationDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreationDate(), getParentForChildren(), isClean()); + creationDate_ = null; + } + return creationDateBuilder_; + } + + private com.google.protobuf.Timestamp lastUpdateDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + lastUpdateDateBuilder_; + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return Whether the lastUpdateDate field is set. + */ + public boolean hasLastUpdateDate() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return The lastUpdateDate. + */ + public com.google.protobuf.Timestamp getLastUpdateDate() { + if (lastUpdateDateBuilder_ == null) { + return lastUpdateDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastUpdateDate_; + } else { + return lastUpdateDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public Builder setLastUpdateDate(com.google.protobuf.Timestamp value) { + if (lastUpdateDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastUpdateDate_ = value; + } else { + lastUpdateDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public Builder setLastUpdateDate(com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastUpdateDateBuilder_ == null) { + lastUpdateDate_ = builderForValue.build(); + } else { + lastUpdateDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public Builder mergeLastUpdateDate(com.google.protobuf.Timestamp value) { + if (lastUpdateDateBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && lastUpdateDate_ != null + && lastUpdateDate_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getLastUpdateDateBuilder().mergeFrom(value); + } else { + lastUpdateDate_ = value; + } + } else { + lastUpdateDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public Builder clearLastUpdateDate() { + bitField0_ = (bitField0_ & ~0x00000008); + lastUpdateDate_ = null; + if (lastUpdateDateBuilder_ != null) { + lastUpdateDateBuilder_.dispose(); + lastUpdateDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public com.google.protobuf.Timestamp.Builder getLastUpdateDateBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getLastUpdateDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + public com.google.protobuf.TimestampOrBuilder getLastUpdateDateOrBuilder() { + if (lastUpdateDateBuilder_ != null) { + return lastUpdateDateBuilder_.getMessageOrBuilder(); + } else { + return lastUpdateDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastUpdateDate_; + } + } + /** + * + * + *
+     * Date on which the item has been last updated, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getLastUpdateDateFieldBuilder() { + if (lastUpdateDateBuilder_ == null) { + lastUpdateDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLastUpdateDate(), getParentForChildren(), isClean()); + lastUpdateDate_ = null; + } + return lastUpdateDateBuilder_; + } + + private com.google.protobuf.Timestamp googleExpirationDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + googleExpirationDateBuilder_; + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return Whether the googleExpirationDate field is set. + */ + public boolean hasGoogleExpirationDate() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return The googleExpirationDate. + */ + public com.google.protobuf.Timestamp getGoogleExpirationDate() { + if (googleExpirationDateBuilder_ == null) { + return googleExpirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : googleExpirationDate_; + } else { + return googleExpirationDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public Builder setGoogleExpirationDate(com.google.protobuf.Timestamp value) { + if (googleExpirationDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + googleExpirationDate_ = value; + } else { + googleExpirationDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public Builder setGoogleExpirationDate(com.google.protobuf.Timestamp.Builder builderForValue) { + if (googleExpirationDateBuilder_ == null) { + googleExpirationDate_ = builderForValue.build(); + } else { + googleExpirationDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public Builder mergeGoogleExpirationDate(com.google.protobuf.Timestamp value) { + if (googleExpirationDateBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && googleExpirationDate_ != null + && googleExpirationDate_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getGoogleExpirationDateBuilder().mergeFrom(value); + } else { + googleExpirationDate_ = value; + } + } else { + googleExpirationDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public Builder clearGoogleExpirationDate() { + bitField0_ = (bitField0_ & ~0x00000010); + googleExpirationDate_ = null; + if (googleExpirationDateBuilder_ != null) { + googleExpirationDateBuilder_.dispose(); + googleExpirationDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public com.google.protobuf.Timestamp.Builder getGoogleExpirationDateBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getGoogleExpirationDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + public com.google.protobuf.TimestampOrBuilder getGoogleExpirationDateOrBuilder() { + if (googleExpirationDateBuilder_ != null) { + return googleExpirationDateBuilder_.getMessageOrBuilder(); + } else { + return googleExpirationDate_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : googleExpirationDate_; + } + } + /** + * + * + *
+     * Date on which the item expires in Google Shopping, in [ISO
+     * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+     * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getGoogleExpirationDateFieldBuilder() { + if (googleExpirationDateBuilder_ == null) { + googleExpirationDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getGoogleExpirationDate(), getParentForChildren(), isClean()); + googleExpirationDate_ = null; + } + return googleExpirationDateBuilder_; + } + + @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.css.v1.CssProductStatus) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.CssProductStatus) + private static final com.google.shopping.css.v1.CssProductStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.CssProductStatus(); + } + + public static com.google.shopping.css.v1.CssProductStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CssProductStatus 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.css.v1.CssProductStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatusOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatusOrBuilder.java new file mode 100644 index 000000000000..5e9b182b12b3 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductStatusOrBuilder.java @@ -0,0 +1,262 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface CssProductStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.CssProductStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + java.util.List + getDestinationStatusesList(); + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + com.google.shopping.css.v1.CssProductStatus.DestinationStatus getDestinationStatuses(int index); + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + int getDestinationStatusesCount(); + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + java.util.List + getDestinationStatusesOrBuilderList(); + /** + * + * + *
+   * The intended destinations for the product.
+   * 
+ * + * + * repeated .google.shopping.css.v1.CssProductStatus.DestinationStatus destination_statuses = 3; + * + */ + com.google.shopping.css.v1.CssProductStatus.DestinationStatusOrBuilder + getDestinationStatusesOrBuilder(int index); + + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + java.util.List + getItemLevelIssuesList(); + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssue getItemLevelIssues(int index); + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + int getItemLevelIssuesCount(); + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + java.util.List + getItemLevelIssuesOrBuilderList(); + /** + * + * + *
+   * A list of all issues associated with the product.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProductStatus.ItemLevelIssue item_level_issues = 4; + * + */ + com.google.shopping.css.v1.CssProductStatus.ItemLevelIssueOrBuilder getItemLevelIssuesOrBuilder( + int index); + + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return Whether the creationDate field is set. + */ + boolean hasCreationDate(); + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + * + * @return The creationDate. + */ + com.google.protobuf.Timestamp getCreationDate(); + /** + * + * + *
+   * Date on which the item has been created, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp creation_date = 5; + */ + com.google.protobuf.TimestampOrBuilder getCreationDateOrBuilder(); + + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return Whether the lastUpdateDate field is set. + */ + boolean hasLastUpdateDate(); + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + * + * @return The lastUpdateDate. + */ + com.google.protobuf.Timestamp getLastUpdateDate(); + /** + * + * + *
+   * Date on which the item has been last updated, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp last_update_date = 6; + */ + com.google.protobuf.TimestampOrBuilder getLastUpdateDateOrBuilder(); + + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return Whether the googleExpirationDate field is set. + */ + boolean hasGoogleExpirationDate(); + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + * + * @return The googleExpirationDate. + */ + com.google.protobuf.Timestamp getGoogleExpirationDate(); + /** + * + * + *
+   * Date on which the item expires in Google Shopping, in [ISO
+   * 8601](http://en.wikipedia.org/wiki/ISO_8601) format.
+   * 
+ * + * .google.protobuf.Timestamp google_expiration_date = 7; + */ + com.google.protobuf.TimestampOrBuilder getGoogleExpirationDateOrBuilder(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsProto.java new file mode 100644 index 000000000000..8ab6b6b1613d --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/CssProductsProto.java @@ -0,0 +1,166 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +public final class CssProductsProto { + private CssProductsProto() {} + + 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_css_v1_GetCssProductRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_GetCssProductRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_CssProduct_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_CssProduct_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListCssProductsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_css_v1_ListCssProductsResponse_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/css/v1/css_products.pr" + + "oto\022\026google.shopping.css.v1\032\034google/api/" + + "annotations.proto\032\027google/api/client.pro" + + "to\032\037google/api/field_behavior.proto\032\031goo" + + "gle/api/resource.proto\032/google/shopping/" + + "css/v1/css_product_common.proto\032 google/" + + "shopping/type/types.proto\"L\n\024GetCssProdu" + + "ctRequest\0224\n\004name\030\001 \001(\tB&\342A\001\002\372A\037\n\035css.go" + + "ogleapis.com/CssProduct\"\260\003\n\nCssProduct\022\014" + + "\n\004name\030\001 \001(\t\022\035\n\017raw_provided_id\030\002 \001(\tB\004\342" + + "A\001\003\022\036\n\020content_language\030\003 \001(\tB\004\342A\001\003\022\030\n\nf" + + "eed_label\030\004 \001(\tB\004\342A\001\003\022<\n\nattributes\030\005 \001(" + + "\0132\".google.shopping.css.v1.AttributesB\004\342" + + "A\001\003\022F\n\021custom_attributes\030\006 \003(\0132%.google." + + "shopping.type.CustomAttributeB\004\342A\001\003\022J\n\022c" + + "ss_product_status\030\010 \001(\0132(.google.shoppin" + + "g.css.v1.CssProductStatusB\004\342A\001\003:i\352Af\n\035cs" + + "s.googleapis.com/CssProduct\022,accounts/{a" + + "ccount}/cssProducts/{css_product}*\013cssPr" + + "oducts2\ncssProduct\"w\n\026ListCssProductsReq" + + "uest\0226\n\006parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035css.googl" + + "eapis.com/CssProduct\022\021\n\tpage_size\030\002 \001(\005\022" + + "\022\n\npage_token\030\003 \001(\t\"l\n\027ListCssProductsRe" + + "sponse\0228\n\014css_products\030\001 \003(\0132\".google.sh" + + "opping.css.v1.CssProduct\022\027\n\017next_page_to" + + "ken\030\002 \001(\t2\230\003\n\022CssProductsService\022\225\001\n\rGet" + + "CssProduct\022,.google.shopping.css.v1.GetC" + + "ssProductRequest\032\".google.shopping.css.v" + + "1.CssProduct\"2\332A\004name\202\323\344\223\002%\022#/v1/{name=a" + + "ccounts/*/cssProducts/*}\022\250\001\n\017ListCssProd" + + "ucts\022..google.shopping.css.v1.ListCssPro" + + "ductsRequest\032/.google.shopping.css.v1.Li" + + "stCssProductsResponse\"4\332A\006parent\202\323\344\223\002%\022#" + + "/v1/{parent=accounts/*}/cssProducts\032?\312A\022" + + "css.googleapis.com\322A\'https://www.googlea" + + "pis.com/auth/contentB\262\001\n\032com.google.shop" + + "ping.css.v1B\020CssProductsProtoP\001Z2cloud.g" + + "oogle.com/go/shopping/css/apiv1/csspb;cs" + + "spb\252\002\026Google.Shopping.Css.V1\312\002\026Google\\Sh" + + "opping\\Css\\V1\352\002\031Google::Shopping::Css::V" + + "1b\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.shopping.css.v1.CssProductCommonProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + }); + internal_static_google_shopping_css_v1_GetCssProductRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_css_v1_GetCssProductRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_GetCssProductRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_shopping_css_v1_CssProduct_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_css_v1_CssProduct_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_CssProduct_descriptor, + new java.lang.String[] { + "Name", + "RawProvidedId", + "ContentLanguage", + "FeedLabel", + "Attributes", + "CustomAttributes", + "CssProductStatus", + }); + internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_css_v1_ListCssProductsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_css_v1_ListCssProductsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor, + new java.lang.String[] { + "CssProducts", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.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.shopping.css.v1.CssProductCommonProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequest.java new file mode 100644 index 000000000000..b4362cccd6df --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the 'DeleteAccountLabel' method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.DeleteAccountLabelRequest} + */ +public final class DeleteAccountLabelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.DeleteAccountLabelRequest) + DeleteAccountLabelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAccountLabelRequest.newBuilder() to construct. + private DeleteAccountLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAccountLabelRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAccountLabelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.DeleteAccountLabelRequest.class, + com.google.shopping.css.v1.DeleteAccountLabelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the label to delete.
+   * Format:  accounts/{account}/labels/{label}
+   * 
+ * + * + * 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 label to delete.
+   * Format:  accounts/{account}/labels/{label}
+   * 
+ * + * + * 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.css.v1.DeleteAccountLabelRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.DeleteAccountLabelRequest other = + (com.google.shopping.css.v1.DeleteAccountLabelRequest) 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.css.v1.DeleteAccountLabelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest 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 'DeleteAccountLabel' method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.DeleteAccountLabelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.DeleteAccountLabelRequest) + com.google.shopping.css.v1.DeleteAccountLabelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.DeleteAccountLabelRequest.class, + com.google.shopping.css.v1.DeleteAccountLabelRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.DeleteAccountLabelRequest.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.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_DeleteAccountLabelRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteAccountLabelRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.DeleteAccountLabelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteAccountLabelRequest build() { + com.google.shopping.css.v1.DeleteAccountLabelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteAccountLabelRequest buildPartial() { + com.google.shopping.css.v1.DeleteAccountLabelRequest result = + new com.google.shopping.css.v1.DeleteAccountLabelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest) { + return mergeFrom((com.google.shopping.css.v1.DeleteAccountLabelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.DeleteAccountLabelRequest other) { + if (other == com.google.shopping.css.v1.DeleteAccountLabelRequest.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 label to delete.
+     * Format:  accounts/{account}/labels/{label}
+     * 
+ * + * + * 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 label to delete.
+     * Format:  accounts/{account}/labels/{label}
+     * 
+ * + * + * 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 label to delete.
+     * Format:  accounts/{account}/labels/{label}
+     * 
+ * + * + * 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 label to delete.
+     * Format:  accounts/{account}/labels/{label}
+     * 
+ * + * + * 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 label to delete.
+     * Format:  accounts/{account}/labels/{label}
+     * 
+ * + * + * 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.css.v1.DeleteAccountLabelRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.DeleteAccountLabelRequest) + private static final com.google.shopping.css.v1.DeleteAccountLabelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.DeleteAccountLabelRequest(); + } + + public static com.google.shopping.css.v1.DeleteAccountLabelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteAccountLabelRequest 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.css.v1.DeleteAccountLabelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequestOrBuilder.java new file mode 100644 index 000000000000..df9518fd678c --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteAccountLabelRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface DeleteAccountLabelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.DeleteAccountLabelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the label to delete.
+   * Format:  accounts/{account}/labels/{label}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the label to delete.
+   * Format:  accounts/{account}/labels/{label}
+   * 
+ * + * + * 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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequest.java new file mode 100644 index 000000000000..a2f5c58827dc --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequest.java @@ -0,0 +1,796 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the DeleteCssProductInput method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.DeleteCssProductInputRequest} + */ +public final class DeleteCssProductInputRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.DeleteCssProductInputRequest) + DeleteCssProductInputRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteCssProductInputRequest.newBuilder() to construct. + private DeleteCssProductInputRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteCssProductInputRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteCssProductInputRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.DeleteCssProductInputRequest.class, + com.google.shopping.css.v1.DeleteCssProductInputRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the CSS product input resource to delete.
+   * Format: accounts/{account}/cssProductInputs/{css_product_input}
+   * 
+ * + * + * 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 CSS product input resource to delete.
+   * Format: accounts/{account}/cssProductInputs/{css_product_input}
+   * 
+ * + * + * 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; + } + } + + public static final int SUPPLEMENTAL_FEED_ID_FIELD_NUMBER = 2; + private long supplementalFeedId_ = 0L; + /** + * + * + *
+   * The Content API Supplemental Feed ID.
+   * The field must not be set if the action applies to a primary feed.
+   * If the field is set, then product action applies to a supplemental feed
+   * instead of primary Content API feed.
+   * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return Whether the supplementalFeedId field is set. + */ + @java.lang.Override + public boolean hasSupplementalFeedId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The Content API Supplemental Feed ID.
+   * The field must not be set if the action applies to a primary feed.
+   * If the field is set, then product action applies to a supplemental feed
+   * instead of primary Content API feed.
+   * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return The supplementalFeedId. + */ + @java.lang.Override + public long getSupplementalFeedId() { + return supplementalFeedId_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(2, supplementalFeedId_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, supplementalFeedId_); + } + 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.css.v1.DeleteCssProductInputRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.DeleteCssProductInputRequest other = + (com.google.shopping.css.v1.DeleteCssProductInputRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSupplementalFeedId() != other.hasSupplementalFeedId()) return false; + if (hasSupplementalFeedId()) { + if (getSupplementalFeedId() != other.getSupplementalFeedId()) 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(); + if (hasSupplementalFeedId()) { + hash = (37 * hash) + SUPPLEMENTAL_FEED_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSupplementalFeedId()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest 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 DeleteCssProductInput method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.DeleteCssProductInputRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.DeleteCssProductInputRequest) + com.google.shopping.css.v1.DeleteCssProductInputRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.DeleteCssProductInputRequest.class, + com.google.shopping.css.v1.DeleteCssProductInputRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.DeleteCssProductInputRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + supplementalFeedId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_DeleteCssProductInputRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteCssProductInputRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.DeleteCssProductInputRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteCssProductInputRequest build() { + com.google.shopping.css.v1.DeleteCssProductInputRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.DeleteCssProductInputRequest buildPartial() { + com.google.shopping.css.v1.DeleteCssProductInputRequest result = + new com.google.shopping.css.v1.DeleteCssProductInputRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.DeleteCssProductInputRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.supplementalFeedId_ = supplementalFeedId_; + 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.css.v1.DeleteCssProductInputRequest) { + return mergeFrom((com.google.shopping.css.v1.DeleteCssProductInputRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.DeleteCssProductInputRequest other) { + if (other == com.google.shopping.css.v1.DeleteCssProductInputRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSupplementalFeedId()) { + setSupplementalFeedId(other.getSupplementalFeedId()); + } + 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: + { + supplementalFeedId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the CSS product input resource to delete.
+     * Format: accounts/{account}/cssProductInputs/{css_product_input}
+     * 
+ * + * + * 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 CSS product input resource to delete.
+     * Format: accounts/{account}/cssProductInputs/{css_product_input}
+     * 
+ * + * + * 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 CSS product input resource to delete.
+     * Format: accounts/{account}/cssProductInputs/{css_product_input}
+     * 
+ * + * + * 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 CSS product input resource to delete.
+     * Format: accounts/{account}/cssProductInputs/{css_product_input}
+     * 
+ * + * + * 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 CSS product input resource to delete.
+     * Format: accounts/{account}/cssProductInputs/{css_product_input}
+     * 
+ * + * + * 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; + } + + private long supplementalFeedId_; + /** + * + * + *
+     * The Content API Supplemental Feed ID.
+     * The field must not be set if the action applies to a primary feed.
+     * If the field is set, then product action applies to a supplemental feed
+     * instead of primary Content API feed.
+     * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return Whether the supplementalFeedId field is set. + */ + @java.lang.Override + public boolean hasSupplementalFeedId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The Content API Supplemental Feed ID.
+     * The field must not be set if the action applies to a primary feed.
+     * If the field is set, then product action applies to a supplemental feed
+     * instead of primary Content API feed.
+     * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return The supplementalFeedId. + */ + @java.lang.Override + public long getSupplementalFeedId() { + return supplementalFeedId_; + } + /** + * + * + *
+     * The Content API Supplemental Feed ID.
+     * The field must not be set if the action applies to a primary feed.
+     * If the field is set, then product action applies to a supplemental feed
+     * instead of primary Content API feed.
+     * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @param value The supplementalFeedId to set. + * @return This builder for chaining. + */ + public Builder setSupplementalFeedId(long value) { + + supplementalFeedId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The Content API Supplemental Feed ID.
+     * The field must not be set if the action applies to a primary feed.
+     * If the field is set, then product action applies to a supplemental feed
+     * instead of primary Content API feed.
+     * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearSupplementalFeedId() { + bitField0_ = (bitField0_ & ~0x00000002); + supplementalFeedId_ = 0L; + 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.css.v1.DeleteCssProductInputRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.DeleteCssProductInputRequest) + private static final com.google.shopping.css.v1.DeleteCssProductInputRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.DeleteCssProductInputRequest(); + } + + public static com.google.shopping.css.v1.DeleteCssProductInputRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCssProductInputRequest 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.css.v1.DeleteCssProductInputRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequestOrBuilder.java new file mode 100644 index 000000000000..0b72bd4a218b --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/DeleteCssProductInputRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +public interface DeleteCssProductInputRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.DeleteCssProductInputRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the CSS product input resource to delete.
+   * Format: accounts/{account}/cssProductInputs/{css_product_input}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the CSS product input resource to delete.
+   * Format: accounts/{account}/cssProductInputs/{css_product_input}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The Content API Supplemental Feed ID.
+   * The field must not be set if the action applies to a primary feed.
+   * If the field is set, then product action applies to a supplemental feed
+   * instead of primary Content API feed.
+   * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return Whether the supplementalFeedId field is set. + */ + boolean hasSupplementalFeedId(); + /** + * + * + *
+   * The Content API Supplemental Feed ID.
+   * The field must not be set if the action applies to a primary feed.
+   * If the field is set, then product action applies to a supplemental feed
+   * instead of primary Content API feed.
+   * 
+ * + * optional int64 supplemental_feed_id = 2; + * + * @return The supplementalFeedId. + */ + long getSupplementalFeedId(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequest.java new file mode 100644 index 000000000000..10891b1de5bd --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequest.java @@ -0,0 +1,900 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The request message for the `GetAccount` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.GetAccountRequest} + */ +public final class GetAccountRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.GetAccountRequest) + GetAccountRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAccountRequest.newBuilder() to construct. + private GetAccountRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAccountRequest() { + name_ = ""; + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAccountRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_GetAccountRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_GetAccountRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.GetAccountRequest.class, + com.google.shopping.css.v1.GetAccountRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the managed CSS/MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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 managed CSS/MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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; + } + } + + public static final int PARENT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + @java.lang.Override + public boolean hasParent() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, parent_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, parent_); + } + 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.css.v1.GetAccountRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.GetAccountRequest other = + (com.google.shopping.css.v1.GetAccountRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasParent() != other.hasParent()) return false; + if (hasParent()) { + if (!getParent().equals(other.getParent())) 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(); + if (hasParent()) { + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.GetAccountRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetAccountRequest 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.css.v1.GetAccountRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetAccountRequest 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.css.v1.GetAccountRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetAccountRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.GetAccountRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetAccountRequest 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.css.v1.GetAccountRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetAccountRequest 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.css.v1.GetAccountRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetAccountRequest 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.css.v1.GetAccountRequest 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 request message for the `GetAccount` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.GetAccountRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.GetAccountRequest) + com.google.shopping.css.v1.GetAccountRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_GetAccountRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_GetAccountRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.GetAccountRequest.class, + com.google.shopping.css.v1.GetAccountRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.GetAccountRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_GetAccountRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.GetAccountRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.GetAccountRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.GetAccountRequest build() { + com.google.shopping.css.v1.GetAccountRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.GetAccountRequest buildPartial() { + com.google.shopping.css.v1.GetAccountRequest result = + new com.google.shopping.css.v1.GetAccountRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.GetAccountRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.parent_ = parent_; + 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.css.v1.GetAccountRequest) { + return mergeFrom((com.google.shopping.css.v1.GetAccountRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.GetAccountRequest other) { + if (other == com.google.shopping.css.v1.GetAccountRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasParent()) { + parent_ = other.parent_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the managed CSS/MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 managed CSS/MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 managed CSS/MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 managed CSS/MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 managed CSS/MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + public boolean hasParent() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required when retrieving MC account information.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.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_ |= 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.css.v1.GetAccountRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.GetAccountRequest) + private static final com.google.shopping.css.v1.GetAccountRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.GetAccountRequest(); + } + + public static com.google.shopping.css.v1.GetAccountRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetAccountRequest 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.css.v1.GetAccountRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequestOrBuilder.java new file mode 100644 index 000000000000..dd8924dfd787 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetAccountRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public interface GetAccountRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.GetAccountRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the managed CSS/MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the managed CSS/MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + boolean hasParent(); + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Optional. Only required when retrieving MC account information.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequest.java new file mode 100644 index 000000000000..3630e7b651e9 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequest.java @@ -0,0 +1,638 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The request message for the `GetCssProduct` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.GetCssProductRequest} + */ +public final class GetCssProductRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.GetCssProductRequest) + GetCssProductRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCssProductRequest.newBuilder() to construct. + private GetCssProductRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCssProductRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCssProductRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_GetCssProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_GetCssProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.GetCssProductRequest.class, + com.google.shopping.css.v1.GetCssProductRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the CSS product to retrieve.
+   * 
+ * + * + * 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 CSS product to retrieve.
+   * 
+ * + * + * 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.css.v1.GetCssProductRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.GetCssProductRequest other = + (com.google.shopping.css.v1.GetCssProductRequest) 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.css.v1.GetCssProductRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.GetCssProductRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.GetCssProductRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest 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 request message for the `GetCssProduct` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.GetCssProductRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.GetCssProductRequest) + com.google.shopping.css.v1.GetCssProductRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_GetCssProductRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_GetCssProductRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.GetCssProductRequest.class, + com.google.shopping.css.v1.GetCssProductRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.GetCssProductRequest.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.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_GetCssProductRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.GetCssProductRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.GetCssProductRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.GetCssProductRequest build() { + com.google.shopping.css.v1.GetCssProductRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.GetCssProductRequest buildPartial() { + com.google.shopping.css.v1.GetCssProductRequest result = + new com.google.shopping.css.v1.GetCssProductRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.GetCssProductRequest 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.css.v1.GetCssProductRequest) { + return mergeFrom((com.google.shopping.css.v1.GetCssProductRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.GetCssProductRequest other) { + if (other == com.google.shopping.css.v1.GetCssProductRequest.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 CSS product to retrieve.
+     * 
+ * + * + * 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 CSS product to retrieve.
+     * 
+ * + * + * 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 CSS product to retrieve.
+     * 
+ * + * + * 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 CSS product to retrieve.
+     * 
+ * + * + * 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 CSS product to retrieve.
+     * 
+ * + * + * 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.css.v1.GetCssProductRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.GetCssProductRequest) + private static final com.google.shopping.css.v1.GetCssProductRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.GetCssProductRequest(); + } + + public static com.google.shopping.css.v1.GetCssProductRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCssProductRequest 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.css.v1.GetCssProductRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequestOrBuilder.java new file mode 100644 index 000000000000..5b636116a79d --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/GetCssProductRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +public interface GetCssProductRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.GetCssProductRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the CSS product to retrieve.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the CSS product to retrieve.
+   * 
+ * + * + * 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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequest.java new file mode 100644 index 000000000000..eaee131ed192 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequest.java @@ -0,0 +1,1046 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the InsertCssProductInput method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.InsertCssProductInputRequest} + */ +public final class InsertCssProductInputRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.InsertCssProductInputRequest) + InsertCssProductInputRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InsertCssProductInputRequest.newBuilder() to construct. + private InsertCssProductInputRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InsertCssProductInputRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InsertCssProductInputRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_InsertCssProductInputRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.InsertCssProductInputRequest.class, + com.google.shopping.css.v1.InsertCssProductInputRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The account where this CSS Product will be inserted.
+   * 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 CSS Product will be inserted.
+   * 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 CSS_PRODUCT_INPUT_FIELD_NUMBER = 2; + private com.google.shopping.css.v1.CssProductInput cssProductInput_; + /** + * + * + *
+   * Required. The CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cssProductInput field is set. + */ + @java.lang.Override + public boolean hasCssProductInput() { + return cssProductInput_ != null; + } + /** + * + * + *
+   * Required. The CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cssProductInput. + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductInput getCssProductInput() { + return cssProductInput_ == null + ? com.google.shopping.css.v1.CssProductInput.getDefaultInstance() + : cssProductInput_; + } + /** + * + * + *
+   * Required. The CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductInputOrBuilder getCssProductInputOrBuilder() { + return cssProductInput_ == null + ? com.google.shopping.css.v1.CssProductInput.getDefaultInstance() + : cssProductInput_; + } + + public static final int FEED_ID_FIELD_NUMBER = 3; + private long feedId_ = 0L; + /** + * + * + *
+   * Required. The primary or supplemental feed id. If CSS Product already
+   * exists and feed id provided is different, then the CSS Product will be
+   * moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
+   * we create feeds on the fly. We do not have supplemental feed support for
+   * CSS Products yet.
+   * 
+ * + * int64 feed_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The feedId. + */ + @java.lang.Override + public long getFeedId() { + return feedId_; + } + + 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 (cssProductInput_ != null) { + output.writeMessage(2, getCssProductInput()); + } + if (feedId_ != 0L) { + output.writeInt64(3, feedId_); + } + 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 (cssProductInput_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCssProductInput()); + } + if (feedId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, feedId_); + } + 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.css.v1.InsertCssProductInputRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.InsertCssProductInputRequest other = + (com.google.shopping.css.v1.InsertCssProductInputRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasCssProductInput() != other.hasCssProductInput()) return false; + if (hasCssProductInput()) { + if (!getCssProductInput().equals(other.getCssProductInput())) return false; + } + if (getFeedId() != other.getFeedId()) 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 (hasCssProductInput()) { + hash = (37 * hash) + CSS_PRODUCT_INPUT_FIELD_NUMBER; + hash = (53 * hash) + getCssProductInput().hashCode(); + } + hash = (37 * hash) + FEED_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFeedId()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest 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 InsertCssProductInput method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.InsertCssProductInputRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.InsertCssProductInputRequest) + com.google.shopping.css.v1.InsertCssProductInputRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_InsertCssProductInputRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.InsertCssProductInputRequest.class, + com.google.shopping.css.v1.InsertCssProductInputRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.InsertCssProductInputRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + cssProductInput_ = null; + if (cssProductInputBuilder_ != null) { + cssProductInputBuilder_.dispose(); + cssProductInputBuilder_ = null; + } + feedId_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductInputsProto + .internal_static_google_shopping_css_v1_InsertCssProductInputRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.InsertCssProductInputRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.InsertCssProductInputRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.InsertCssProductInputRequest build() { + com.google.shopping.css.v1.InsertCssProductInputRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.InsertCssProductInputRequest buildPartial() { + com.google.shopping.css.v1.InsertCssProductInputRequest result = + new com.google.shopping.css.v1.InsertCssProductInputRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.InsertCssProductInputRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cssProductInput_ = + cssProductInputBuilder_ == null ? cssProductInput_ : cssProductInputBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.feedId_ = feedId_; + } + } + + @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.css.v1.InsertCssProductInputRequest) { + return mergeFrom((com.google.shopping.css.v1.InsertCssProductInputRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.InsertCssProductInputRequest other) { + if (other == com.google.shopping.css.v1.InsertCssProductInputRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCssProductInput()) { + mergeCssProductInput(other.getCssProductInput()); + } + if (other.getFeedId() != 0L) { + setFeedId(other.getFeedId()); + } + 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(getCssProductInputFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + feedId_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The account where this CSS Product will be inserted.
+     * 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 CSS Product will be inserted.
+     * 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 CSS Product will be inserted.
+     * 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 CSS Product will be inserted.
+     * 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 CSS Product will be inserted.
+     * 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.css.v1.CssProductInput cssProductInput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductInput, + com.google.shopping.css.v1.CssProductInput.Builder, + com.google.shopping.css.v1.CssProductInputOrBuilder> + cssProductInputBuilder_; + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cssProductInput field is set. + */ + public boolean hasCssProductInput() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cssProductInput. + */ + public com.google.shopping.css.v1.CssProductInput getCssProductInput() { + if (cssProductInputBuilder_ == null) { + return cssProductInput_ == null + ? com.google.shopping.css.v1.CssProductInput.getDefaultInstance() + : cssProductInput_; + } else { + return cssProductInputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCssProductInput(com.google.shopping.css.v1.CssProductInput value) { + if (cssProductInputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cssProductInput_ = value; + } else { + cssProductInputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCssProductInput( + com.google.shopping.css.v1.CssProductInput.Builder builderForValue) { + if (cssProductInputBuilder_ == null) { + cssProductInput_ = builderForValue.build(); + } else { + cssProductInputBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCssProductInput(com.google.shopping.css.v1.CssProductInput value) { + if (cssProductInputBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cssProductInput_ != null + && cssProductInput_ + != com.google.shopping.css.v1.CssProductInput.getDefaultInstance()) { + getCssProductInputBuilder().mergeFrom(value); + } else { + cssProductInput_ = value; + } + } else { + cssProductInputBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCssProductInput() { + bitField0_ = (bitField0_ & ~0x00000002); + cssProductInput_ = null; + if (cssProductInputBuilder_ != null) { + cssProductInputBuilder_.dispose(); + cssProductInputBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.CssProductInput.Builder getCssProductInputBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCssProductInputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.CssProductInputOrBuilder getCssProductInputOrBuilder() { + if (cssProductInputBuilder_ != null) { + return cssProductInputBuilder_.getMessageOrBuilder(); + } else { + return cssProductInput_ == null + ? com.google.shopping.css.v1.CssProductInput.getDefaultInstance() + : cssProductInput_; + } + } + /** + * + * + *
+     * Required. The CSS Product Input to insert.
+     * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductInput, + com.google.shopping.css.v1.CssProductInput.Builder, + com.google.shopping.css.v1.CssProductInputOrBuilder> + getCssProductInputFieldBuilder() { + if (cssProductInputBuilder_ == null) { + cssProductInputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.CssProductInput, + com.google.shopping.css.v1.CssProductInput.Builder, + com.google.shopping.css.v1.CssProductInputOrBuilder>( + getCssProductInput(), getParentForChildren(), isClean()); + cssProductInput_ = null; + } + return cssProductInputBuilder_; + } + + private long feedId_; + /** + * + * + *
+     * Required. The primary or supplemental feed id. If CSS Product already
+     * exists and feed id provided is different, then the CSS Product will be
+     * moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
+     * we create feeds on the fly. We do not have supplemental feed support for
+     * CSS Products yet.
+     * 
+ * + * int64 feed_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The feedId. + */ + @java.lang.Override + public long getFeedId() { + return feedId_; + } + /** + * + * + *
+     * Required. The primary or supplemental feed id. If CSS Product already
+     * exists and feed id provided is different, then the CSS Product will be
+     * moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
+     * we create feeds on the fly. We do not have supplemental feed support for
+     * CSS Products yet.
+     * 
+ * + * int64 feed_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The feedId to set. + * @return This builder for chaining. + */ + public Builder setFeedId(long value) { + + feedId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The primary or supplemental feed id. If CSS Product already
+     * exists and feed id provided is different, then the CSS Product will be
+     * moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
+     * we create feeds on the fly. We do not have supplemental feed support for
+     * CSS Products yet.
+     * 
+ * + * int64 feed_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFeedId() { + bitField0_ = (bitField0_ & ~0x00000004); + feedId_ = 0L; + 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.css.v1.InsertCssProductInputRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.InsertCssProductInputRequest) + private static final com.google.shopping.css.v1.InsertCssProductInputRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.InsertCssProductInputRequest(); + } + + public static com.google.shopping.css.v1.InsertCssProductInputRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InsertCssProductInputRequest 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.css.v1.InsertCssProductInputRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequestOrBuilder.java new file mode 100644 index 000000000000..f62342ccb767 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/InsertCssProductInputRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_inputs.proto + +package com.google.shopping.css.v1; + +public interface InsertCssProductInputRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.InsertCssProductInputRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account where this CSS Product will be inserted.
+   * 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 CSS Product will be inserted.
+   * 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 CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cssProductInput field is set. + */ + boolean hasCssProductInput(); + /** + * + * + *
+   * Required. The CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cssProductInput. + */ + com.google.shopping.css.v1.CssProductInput getCssProductInput(); + /** + * + * + *
+   * Required. The CSS Product Input to insert.
+   * 
+ * + * + * .google.shopping.css.v1.CssProductInput css_product_input = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.css.v1.CssProductInputOrBuilder getCssProductInputOrBuilder(); + + /** + * + * + *
+   * Required. The primary or supplemental feed id. If CSS Product already
+   * exists and feed id provided is different, then the CSS Product will be
+   * moved to a new feed. Note: For now, CSSs do not need to provide feed ids as
+   * we create feeds on the fly. We do not have supplemental feed support for
+   * CSS Products yet.
+   * 
+ * + * int64 feed_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The feedId. + */ + long getFeedId(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequest.java new file mode 100644 index 000000000000..d43408a31fbc --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the `ListAccountLabels` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListAccountLabelsRequest} + */ +public final class ListAccountLabelsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListAccountLabelsRequest) + ListAccountLabelsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccountLabelsRequest.newBuilder() to construct. + private ListAccountLabelsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccountLabelsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAccountLabelsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListAccountLabelsRequest.class, + com.google.shopping.css.v1.ListAccountLabelsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent account.
+   * 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 parent account.
+   * 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; + /** + * + * + *
+   * The maximum number of labels to return. The service may return fewer than
+   * this value.
+   * If unspecified, at most 50 labels will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @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_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListAccountLabels` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAccountLabels` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListAccountLabels` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAccountLabels` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @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.css.v1.ListAccountLabelsRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListAccountLabelsRequest other = + (com.google.shopping.css.v1.ListAccountLabelsRequest) 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.css.v1.ListAccountLabelsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest 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 `ListAccountLabels` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListAccountLabelsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListAccountLabelsRequest) + com.google.shopping.css.v1.ListAccountLabelsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListAccountLabelsRequest.class, + com.google.shopping.css.v1.ListAccountLabelsRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListAccountLabelsRequest.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.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListAccountLabelsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsRequest build() { + com.google.shopping.css.v1.ListAccountLabelsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsRequest buildPartial() { + com.google.shopping.css.v1.ListAccountLabelsRequest result = + new com.google.shopping.css.v1.ListAccountLabelsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest) { + return mergeFrom((com.google.shopping.css.v1.ListAccountLabelsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListAccountLabelsRequest other) { + if (other == com.google.shopping.css.v1.ListAccountLabelsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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 parent account.
+     * 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_; + /** + * + * + *
+     * The maximum number of labels to return. The service may return fewer than
+     * this value.
+     * If unspecified, at most 50 labels will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of labels to return. The service may return fewer than
+     * this value.
+     * If unspecified, at most 50 labels will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of labels to return. The service may return fewer than
+     * this value.
+     * If unspecified, at most 50 labels will be returned.
+     * The maximum value is 1000; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListAccountLabels` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAccountLabels` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListAccountLabels` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAccountLabels` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListAccountLabels` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAccountLabels` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token, received from a previous `ListAccountLabels` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAccountLabels` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListAccountLabels` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListAccountLabels` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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.css.v1.ListAccountLabelsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListAccountLabelsRequest) + private static final com.google.shopping.css.v1.ListAccountLabelsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListAccountLabelsRequest(); + } + + public static com.google.shopping.css.v1.ListAccountLabelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccountLabelsRequest 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.css.v1.ListAccountLabelsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequestOrBuilder.java new file mode 100644 index 000000000000..bde0804457b2 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface ListAccountLabelsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListAccountLabelsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent account.
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent account.
+   * 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(); + + /** + * + * + *
+   * The maximum number of labels to return. The service may return fewer than
+   * this value.
+   * If unspecified, at most 50 labels will be returned.
+   * The maximum value is 1000; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListAccountLabels` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAccountLabels` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListAccountLabels` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListAccountLabels` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponse.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponse.java new file mode 100644 index 000000000000..5cd233403f9f --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponse.java @@ -0,0 +1,1129 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Response message for the `ListAccountLabels` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListAccountLabelsResponse} + */ +public final class ListAccountLabelsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListAccountLabelsResponse) + ListAccountLabelsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccountLabelsResponse.newBuilder() to construct. + private ListAccountLabelsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccountLabelsResponse() { + accountLabels_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAccountLabelsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListAccountLabelsResponse.class, + com.google.shopping.css.v1.ListAccountLabelsResponse.Builder.class); + } + + public static final int ACCOUNT_LABELS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List accountLabels_; + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + @java.lang.Override + public java.util.List getAccountLabelsList() { + return accountLabels_; + } + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + @java.lang.Override + public java.util.List + getAccountLabelsOrBuilderList() { + return accountLabels_; + } + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + @java.lang.Override + public int getAccountLabelsCount() { + return accountLabels_.size(); + } + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel getAccountLabels(int index) { + return accountLabels_.get(index); + } + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelsOrBuilder(int index) { + return accountLabels_.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 < accountLabels_.size(); i++) { + output.writeMessage(1, accountLabels_.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 < accountLabels_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, accountLabels_.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.css.v1.ListAccountLabelsResponse)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListAccountLabelsResponse other = + (com.google.shopping.css.v1.ListAccountLabelsResponse) obj; + + if (!getAccountLabelsList().equals(other.getAccountLabelsList())) 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 (getAccountLabelsCount() > 0) { + hash = (37 * hash) + ACCOUNT_LABELS_FIELD_NUMBER; + hash = (53 * hash) + getAccountLabelsList().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.css.v1.ListAccountLabelsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse 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 `ListAccountLabels` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListAccountLabelsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListAccountLabelsResponse) + com.google.shopping.css.v1.ListAccountLabelsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListAccountLabelsResponse.class, + com.google.shopping.css.v1.ListAccountLabelsResponse.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListAccountLabelsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (accountLabelsBuilder_ == null) { + accountLabels_ = java.util.Collections.emptyList(); + } else { + accountLabels_ = null; + accountLabelsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_ListAccountLabelsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsResponse getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListAccountLabelsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsResponse build() { + com.google.shopping.css.v1.ListAccountLabelsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListAccountLabelsResponse buildPartial() { + com.google.shopping.css.v1.ListAccountLabelsResponse result = + new com.google.shopping.css.v1.ListAccountLabelsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.css.v1.ListAccountLabelsResponse result) { + if (accountLabelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + accountLabels_ = java.util.Collections.unmodifiableList(accountLabels_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.accountLabels_ = accountLabels_; + } else { + result.accountLabels_ = accountLabelsBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse) { + return mergeFrom((com.google.shopping.css.v1.ListAccountLabelsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListAccountLabelsResponse other) { + if (other == com.google.shopping.css.v1.ListAccountLabelsResponse.getDefaultInstance()) + return this; + if (accountLabelsBuilder_ == null) { + if (!other.accountLabels_.isEmpty()) { + if (accountLabels_.isEmpty()) { + accountLabels_ = other.accountLabels_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAccountLabelsIsMutable(); + accountLabels_.addAll(other.accountLabels_); + } + onChanged(); + } + } else { + if (!other.accountLabels_.isEmpty()) { + if (accountLabelsBuilder_.isEmpty()) { + accountLabelsBuilder_.dispose(); + accountLabelsBuilder_ = null; + accountLabels_ = other.accountLabels_; + bitField0_ = (bitField0_ & ~0x00000001); + accountLabelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAccountLabelsFieldBuilder() + : null; + } else { + accountLabelsBuilder_.addAllMessages(other.accountLabels_); + } + } + } + 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.css.v1.AccountLabel m = + input.readMessage( + com.google.shopping.css.v1.AccountLabel.parser(), extensionRegistry); + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + accountLabels_.add(m); + } else { + accountLabelsBuilder_.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 accountLabels_ = + java.util.Collections.emptyList(); + + private void ensureAccountLabelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + accountLabels_ = + new java.util.ArrayList(accountLabels_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + accountLabelsBuilder_; + + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public java.util.List getAccountLabelsList() { + if (accountLabelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(accountLabels_); + } else { + return accountLabelsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public int getAccountLabelsCount() { + if (accountLabelsBuilder_ == null) { + return accountLabels_.size(); + } else { + return accountLabelsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public com.google.shopping.css.v1.AccountLabel getAccountLabels(int index) { + if (accountLabelsBuilder_ == null) { + return accountLabels_.get(index); + } else { + return accountLabelsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder setAccountLabels(int index, com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountLabelsIsMutable(); + accountLabels_.set(index, value); + onChanged(); + } else { + accountLabelsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder setAccountLabels( + int index, com.google.shopping.css.v1.AccountLabel.Builder builderForValue) { + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + accountLabels_.set(index, builderForValue.build()); + onChanged(); + } else { + accountLabelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder addAccountLabels(com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountLabelsIsMutable(); + accountLabels_.add(value); + onChanged(); + } else { + accountLabelsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder addAccountLabels(int index, com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountLabelsIsMutable(); + accountLabels_.add(index, value); + onChanged(); + } else { + accountLabelsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder addAccountLabels( + com.google.shopping.css.v1.AccountLabel.Builder builderForValue) { + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + accountLabels_.add(builderForValue.build()); + onChanged(); + } else { + accountLabelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder addAccountLabels( + int index, com.google.shopping.css.v1.AccountLabel.Builder builderForValue) { + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + accountLabels_.add(index, builderForValue.build()); + onChanged(); + } else { + accountLabelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder addAllAccountLabels( + java.lang.Iterable values) { + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accountLabels_); + onChanged(); + } else { + accountLabelsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder clearAccountLabels() { + if (accountLabelsBuilder_ == null) { + accountLabels_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + accountLabelsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public Builder removeAccountLabels(int index) { + if (accountLabelsBuilder_ == null) { + ensureAccountLabelsIsMutable(); + accountLabels_.remove(index); + onChanged(); + } else { + accountLabelsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public com.google.shopping.css.v1.AccountLabel.Builder getAccountLabelsBuilder(int index) { + return getAccountLabelsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelsOrBuilder(int index) { + if (accountLabelsBuilder_ == null) { + return accountLabels_.get(index); + } else { + return accountLabelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public java.util.List + getAccountLabelsOrBuilderList() { + if (accountLabelsBuilder_ != null) { + return accountLabelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accountLabels_); + } + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public com.google.shopping.css.v1.AccountLabel.Builder addAccountLabelsBuilder() { + return getAccountLabelsFieldBuilder() + .addBuilder(com.google.shopping.css.v1.AccountLabel.getDefaultInstance()); + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public com.google.shopping.css.v1.AccountLabel.Builder addAccountLabelsBuilder(int index) { + return getAccountLabelsFieldBuilder() + .addBuilder(index, com.google.shopping.css.v1.AccountLabel.getDefaultInstance()); + } + /** + * + * + *
+     * The labels from the specified account.
+     * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + public java.util.List + getAccountLabelsBuilderList() { + return getAccountLabelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + getAccountLabelsFieldBuilder() { + if (accountLabelsBuilder_ == null) { + accountLabelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder>( + accountLabels_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + accountLabels_ = null; + } + return accountLabelsBuilder_; + } + + 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.css.v1.ListAccountLabelsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListAccountLabelsResponse) + private static final com.google.shopping.css.v1.ListAccountLabelsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListAccountLabelsResponse(); + } + + public static com.google.shopping.css.v1.ListAccountLabelsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccountLabelsResponse 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.css.v1.ListAccountLabelsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponseOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponseOrBuilder.java new file mode 100644 index 000000000000..d5166a35b532 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListAccountLabelsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface ListAccountLabelsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListAccountLabelsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + java.util.List getAccountLabelsList(); + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + com.google.shopping.css.v1.AccountLabel getAccountLabels(int index); + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + int getAccountLabelsCount(); + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + java.util.List + getAccountLabelsOrBuilderList(); + /** + * + * + *
+   * The labels from the specified account.
+   * 
+ * + * repeated .google.shopping.css.v1.AccountLabel account_labels = 1; + */ + com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelsOrBuilder(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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequest.java new file mode 100644 index 000000000000..1e24fa60b286 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequest.java @@ -0,0 +1,1318 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The request message for the `ListChildAccounts` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListChildAccountsRequest} + */ +public final class ListChildAccountsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListChildAccountsRequest) + ListChildAccountsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListChildAccountsRequest.newBuilder() to construct. + private ListChildAccountsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListChildAccountsRequest() { + parent_ = ""; + fullName_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListChildAccountsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListChildAccountsRequest.class, + com.google.shopping.css.v1.ListChildAccountsRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent account. Must be a CSS group or domain.
+   * 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 parent account. Must be a CSS group or domain.
+   * 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 LABEL_ID_FIELD_NUMBER = 2; + private long labelId_ = 0L; + /** + * + * + *
+   * If set, only the MC accounts with the given label ID will be returned.
+   * 
+ * + * optional int64 label_id = 2; + * + * @return Whether the labelId field is set. + */ + @java.lang.Override + public boolean hasLabelId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * If set, only the MC accounts with the given label ID will be returned.
+   * 
+ * + * optional int64 label_id = 2; + * + * @return The labelId. + */ + @java.lang.Override + public long getLabelId() { + return labelId_; + } + + public static final int FULL_NAME_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object fullName_ = ""; + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return Whether the fullName field is set. + */ + @java.lang.Override + public boolean hasFullName() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return The fullName. + */ + @java.lang.Override + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + 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(); + fullName_ = s; + return s; + } + } + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return The bytes for fullName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of accounts to return. The service may return
+   * fewer than this value. If unspecified, at most 50 accounts will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListChildAccounts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListChildAccounts` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 5 [(.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 `ListChildAccounts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListChildAccounts` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 5 [(.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(2, labelId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, fullName_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, labelId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, fullName_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, 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.css.v1.ListChildAccountsRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListChildAccountsRequest other = + (com.google.shopping.css.v1.ListChildAccountsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasLabelId() != other.hasLabelId()) return false; + if (hasLabelId()) { + if (getLabelId() != other.getLabelId()) return false; + } + if (hasFullName() != other.hasFullName()) return false; + if (hasFullName()) { + if (!getFullName().equals(other.getFullName())) 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(); + if (hasLabelId()) { + hash = (37 * hash) + LABEL_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLabelId()); + } + if (hasFullName()) { + hash = (37 * hash) + FULL_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFullName().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.css.v1.ListChildAccountsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest 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 request message for the `ListChildAccounts` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListChildAccountsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListChildAccountsRequest) + com.google.shopping.css.v1.ListChildAccountsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListChildAccountsRequest.class, + com.google.shopping.css.v1.ListChildAccountsRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListChildAccountsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + labelId_ = 0L; + fullName_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListChildAccountsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsRequest build() { + com.google.shopping.css.v1.ListChildAccountsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsRequest buildPartial() { + com.google.shopping.css.v1.ListChildAccountsRequest result = + new com.google.shopping.css.v1.ListChildAccountsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ListChildAccountsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.labelId_ = labelId_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.fullName_ = fullName_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + 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.css.v1.ListChildAccountsRequest) { + return mergeFrom((com.google.shopping.css.v1.ListChildAccountsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListChildAccountsRequest other) { + if (other == com.google.shopping.css.v1.ListChildAccountsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasLabelId()) { + setLabelId(other.getLabelId()); + } + if (other.hasFullName()) { + fullName_ = other.fullName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; + 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: + { + labelId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + fullName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + 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 parent_ = ""; + /** + * + * + *
+     * Required. The parent account. Must be a CSS group or domain.
+     * 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 parent account. Must be a CSS group or domain.
+     * 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 parent account. Must be a CSS group or domain.
+     * 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 parent account. Must be a CSS group or domain.
+     * 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 parent account. Must be a CSS group or domain.
+     * 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 long labelId_; + /** + * + * + *
+     * If set, only the MC accounts with the given label ID will be returned.
+     * 
+ * + * optional int64 label_id = 2; + * + * @return Whether the labelId field is set. + */ + @java.lang.Override + public boolean hasLabelId() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * If set, only the MC accounts with the given label ID will be returned.
+     * 
+ * + * optional int64 label_id = 2; + * + * @return The labelId. + */ + @java.lang.Override + public long getLabelId() { + return labelId_; + } + /** + * + * + *
+     * If set, only the MC accounts with the given label ID will be returned.
+     * 
+ * + * optional int64 label_id = 2; + * + * @param value The labelId to set. + * @return This builder for chaining. + */ + public Builder setLabelId(long value) { + + labelId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, only the MC accounts with the given label ID will be returned.
+     * 
+ * + * optional int64 label_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearLabelId() { + bitField0_ = (bitField0_ & ~0x00000002); + labelId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object fullName_ = ""; + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @return Whether the fullName field is set. + */ + public boolean hasFullName() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @return The fullName. + */ + public java.lang.String getFullName() { + java.lang.Object ref = fullName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fullName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @return The bytes for fullName. + */ + public com.google.protobuf.ByteString getFullNameBytes() { + java.lang.Object ref = fullName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fullName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @param value The fullName to set. + * @return This builder for chaining. + */ + public Builder setFullName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fullName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearFullName() { + fullName_ = getDefaultInstance().getFullName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * If set, only the MC accounts with the given name (case sensitive) will be
+     * returned.
+     * 
+ * + * optional string full_name = 3; + * + * @param value The bytes for fullName to set. + * @return This builder for chaining. + */ + public Builder setFullNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fullName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of accounts to return. The service may return
+     * fewer than this value. If unspecified, at most 50 accounts will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of accounts to return. The service may return
+     * fewer than this value. If unspecified, at most 50 accounts will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of accounts to return. The service may return
+     * fewer than this value. If unspecified, at most 50 accounts will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000008); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListChildAccounts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListChildAccounts` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 5 [(.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 `ListChildAccounts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListChildAccounts` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 5 [(.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 `ListChildAccounts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListChildAccounts` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 5 [(.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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListChildAccounts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListChildAccounts` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListChildAccounts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListChildAccounts` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 5 [(.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_ |= 0x00000010; + 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.css.v1.ListChildAccountsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListChildAccountsRequest) + private static final com.google.shopping.css.v1.ListChildAccountsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListChildAccountsRequest(); + } + + public static com.google.shopping.css.v1.ListChildAccountsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListChildAccountsRequest 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.css.v1.ListChildAccountsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequestOrBuilder.java new file mode 100644 index 000000000000..4f19f986dcf0 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsRequestOrBuilder.java @@ -0,0 +1,170 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public interface ListChildAccountsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListChildAccountsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent account. Must be a CSS group or domain.
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent account. Must be a CSS group or domain.
+   * 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(); + + /** + * + * + *
+   * If set, only the MC accounts with the given label ID will be returned.
+   * 
+ * + * optional int64 label_id = 2; + * + * @return Whether the labelId field is set. + */ + boolean hasLabelId(); + /** + * + * + *
+   * If set, only the MC accounts with the given label ID will be returned.
+   * 
+ * + * optional int64 label_id = 2; + * + * @return The labelId. + */ + long getLabelId(); + + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return Whether the fullName field is set. + */ + boolean hasFullName(); + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return The fullName. + */ + java.lang.String getFullName(); + /** + * + * + *
+   * If set, only the MC accounts with the given name (case sensitive) will be
+   * returned.
+   * 
+ * + * optional string full_name = 3; + * + * @return The bytes for fullName. + */ + com.google.protobuf.ByteString getFullNameBytes(); + + /** + * + * + *
+   * Optional. The maximum number of accounts to return. The service may return
+   * fewer than this value. If unspecified, at most 50 accounts will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListChildAccounts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListChildAccounts` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListChildAccounts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListChildAccounts` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponse.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponse.java new file mode 100644 index 000000000000..669dd0d63c00 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponse.java @@ -0,0 +1,1123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Response message for the `ListChildAccounts` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListChildAccountsResponse} + */ +public final class ListChildAccountsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListChildAccountsResponse) + ListChildAccountsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListChildAccountsResponse.newBuilder() to construct. + private ListChildAccountsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListChildAccountsResponse() { + accounts_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListChildAccountsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListChildAccountsResponse.class, + com.google.shopping.css.v1.ListChildAccountsResponse.Builder.class); + } + + public static final int ACCOUNTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List accounts_; + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + @java.lang.Override + public java.util.List getAccountsList() { + return accounts_; + } + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + @java.lang.Override + public java.util.List + getAccountsOrBuilderList() { + return accounts_; + } + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + @java.lang.Override + public int getAccountsCount() { + return accounts_.size(); + } + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.Account getAccounts(int index) { + return accounts_.get(index); + } + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountOrBuilder getAccountsOrBuilder(int index) { + return accounts_.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 < accounts_.size(); i++) { + output.writeMessage(1, accounts_.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 < accounts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, accounts_.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.css.v1.ListChildAccountsResponse)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListChildAccountsResponse other = + (com.google.shopping.css.v1.ListChildAccountsResponse) obj; + + if (!getAccountsList().equals(other.getAccountsList())) 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 (getAccountsCount() > 0) { + hash = (37 * hash) + ACCOUNTS_FIELD_NUMBER; + hash = (53 * hash) + getAccountsList().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.css.v1.ListChildAccountsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse 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 `ListChildAccounts` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListChildAccountsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListChildAccountsResponse) + com.google.shopping.css.v1.ListChildAccountsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListChildAccountsResponse.class, + com.google.shopping.css.v1.ListChildAccountsResponse.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListChildAccountsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (accountsBuilder_ == null) { + accounts_ = java.util.Collections.emptyList(); + } else { + accounts_ = null; + accountsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_ListChildAccountsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsResponse getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListChildAccountsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsResponse build() { + com.google.shopping.css.v1.ListChildAccountsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListChildAccountsResponse buildPartial() { + com.google.shopping.css.v1.ListChildAccountsResponse result = + new com.google.shopping.css.v1.ListChildAccountsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.css.v1.ListChildAccountsResponse result) { + if (accountsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + accounts_ = java.util.Collections.unmodifiableList(accounts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.accounts_ = accounts_; + } else { + result.accounts_ = accountsBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse) { + return mergeFrom((com.google.shopping.css.v1.ListChildAccountsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListChildAccountsResponse other) { + if (other == com.google.shopping.css.v1.ListChildAccountsResponse.getDefaultInstance()) + return this; + if (accountsBuilder_ == null) { + if (!other.accounts_.isEmpty()) { + if (accounts_.isEmpty()) { + accounts_ = other.accounts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAccountsIsMutable(); + accounts_.addAll(other.accounts_); + } + onChanged(); + } + } else { + if (!other.accounts_.isEmpty()) { + if (accountsBuilder_.isEmpty()) { + accountsBuilder_.dispose(); + accountsBuilder_ = null; + accounts_ = other.accounts_; + bitField0_ = (bitField0_ & ~0x00000001); + accountsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAccountsFieldBuilder() + : null; + } else { + accountsBuilder_.addAllMessages(other.accounts_); + } + } + } + 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.css.v1.Account m = + input.readMessage( + com.google.shopping.css.v1.Account.parser(), extensionRegistry); + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + accounts_.add(m); + } else { + accountsBuilder_.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 accounts_ = + java.util.Collections.emptyList(); + + private void ensureAccountsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + accounts_ = new java.util.ArrayList(accounts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Account, + com.google.shopping.css.v1.Account.Builder, + com.google.shopping.css.v1.AccountOrBuilder> + accountsBuilder_; + + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public java.util.List getAccountsList() { + if (accountsBuilder_ == null) { + return java.util.Collections.unmodifiableList(accounts_); + } else { + return accountsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public int getAccountsCount() { + if (accountsBuilder_ == null) { + return accounts_.size(); + } else { + return accountsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public com.google.shopping.css.v1.Account getAccounts(int index) { + if (accountsBuilder_ == null) { + return accounts_.get(index); + } else { + return accountsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder setAccounts(int index, com.google.shopping.css.v1.Account value) { + if (accountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountsIsMutable(); + accounts_.set(index, value); + onChanged(); + } else { + accountsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder setAccounts( + int index, com.google.shopping.css.v1.Account.Builder builderForValue) { + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + accounts_.set(index, builderForValue.build()); + onChanged(); + } else { + accountsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder addAccounts(com.google.shopping.css.v1.Account value) { + if (accountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountsIsMutable(); + accounts_.add(value); + onChanged(); + } else { + accountsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder addAccounts(int index, com.google.shopping.css.v1.Account value) { + if (accountsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccountsIsMutable(); + accounts_.add(index, value); + onChanged(); + } else { + accountsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder addAccounts(com.google.shopping.css.v1.Account.Builder builderForValue) { + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + accounts_.add(builderForValue.build()); + onChanged(); + } else { + accountsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder addAccounts( + int index, com.google.shopping.css.v1.Account.Builder builderForValue) { + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + accounts_.add(index, builderForValue.build()); + onChanged(); + } else { + accountsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder addAllAccounts( + java.lang.Iterable values) { + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accounts_); + onChanged(); + } else { + accountsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder clearAccounts() { + if (accountsBuilder_ == null) { + accounts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + accountsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public Builder removeAccounts(int index) { + if (accountsBuilder_ == null) { + ensureAccountsIsMutable(); + accounts_.remove(index); + onChanged(); + } else { + accountsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public com.google.shopping.css.v1.Account.Builder getAccountsBuilder(int index) { + return getAccountsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public com.google.shopping.css.v1.AccountOrBuilder getAccountsOrBuilder(int index) { + if (accountsBuilder_ == null) { + return accounts_.get(index); + } else { + return accountsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public java.util.List + getAccountsOrBuilderList() { + if (accountsBuilder_ != null) { + return accountsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accounts_); + } + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public com.google.shopping.css.v1.Account.Builder addAccountsBuilder() { + return getAccountsFieldBuilder() + .addBuilder(com.google.shopping.css.v1.Account.getDefaultInstance()); + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public com.google.shopping.css.v1.Account.Builder addAccountsBuilder(int index) { + return getAccountsFieldBuilder() + .addBuilder(index, com.google.shopping.css.v1.Account.getDefaultInstance()); + } + /** + * + * + *
+     * The CSS/MC accounts returned for the specified CSS parent account.
+     * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + public java.util.List getAccountsBuilderList() { + return getAccountsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Account, + com.google.shopping.css.v1.Account.Builder, + com.google.shopping.css.v1.AccountOrBuilder> + getAccountsFieldBuilder() { + if (accountsBuilder_ == null) { + accountsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.Account, + com.google.shopping.css.v1.Account.Builder, + com.google.shopping.css.v1.AccountOrBuilder>( + accounts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + accounts_ = null; + } + return accountsBuilder_; + } + + 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.css.v1.ListChildAccountsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListChildAccountsResponse) + private static final com.google.shopping.css.v1.ListChildAccountsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListChildAccountsResponse(); + } + + public static com.google.shopping.css.v1.ListChildAccountsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListChildAccountsResponse 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.css.v1.ListChildAccountsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponseOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponseOrBuilder.java new file mode 100644 index 000000000000..5f3d9f78b20a --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListChildAccountsResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public interface ListChildAccountsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListChildAccountsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + java.util.List getAccountsList(); + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + com.google.shopping.css.v1.Account getAccounts(int index); + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + int getAccountsCount(); + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + java.util.List getAccountsOrBuilderList(); + /** + * + * + *
+   * The CSS/MC accounts returned for the specified CSS parent account.
+   * 
+ * + * repeated .google.shopping.css.v1.Account accounts = 1; + */ + com.google.shopping.css.v1.AccountOrBuilder getAccountsOrBuilder(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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequest.java new file mode 100644 index 000000000000..c5aaa3ebb1da --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the ListCssProducts method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListCssProductsRequest} + */ +public final class ListCssProductsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListCssProductsRequest) + ListCssProductsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCssProductsRequest.newBuilder() to construct. + private ListCssProductsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCssProductsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCssProductsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListCssProductsRequest.class, + com.google.shopping.css.v1.ListCssProductsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The account/domain to list processed CSS Products 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/domain to list processed CSS Products 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; + /** + * + * + *
+   * The maximum number of CSS Products 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 CSS products will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @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_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListCssProducts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListCssProducts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListCssProducts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListCssProducts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @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.css.v1.ListCssProductsRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListCssProductsRequest other = + (com.google.shopping.css.v1.ListCssProductsRequest) 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.css.v1.ListCssProductsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest 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 ListCssProducts method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListCssProductsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListCssProductsRequest) + com.google.shopping.css.v1.ListCssProductsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListCssProductsRequest.class, + com.google.shopping.css.v1.ListCssProductsRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListCssProductsRequest.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.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListCssProductsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsRequest build() { + com.google.shopping.css.v1.ListCssProductsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsRequest buildPartial() { + com.google.shopping.css.v1.ListCssProductsRequest result = + new com.google.shopping.css.v1.ListCssProductsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ListCssProductsRequest 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.css.v1.ListCssProductsRequest) { + return mergeFrom((com.google.shopping.css.v1.ListCssProductsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListCssProductsRequest other) { + if (other == com.google.shopping.css.v1.ListCssProductsRequest.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/domain to list processed CSS Products 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/domain to list processed CSS Products 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/domain to list processed CSS Products 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/domain to list processed CSS Products 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/domain to list processed CSS Products 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_; + /** + * + * + *
+     * The maximum number of CSS Products 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 CSS products will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of CSS Products 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 CSS products will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of CSS Products 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 CSS products will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListCssProducts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListCssProducts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCssProducts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListCssProducts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCssProducts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListCssProducts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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; + } + /** + * + * + *
+     * A page token, received from a previous `ListCssProducts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListCssProducts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCssProducts` call.
+     * Provide this to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListCssProducts`
+     * must match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @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.css.v1.ListCssProductsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListCssProductsRequest) + private static final com.google.shopping.css.v1.ListCssProductsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListCssProductsRequest(); + } + + public static com.google.shopping.css.v1.ListCssProductsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCssProductsRequest 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.css.v1.ListCssProductsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequestOrBuilder.java new file mode 100644 index 000000000000..013ea22f4fe6 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +public interface ListCssProductsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListCssProductsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account/domain to list processed CSS Products 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/domain to list processed CSS Products 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(); + + /** + * + * + *
+   * The maximum number of CSS Products 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 CSS products will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListCssProducts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListCssProducts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListCssProducts` call.
+   * Provide this to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListCssProducts`
+   * must match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponse.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponse.java new file mode 100644 index 000000000000..ec73058ffb93 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponse.java @@ -0,0 +1,1147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Response message for the ListCssProducts method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListCssProductsResponse} + */ +public final class ListCssProductsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ListCssProductsResponse) + ListCssProductsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCssProductsResponse.newBuilder() to construct. + private ListCssProductsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCssProductsResponse() { + cssProducts_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCssProductsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListCssProductsResponse.class, + com.google.shopping.css.v1.ListCssProductsResponse.Builder.class); + } + + public static final int CSS_PRODUCTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List cssProducts_; + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + @java.lang.Override + public java.util.List getCssProductsList() { + return cssProducts_; + } + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + @java.lang.Override + public java.util.List + getCssProductsOrBuilderList() { + return cssProducts_; + } + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + @java.lang.Override + public int getCssProductsCount() { + return cssProducts_.size(); + } + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProduct getCssProducts(int index) { + return cssProducts_.get(index); + } + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + @java.lang.Override + public com.google.shopping.css.v1.CssProductOrBuilder getCssProductsOrBuilder(int index) { + return cssProducts_.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 < cssProducts_.size(); i++) { + output.writeMessage(1, cssProducts_.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 < cssProducts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, cssProducts_.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.css.v1.ListCssProductsResponse)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ListCssProductsResponse other = + (com.google.shopping.css.v1.ListCssProductsResponse) obj; + + if (!getCssProductsList().equals(other.getCssProductsList())) 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 (getCssProductsCount() > 0) { + hash = (37 * hash) + CSS_PRODUCTS_FIELD_NUMBER; + hash = (53 * hash) + getCssProductsList().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.css.v1.ListCssProductsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse 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 ListCssProducts method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ListCssProductsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ListCssProductsResponse) + com.google.shopping.css.v1.ListCssProductsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ListCssProductsResponse.class, + com.google.shopping.css.v1.ListCssProductsResponse.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ListCssProductsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (cssProductsBuilder_ == null) { + cssProducts_ = java.util.Collections.emptyList(); + } else { + cssProducts_ = null; + cssProductsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductsProto + .internal_static_google_shopping_css_v1_ListCssProductsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsResponse getDefaultInstanceForType() { + return com.google.shopping.css.v1.ListCssProductsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsResponse build() { + com.google.shopping.css.v1.ListCssProductsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ListCssProductsResponse buildPartial() { + com.google.shopping.css.v1.ListCssProductsResponse result = + new com.google.shopping.css.v1.ListCssProductsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.css.v1.ListCssProductsResponse result) { + if (cssProductsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + cssProducts_ = java.util.Collections.unmodifiableList(cssProducts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.cssProducts_ = cssProducts_; + } else { + result.cssProducts_ = cssProductsBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.css.v1.ListCssProductsResponse 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.css.v1.ListCssProductsResponse) { + return mergeFrom((com.google.shopping.css.v1.ListCssProductsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ListCssProductsResponse other) { + if (other == com.google.shopping.css.v1.ListCssProductsResponse.getDefaultInstance()) + return this; + if (cssProductsBuilder_ == null) { + if (!other.cssProducts_.isEmpty()) { + if (cssProducts_.isEmpty()) { + cssProducts_ = other.cssProducts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCssProductsIsMutable(); + cssProducts_.addAll(other.cssProducts_); + } + onChanged(); + } + } else { + if (!other.cssProducts_.isEmpty()) { + if (cssProductsBuilder_.isEmpty()) { + cssProductsBuilder_.dispose(); + cssProductsBuilder_ = null; + cssProducts_ = other.cssProducts_; + bitField0_ = (bitField0_ & ~0x00000001); + cssProductsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCssProductsFieldBuilder() + : null; + } else { + cssProductsBuilder_.addAllMessages(other.cssProducts_); + } + } + } + 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.css.v1.CssProduct m = + input.readMessage( + com.google.shopping.css.v1.CssProduct.parser(), extensionRegistry); + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + cssProducts_.add(m); + } else { + cssProductsBuilder_.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 cssProducts_ = + java.util.Collections.emptyList(); + + private void ensureCssProductsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + cssProducts_ = new java.util.ArrayList(cssProducts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProduct, + com.google.shopping.css.v1.CssProduct.Builder, + com.google.shopping.css.v1.CssProductOrBuilder> + cssProductsBuilder_; + + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public java.util.List getCssProductsList() { + if (cssProductsBuilder_ == null) { + return java.util.Collections.unmodifiableList(cssProducts_); + } else { + return cssProductsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public int getCssProductsCount() { + if (cssProductsBuilder_ == null) { + return cssProducts_.size(); + } else { + return cssProductsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public com.google.shopping.css.v1.CssProduct getCssProducts(int index) { + if (cssProductsBuilder_ == null) { + return cssProducts_.get(index); + } else { + return cssProductsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder setCssProducts(int index, com.google.shopping.css.v1.CssProduct value) { + if (cssProductsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCssProductsIsMutable(); + cssProducts_.set(index, value); + onChanged(); + } else { + cssProductsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder setCssProducts( + int index, com.google.shopping.css.v1.CssProduct.Builder builderForValue) { + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + cssProducts_.set(index, builderForValue.build()); + onChanged(); + } else { + cssProductsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder addCssProducts(com.google.shopping.css.v1.CssProduct value) { + if (cssProductsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCssProductsIsMutable(); + cssProducts_.add(value); + onChanged(); + } else { + cssProductsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder addCssProducts(int index, com.google.shopping.css.v1.CssProduct value) { + if (cssProductsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCssProductsIsMutable(); + cssProducts_.add(index, value); + onChanged(); + } else { + cssProductsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder addCssProducts(com.google.shopping.css.v1.CssProduct.Builder builderForValue) { + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + cssProducts_.add(builderForValue.build()); + onChanged(); + } else { + cssProductsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder addCssProducts( + int index, com.google.shopping.css.v1.CssProduct.Builder builderForValue) { + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + cssProducts_.add(index, builderForValue.build()); + onChanged(); + } else { + cssProductsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder addAllCssProducts( + java.lang.Iterable values) { + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, cssProducts_); + onChanged(); + } else { + cssProductsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder clearCssProducts() { + if (cssProductsBuilder_ == null) { + cssProducts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + cssProductsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public Builder removeCssProducts(int index) { + if (cssProductsBuilder_ == null) { + ensureCssProductsIsMutable(); + cssProducts_.remove(index); + onChanged(); + } else { + cssProductsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public com.google.shopping.css.v1.CssProduct.Builder getCssProductsBuilder(int index) { + return getCssProductsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public com.google.shopping.css.v1.CssProductOrBuilder getCssProductsOrBuilder(int index) { + if (cssProductsBuilder_ == null) { + return cssProducts_.get(index); + } else { + return cssProductsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public java.util.List + getCssProductsOrBuilderList() { + if (cssProductsBuilder_ != null) { + return cssProductsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cssProducts_); + } + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public com.google.shopping.css.v1.CssProduct.Builder addCssProductsBuilder() { + return getCssProductsFieldBuilder() + .addBuilder(com.google.shopping.css.v1.CssProduct.getDefaultInstance()); + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public com.google.shopping.css.v1.CssProduct.Builder addCssProductsBuilder(int index) { + return getCssProductsFieldBuilder() + .addBuilder(index, com.google.shopping.css.v1.CssProduct.getDefaultInstance()); + } + /** + * + * + *
+     * The processed CSS products from the specified account. These are your
+     * processed CSS products after applying rules and supplemental feeds.
+     * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + public java.util.List + getCssProductsBuilderList() { + return getCssProductsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProduct, + com.google.shopping.css.v1.CssProduct.Builder, + com.google.shopping.css.v1.CssProductOrBuilder> + getCssProductsFieldBuilder() { + if (cssProductsBuilder_ == null) { + cssProductsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.css.v1.CssProduct, + com.google.shopping.css.v1.CssProduct.Builder, + com.google.shopping.css.v1.CssProductOrBuilder>( + cssProducts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + cssProducts_ = null; + } + return cssProductsBuilder_; + } + + 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.css.v1.ListCssProductsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ListCssProductsResponse) + private static final com.google.shopping.css.v1.ListCssProductsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ListCssProductsResponse(); + } + + public static com.google.shopping.css.v1.ListCssProductsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCssProductsResponse 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.css.v1.ListCssProductsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponseOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponseOrBuilder.java new file mode 100644 index 000000000000..f0ef5cb67e50 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ListCssProductsResponseOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_products.proto + +package com.google.shopping.css.v1; + +public interface ListCssProductsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ListCssProductsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + java.util.List getCssProductsList(); + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + com.google.shopping.css.v1.CssProduct getCssProducts(int index); + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + int getCssProductsCount(); + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + java.util.List + getCssProductsOrBuilderList(); + /** + * + * + *
+   * The processed CSS products from the specified account. These are your
+   * processed CSS products after applying rules and supplemental feeds.
+   * 
+ * + * repeated .google.shopping.css.v1.CssProduct css_products = 1; + */ + com.google.shopping.css.v1.CssProductOrBuilder getCssProductsOrBuilder(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-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetail.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetail.java new file mode 100644 index 000000000000..90ffaf6f79c9 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetail.java @@ -0,0 +1,986 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The product details.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductDetail} + */ +public final class ProductDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ProductDetail) + ProductDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductDetail.newBuilder() to construct. + private ProductDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductDetail() { + sectionName_ = ""; + attributeName_ = ""; + attributeValue_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductDetail.class, + com.google.shopping.css.v1.ProductDetail.Builder.class); + } + + public static final int SECTION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sectionName_ = ""; + /** + * + * + *
+   * The section header used to group a set of product details.
+   * 
+ * + * string section_name = 1; + * + * @return The sectionName. + */ + @java.lang.Override + public java.lang.String getSectionName() { + java.lang.Object ref = sectionName_; + 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(); + sectionName_ = s; + return s; + } + } + /** + * + * + *
+   * The section header used to group a set of product details.
+   * 
+ * + * string section_name = 1; + * + * @return The bytes for sectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSectionNameBytes() { + java.lang.Object ref = sectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributeName_ = ""; + /** + * + * + *
+   * The name of the product detail.
+   * 
+ * + * string attribute_name = 2; + * + * @return The attributeName. + */ + @java.lang.Override + public java.lang.String getAttributeName() { + java.lang.Object ref = attributeName_; + 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(); + attributeName_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the product detail.
+   * 
+ * + * string attribute_name = 2; + * + * @return The bytes for attributeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeNameBytes() { + java.lang.Object ref = attributeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_VALUE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object attributeValue_ = ""; + /** + * + * + *
+   * The value of the product detail.
+   * 
+ * + * string attribute_value = 3; + * + * @return The attributeValue. + */ + @java.lang.Override + public java.lang.String getAttributeValue() { + java.lang.Object ref = attributeValue_; + 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(); + attributeValue_ = s; + return s; + } + } + /** + * + * + *
+   * The value of the product detail.
+   * 
+ * + * string attribute_value = 3; + * + * @return The bytes for attributeValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeValueBytes() { + java.lang.Object ref = attributeValue_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeValue_ = 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(sectionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sectionName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributeName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeValue_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, attributeValue_); + } + 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(sectionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sectionName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, attributeName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributeValue_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, attributeValue_); + } + 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.css.v1.ProductDetail)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ProductDetail other = (com.google.shopping.css.v1.ProductDetail) obj; + + if (!getSectionName().equals(other.getSectionName())) return false; + if (!getAttributeName().equals(other.getAttributeName())) return false; + if (!getAttributeValue().equals(other.getAttributeValue())) 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) + SECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSectionName().hashCode(); + hash = (37 * hash) + ATTRIBUTE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getAttributeName().hashCode(); + hash = (37 * hash) + ATTRIBUTE_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getAttributeValue().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.ProductDetail parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDetail 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.css.v1.ProductDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDetail 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.css.v1.ProductDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ProductDetail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDetail 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.css.v1.ProductDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDetail 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.css.v1.ProductDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDetail 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.css.v1.ProductDetail 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 details.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductDetail} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ProductDetail) + com.google.shopping.css.v1.ProductDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductDetail.class, + com.google.shopping.css.v1.ProductDetail.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ProductDetail.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sectionName_ = ""; + attributeName_ = ""; + attributeValue_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDetail_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDetail getDefaultInstanceForType() { + return com.google.shopping.css.v1.ProductDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDetail build() { + com.google.shopping.css.v1.ProductDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDetail buildPartial() { + com.google.shopping.css.v1.ProductDetail result = + new com.google.shopping.css.v1.ProductDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ProductDetail result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sectionName_ = sectionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.attributeName_ = attributeName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.attributeValue_ = attributeValue_; + } + } + + @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.css.v1.ProductDetail) { + return mergeFrom((com.google.shopping.css.v1.ProductDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ProductDetail other) { + if (other == com.google.shopping.css.v1.ProductDetail.getDefaultInstance()) return this; + if (!other.getSectionName().isEmpty()) { + sectionName_ = other.sectionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAttributeName().isEmpty()) { + attributeName_ = other.attributeName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getAttributeValue().isEmpty()) { + attributeValue_ = other.attributeValue_; + 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: + { + sectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + attributeName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + attributeValue_ = 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 sectionName_ = ""; + /** + * + * + *
+     * The section header used to group a set of product details.
+     * 
+ * + * string section_name = 1; + * + * @return The sectionName. + */ + public java.lang.String getSectionName() { + java.lang.Object ref = sectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The section header used to group a set of product details.
+     * 
+ * + * string section_name = 1; + * + * @return The bytes for sectionName. + */ + public com.google.protobuf.ByteString getSectionNameBytes() { + java.lang.Object ref = sectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The section header used to group a set of product details.
+     * 
+ * + * string section_name = 1; + * + * @param value The sectionName to set. + * @return This builder for chaining. + */ + public Builder setSectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The section header used to group a set of product details.
+     * 
+ * + * string section_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearSectionName() { + sectionName_ = getDefaultInstance().getSectionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The section header used to group a set of product details.
+     * 
+ * + * string section_name = 1; + * + * @param value The bytes for sectionName to set. + * @return This builder for chaining. + */ + public Builder setSectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object attributeName_ = ""; + /** + * + * + *
+     * The name of the product detail.
+     * 
+ * + * string attribute_name = 2; + * + * @return The attributeName. + */ + public java.lang.String getAttributeName() { + java.lang.Object ref = attributeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the product detail.
+     * 
+ * + * string attribute_name = 2; + * + * @return The bytes for attributeName. + */ + public com.google.protobuf.ByteString getAttributeNameBytes() { + java.lang.Object ref = attributeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the product detail.
+     * 
+ * + * string attribute_name = 2; + * + * @param value The attributeName to set. + * @return This builder for chaining. + */ + public Builder setAttributeName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributeName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the product detail.
+     * 
+ * + * string attribute_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearAttributeName() { + attributeName_ = getDefaultInstance().getAttributeName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the product detail.
+     * 
+ * + * string attribute_name = 2; + * + * @param value The bytes for attributeName to set. + * @return This builder for chaining. + */ + public Builder setAttributeNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributeName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object attributeValue_ = ""; + /** + * + * + *
+     * The value of the product detail.
+     * 
+ * + * string attribute_value = 3; + * + * @return The attributeValue. + */ + public java.lang.String getAttributeValue() { + java.lang.Object ref = attributeValue_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributeValue_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value of the product detail.
+     * 
+ * + * string attribute_value = 3; + * + * @return The bytes for attributeValue. + */ + public com.google.protobuf.ByteString getAttributeValueBytes() { + java.lang.Object ref = attributeValue_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributeValue_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value of the product detail.
+     * 
+ * + * string attribute_value = 3; + * + * @param value The attributeValue to set. + * @return This builder for chaining. + */ + public Builder setAttributeValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + attributeValue_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the product detail.
+     * 
+ * + * string attribute_value = 3; + * + * @return This builder for chaining. + */ + public Builder clearAttributeValue() { + attributeValue_ = getDefaultInstance().getAttributeValue(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the product detail.
+     * 
+ * + * string attribute_value = 3; + * + * @param value The bytes for attributeValue to set. + * @return This builder for chaining. + */ + public Builder setAttributeValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + attributeValue_ = 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.css.v1.ProductDetail) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ProductDetail) + private static final com.google.shopping.css.v1.ProductDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ProductDetail(); + } + + public static com.google.shopping.css.v1.ProductDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductDetail 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.css.v1.ProductDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetailOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetailOrBuilder.java new file mode 100644 index 000000000000..924f2035a3c0 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDetailOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface ProductDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ProductDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The section header used to group a set of product details.
+   * 
+ * + * string section_name = 1; + * + * @return The sectionName. + */ + java.lang.String getSectionName(); + /** + * + * + *
+   * The section header used to group a set of product details.
+   * 
+ * + * string section_name = 1; + * + * @return The bytes for sectionName. + */ + com.google.protobuf.ByteString getSectionNameBytes(); + + /** + * + * + *
+   * The name of the product detail.
+   * 
+ * + * string attribute_name = 2; + * + * @return The attributeName. + */ + java.lang.String getAttributeName(); + /** + * + * + *
+   * The name of the product detail.
+   * 
+ * + * string attribute_name = 2; + * + * @return The bytes for attributeName. + */ + com.google.protobuf.ByteString getAttributeNameBytes(); + + /** + * + * + *
+   * The value of the product detail.
+   * 
+ * + * string attribute_value = 3; + * + * @return The attributeValue. + */ + java.lang.String getAttributeValue(); + /** + * + * + *
+   * The value of the product detail.
+   * 
+ * + * string attribute_value = 3; + * + * @return The bytes for attributeValue. + */ + com.google.protobuf.ByteString getAttributeValueBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimension.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimension.java new file mode 100644 index 000000000000..6f6a3ff57dcd --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimension.java @@ -0,0 +1,744 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The dimension of the product.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductDimension} + */ +public final class ProductDimension extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ProductDimension) + ProductDimensionOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductDimension.newBuilder() to construct. + private ProductDimension(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductDimension() { + unit_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductDimension(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDimension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDimension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductDimension.class, + com.google.shopping.css.v1.ProductDimension.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + /** + * + * + *
+   * Required. The dimension value represented as a number. The value can have a
+   * maximum precision of four decimal places.
+   * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int UNIT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** + * + * + *
+   * Required. The dimension units.
+   * Acceptable values are:
+   *   * "`in`"
+   *   * "`cm`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The dimension units.
+   * Acceptable values are:
+   *   * "`in`"
+   *   * "`cm`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = 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 (java.lang.Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, unit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, unit_); + } + 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.css.v1.ProductDimension)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ProductDimension other = + (com.google.shopping.css.v1.ProductDimension) obj; + + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits(other.getValue())) return false; + if (!getUnit().equals(other.getUnit())) 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) + VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getValue())); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.ProductDimension parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDimension 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.css.v1.ProductDimension parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDimension 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.css.v1.ProductDimension parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductDimension parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ProductDimension parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDimension 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.css.v1.ProductDimension parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDimension 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.css.v1.ProductDimension parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductDimension 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.css.v1.ProductDimension 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 dimension of the product.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductDimension} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ProductDimension) + com.google.shopping.css.v1.ProductDimensionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDimension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDimension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductDimension.class, + com.google.shopping.css.v1.ProductDimension.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ProductDimension.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + unit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductDimension_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension getDefaultInstanceForType() { + return com.google.shopping.css.v1.ProductDimension.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension build() { + com.google.shopping.css.v1.ProductDimension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductDimension buildPartial() { + com.google.shopping.css.v1.ProductDimension result = + new com.google.shopping.css.v1.ProductDimension(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ProductDimension result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unit_ = unit_; + } + } + + @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.css.v1.ProductDimension) { + return mergeFrom((com.google.shopping.css.v1.ProductDimension) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ProductDimension other) { + if (other == com.google.shopping.css.v1.ProductDimension.getDefaultInstance()) return this; + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + 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 9: + { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 18: + { + unit_ = 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 double value_; + /** + * + * + *
+     * Required. The dimension value represented as a number. The value can have a
+     * maximum precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * + * + *
+     * Required. The dimension value represented as a number. The value can have a
+     * maximum precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dimension value represented as a number. The value can have a
+     * maximum precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object unit_ = ""; + /** + * + * + *
+     * Required. The dimension units.
+     * Acceptable values are:
+     *   * "`in`"
+     *   * "`cm`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The dimension units.
+     * Acceptable values are:
+     *   * "`in`"
+     *   * "`cm`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The dimension units.
+     * Acceptable values are:
+     *   * "`in`"
+     *   * "`cm`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dimension units.
+     * Acceptable values are:
+     *   * "`in`"
+     *   * "`cm`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The dimension units.
+     * Acceptable values are:
+     *   * "`in`"
+     *   * "`cm`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + unit_ = 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.css.v1.ProductDimension) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ProductDimension) + private static final com.google.shopping.css.v1.ProductDimension DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ProductDimension(); + } + + public static com.google.shopping.css.v1.ProductDimension getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductDimension 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.css.v1.ProductDimension getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimensionOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimensionOrBuilder.java new file mode 100644 index 000000000000..fa458d2b4928 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductDimensionOrBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface ProductDimensionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ProductDimension) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The dimension value represented as a number. The value can have a
+   * maximum precision of four decimal places.
+   * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + double getValue(); + + /** + * + * + *
+   * Required. The dimension units.
+   * Acceptable values are:
+   *   * "`in`"
+   *   * "`cm`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+   * Required. The dimension units.
+   * Acceptable values are:
+   *   * "`in`"
+   *   * "`cm`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeight.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeight.java new file mode 100644 index 000000000000..8cb6155e1eab --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeight.java @@ -0,0 +1,757 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The weight of the product.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductWeight} + */ +public final class ProductWeight extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.ProductWeight) + ProductWeightOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProductWeight.newBuilder() to construct. + private ProductWeight(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProductWeight() { + unit_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProductWeight(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductWeight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductWeight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductWeight.class, + com.google.shopping.css.v1.ProductWeight.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private double value_ = 0D; + /** + * + * + *
+   * Required. The weight represented as a number. The weight can have a maximum
+   * precision of four decimal places.
+   * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + + public static final int UNIT_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object unit_ = ""; + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are:
+   *   * "`g`"
+   *   * "`kg`"
+   *   * "`oz`"
+   *   * "`lb`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + @java.lang.Override + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + 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(); + unit_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are:
+   *   * "`g`"
+   *   * "`kg`"
+   *   * "`oz`"
+   *   * "`lb`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = 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 (java.lang.Double.doubleToRawLongBits(value_) != 0) { + output.writeDouble(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, unit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(value_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, unit_); + } + 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.css.v1.ProductWeight)) { + return super.equals(obj); + } + com.google.shopping.css.v1.ProductWeight other = (com.google.shopping.css.v1.ProductWeight) obj; + + if (java.lang.Double.doubleToLongBits(getValue()) + != java.lang.Double.doubleToLongBits(other.getValue())) return false; + if (!getUnit().equals(other.getUnit())) 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) + VALUE_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getValue())); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.ProductWeight parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductWeight 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.css.v1.ProductWeight parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductWeight 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.css.v1.ProductWeight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.ProductWeight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.ProductWeight parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductWeight 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.css.v1.ProductWeight parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductWeight 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.css.v1.ProductWeight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.ProductWeight 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.css.v1.ProductWeight 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 weight of the product.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.ProductWeight} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.ProductWeight) + com.google.shopping.css.v1.ProductWeightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductWeight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductWeight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.ProductWeight.class, + com.google.shopping.css.v1.ProductWeight.Builder.class); + } + + // Construct using com.google.shopping.css.v1.ProductWeight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0D; + unit_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.CssProductCommonProto + .internal_static_google_shopping_css_v1_ProductWeight_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductWeight getDefaultInstanceForType() { + return com.google.shopping.css.v1.ProductWeight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductWeight build() { + com.google.shopping.css.v1.ProductWeight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.ProductWeight buildPartial() { + com.google.shopping.css.v1.ProductWeight result = + new com.google.shopping.css.v1.ProductWeight(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.ProductWeight result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unit_ = unit_; + } + } + + @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.css.v1.ProductWeight) { + return mergeFrom((com.google.shopping.css.v1.ProductWeight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.ProductWeight other) { + if (other == com.google.shopping.css.v1.ProductWeight.getDefaultInstance()) return this; + if (other.getValue() != 0D) { + setValue(other.getValue()); + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + 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 9: + { + value_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 18: + { + unit_ = 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 double value_; + /** + * + * + *
+     * Required. The weight represented as a number. The weight can have a maximum
+     * precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public double getValue() { + return value_; + } + /** + * + * + *
+     * Required. The weight represented as a number. The weight can have a maximum
+     * precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(double value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight represented as a number. The weight can have a maximum
+     * precision of four decimal places.
+     * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object unit_ = ""; + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are:
+     *   * "`g`"
+     *   * "`kg`"
+     *   * "`oz`"
+     *   * "`lb`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + public java.lang.String getUnit() { + java.lang.Object ref = unit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are:
+     *   * "`g`"
+     *   * "`kg`"
+     *   * "`oz`"
+     *   * "`lb`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString getUnitBytes() { + java.lang.Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are:
+     *   * "`g`"
+     *   * "`kg`"
+     *   * "`oz`"
+     *   * "`lb`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are:
+     *   * "`g`"
+     *   * "`kg`"
+     *   * "`oz`"
+     *   * "`lb`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + unit_ = getDefaultInstance().getUnit(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are:
+     *   * "`g`"
+     *   * "`kg`"
+     *   * "`oz`"
+     *   * "`lb`"
+     * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + unit_ = 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.css.v1.ProductWeight) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.ProductWeight) + private static final com.google.shopping.css.v1.ProductWeight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.ProductWeight(); + } + + public static com.google.shopping.css.v1.ProductWeight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProductWeight 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.css.v1.ProductWeight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeightOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeightOrBuilder.java new file mode 100644 index 000000000000..5bdcdf422be4 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/ProductWeightOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/css_product_common.proto + +package com.google.shopping.css.v1; + +public interface ProductWeightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.ProductWeight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The weight represented as a number. The weight can have a maximum
+   * precision of four decimal places.
+   * 
+ * + * double value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + double getValue(); + + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are:
+   *   * "`g`"
+   *   * "`kg`"
+   *   * "`oz`"
+   *   * "`lb`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The unit. + */ + java.lang.String getUnit(); + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are:
+   *   * "`g`"
+   *   * "`kg`"
+   *   * "`oz`"
+   *   * "`lb`"
+   * 
+ * + * string unit = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for unit. + */ + com.google.protobuf.ByteString getUnitBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequest.java new file mode 100644 index 000000000000..95f69a5625f0 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequest.java @@ -0,0 +1,731 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * Request message for the `UpdateAccountLabel` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.UpdateAccountLabelRequest} + */ +public final class UpdateAccountLabelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.UpdateAccountLabelRequest) + UpdateAccountLabelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAccountLabelRequest.newBuilder() to construct. + private UpdateAccountLabelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAccountLabelRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAccountLabelRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.UpdateAccountLabelRequest.class, + com.google.shopping.css.v1.UpdateAccountLabelRequest.Builder.class); + } + + public static final int ACCOUNT_LABEL_FIELD_NUMBER = 1; + private com.google.shopping.css.v1.AccountLabel accountLabel_; + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + @java.lang.Override + public boolean hasAccountLabel() { + return accountLabel_ != null; + } + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabel getAccountLabel() { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder() { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + + 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 (accountLabel_ != null) { + output.writeMessage(1, getAccountLabel()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (accountLabel_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAccountLabel()); + } + 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.css.v1.UpdateAccountLabelRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.UpdateAccountLabelRequest other = + (com.google.shopping.css.v1.UpdateAccountLabelRequest) obj; + + if (hasAccountLabel() != other.hasAccountLabel()) return false; + if (hasAccountLabel()) { + if (!getAccountLabel().equals(other.getAccountLabel())) 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 (hasAccountLabel()) { + hash = (37 * hash) + ACCOUNT_LABEL_FIELD_NUMBER; + hash = (53 * hash) + getAccountLabel().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest 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 `UpdateAccountLabel` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.UpdateAccountLabelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.UpdateAccountLabelRequest) + com.google.shopping.css.v1.UpdateAccountLabelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.UpdateAccountLabelRequest.class, + com.google.shopping.css.v1.UpdateAccountLabelRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.UpdateAccountLabelRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + accountLabel_ = null; + if (accountLabelBuilder_ != null) { + accountLabelBuilder_.dispose(); + accountLabelBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsLabelsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.UpdateAccountLabelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelRequest build() { + com.google.shopping.css.v1.UpdateAccountLabelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelRequest buildPartial() { + com.google.shopping.css.v1.UpdateAccountLabelRequest result = + new com.google.shopping.css.v1.UpdateAccountLabelRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.css.v1.UpdateAccountLabelRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.accountLabel_ = + accountLabelBuilder_ == null ? accountLabel_ : accountLabelBuilder_.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.css.v1.UpdateAccountLabelRequest) { + return mergeFrom((com.google.shopping.css.v1.UpdateAccountLabelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.UpdateAccountLabelRequest other) { + if (other == com.google.shopping.css.v1.UpdateAccountLabelRequest.getDefaultInstance()) + return this; + if (other.hasAccountLabel()) { + mergeAccountLabel(other.getAccountLabel()); + } + 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(getAccountLabelFieldBuilder().getBuilder(), extensionRegistry); + 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 com.google.shopping.css.v1.AccountLabel accountLabel_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + accountLabelBuilder_; + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + public boolean hasAccountLabel() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + public com.google.shopping.css.v1.AccountLabel getAccountLabel() { + if (accountLabelBuilder_ == null) { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } else { + return accountLabelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAccountLabel(com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accountLabel_ = value; + } else { + accountLabelBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setAccountLabel( + com.google.shopping.css.v1.AccountLabel.Builder builderForValue) { + if (accountLabelBuilder_ == null) { + accountLabel_ = builderForValue.build(); + } else { + accountLabelBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeAccountLabel(com.google.shopping.css.v1.AccountLabel value) { + if (accountLabelBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && accountLabel_ != null + && accountLabel_ != com.google.shopping.css.v1.AccountLabel.getDefaultInstance()) { + getAccountLabelBuilder().mergeFrom(value); + } else { + accountLabel_ = value; + } + } else { + accountLabelBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearAccountLabel() { + bitField0_ = (bitField0_ & ~0x00000001); + accountLabel_ = null; + if (accountLabelBuilder_ != null) { + accountLabelBuilder_.dispose(); + accountLabelBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.AccountLabel.Builder getAccountLabelBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getAccountLabelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder() { + if (accountLabelBuilder_ != null) { + return accountLabelBuilder_.getMessageOrBuilder(); + } else { + return accountLabel_ == null + ? com.google.shopping.css.v1.AccountLabel.getDefaultInstance() + : accountLabel_; + } + } + /** + * + * + *
+     * Required. The updated label. All fields must be provided.
+     * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder> + getAccountLabelFieldBuilder() { + if (accountLabelBuilder_ == null) { + accountLabelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.css.v1.AccountLabel, + com.google.shopping.css.v1.AccountLabel.Builder, + com.google.shopping.css.v1.AccountLabelOrBuilder>( + getAccountLabel(), getParentForChildren(), isClean()); + accountLabel_ = null; + } + return accountLabelBuilder_; + } + + @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.css.v1.UpdateAccountLabelRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.UpdateAccountLabelRequest) + private static final com.google.shopping.css.v1.UpdateAccountLabelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.UpdateAccountLabelRequest(); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAccountLabelRequest 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.css.v1.UpdateAccountLabelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequestOrBuilder.java new file mode 100644 index 000000000000..ebc9410279c4 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts_labels.proto + +package com.google.shopping.css.v1; + +public interface UpdateAccountLabelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.UpdateAccountLabelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the accountLabel field is set. + */ + boolean hasAccountLabel(); + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The accountLabel. + */ + com.google.shopping.css.v1.AccountLabel getAccountLabel(); + /** + * + * + *
+   * Required. The updated label. All fields must be provided.
+   * 
+ * + * + * .google.shopping.css.v1.AccountLabel account_label = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.css.v1.AccountLabelOrBuilder getAccountLabelOrBuilder(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequest.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequest.java new file mode 100644 index 000000000000..305b2bd37f57 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequest.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +/** + * + * + *
+ * The request message for the `UpdateLabels` method.
+ * 
+ * + * Protobuf type {@code google.shopping.css.v1.UpdateAccountLabelsRequest} + */ +public final class UpdateAccountLabelsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.css.v1.UpdateAccountLabelsRequest) + UpdateAccountLabelsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAccountLabelsRequest.newBuilder() to construct. + private UpdateAccountLabelsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAccountLabelsRequest() { + name_ = ""; + labelIds_ = emptyLongList(); + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateAccountLabelsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.UpdateAccountLabelsRequest.class, + com.google.shopping.css.v1.UpdateAccountLabelsRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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 label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * + * 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; + } + } + + public static final int LABEL_IDS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList labelIds_; + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @return A list containing the labelIds. + */ + @java.lang.Override + public java.util.List getLabelIdsList() { + return labelIds_; + } + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @return The count of labelIds. + */ + public int getLabelIdsCount() { + return labelIds_.size(); + } + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + public long getLabelIds(int index) { + return labelIds_.getLong(index); + } + + private int labelIdsMemoizedSerializedSize = -1; + + public static final int PARENT_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + @java.lang.Override + public boolean hasParent() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (getLabelIdsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(labelIdsMemoizedSerializedSize); + } + for (int i = 0; i < labelIds_.size(); i++) { + output.writeInt64NoTag(labelIds_.getLong(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, parent_); + } + 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_); + } + { + int dataSize = 0; + for (int i = 0; i < labelIds_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(labelIds_.getLong(i)); + } + size += dataSize; + if (!getLabelIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); + } + labelIdsMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, parent_); + } + 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.css.v1.UpdateAccountLabelsRequest)) { + return super.equals(obj); + } + com.google.shopping.css.v1.UpdateAccountLabelsRequest other = + (com.google.shopping.css.v1.UpdateAccountLabelsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLabelIdsList().equals(other.getLabelIdsList())) return false; + if (hasParent() != other.hasParent()) return false; + if (hasParent()) { + if (!getParent().equals(other.getParent())) 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(); + if (getLabelIdsCount() > 0) { + hash = (37 * hash) + LABEL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLabelIdsList().hashCode(); + } + if (hasParent()) { + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest 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 request message for the `UpdateLabels` method.
+   * 
+ * + * Protobuf type {@code google.shopping.css.v1.UpdateAccountLabelsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.css.v1.UpdateAccountLabelsRequest) + com.google.shopping.css.v1.UpdateAccountLabelsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.css.v1.UpdateAccountLabelsRequest.class, + com.google.shopping.css.v1.UpdateAccountLabelsRequest.Builder.class); + } + + // Construct using com.google.shopping.css.v1.UpdateAccountLabelsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + labelIds_ = emptyLongList(); + parent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.css.v1.AccountsProto + .internal_static_google_shopping_css_v1_UpdateAccountLabelsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelsRequest getDefaultInstanceForType() { + return com.google.shopping.css.v1.UpdateAccountLabelsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelsRequest build() { + com.google.shopping.css.v1.UpdateAccountLabelsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.css.v1.UpdateAccountLabelsRequest buildPartial() { + com.google.shopping.css.v1.UpdateAccountLabelsRequest result = + new com.google.shopping.css.v1.UpdateAccountLabelsRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.css.v1.UpdateAccountLabelsRequest result) { + if (((bitField0_ & 0x00000002) != 0)) { + labelIds_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.labelIds_ = labelIds_; + } + + private void buildPartial0(com.google.shopping.css.v1.UpdateAccountLabelsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.parent_ = parent_; + 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.css.v1.UpdateAccountLabelsRequest) { + return mergeFrom((com.google.shopping.css.v1.UpdateAccountLabelsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.css.v1.UpdateAccountLabelsRequest other) { + if (other == com.google.shopping.css.v1.UpdateAccountLabelsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.labelIds_.isEmpty()) { + if (labelIds_.isEmpty()) { + labelIds_ = other.labelIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLabelIdsIsMutable(); + labelIds_.addAll(other.labelIds_); + } + onChanged(); + } + if (other.hasParent()) { + parent_ = other.parent_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + long v = input.readInt64(); + ensureLabelIdsIsMutable(); + labelIds_.addLong(v); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureLabelIdsIsMutable(); + while (input.getBytesUntilLimit() > 0) { + labelIds_.addLong(input.readInt64()); + } + input.popLimit(limit); + break; + } // case 18 + case 26: + { + parent_ = 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 name_ = ""; + /** + * + * + *
+     * Required. The label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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 label resource name.
+     * Format: accounts/{account}
+     * 
+ * + * + * 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; + } + + private com.google.protobuf.Internal.LongList labelIds_ = emptyLongList(); + + private void ensureLabelIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + labelIds_ = mutableCopy(labelIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @return A list containing the labelIds. + */ + public java.util.List getLabelIdsList() { + return ((bitField0_ & 0x00000002) != 0) + ? java.util.Collections.unmodifiableList(labelIds_) + : labelIds_; + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @return The count of labelIds. + */ + public int getLabelIdsCount() { + return labelIds_.size(); + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + public long getLabelIds(int index) { + return labelIds_.getLong(index); + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @param index The index to set the value at. + * @param value The labelIds to set. + * @return This builder for chaining. + */ + public Builder setLabelIds(int index, long value) { + + ensureLabelIdsIsMutable(); + labelIds_.setLong(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @param value The labelIds to add. + * @return This builder for chaining. + */ + public Builder addLabelIds(long value) { + + ensureLabelIdsIsMutable(); + labelIds_.addLong(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @param values The labelIds to add. + * @return This builder for chaining. + */ + public Builder addAllLabelIds(java.lang.Iterable values) { + ensureLabelIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labelIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of label IDs to overwrite the existing account label IDs.
+     * If the list is empty, all currently assigned label IDs will be deleted.
+     * 
+ * + * repeated int64 label_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearLabelIds() { + labelIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + public boolean hasParent() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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; + } + } + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Only required when updating MC account labels.
+     * The CSS domain that is the parent resource of the MC account.
+     * Format: accounts/{account}
+     * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.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_ |= 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.css.v1.UpdateAccountLabelsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.css.v1.UpdateAccountLabelsRequest) + private static final com.google.shopping.css.v1.UpdateAccountLabelsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.css.v1.UpdateAccountLabelsRequest(); + } + + public static com.google.shopping.css.v1.UpdateAccountLabelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateAccountLabelsRequest 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.css.v1.UpdateAccountLabelsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequestOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequestOrBuilder.java new file mode 100644 index 000000000000..c9f3bdb1745c --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/css/v1/UpdateAccountLabelsRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/css/v1/accounts.proto + +package com.google.shopping.css.v1; + +public interface UpdateAccountLabelsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.css.v1.UpdateAccountLabelsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The label resource name.
+   * Format: accounts/{account}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @return A list containing the labelIds. + */ + java.util.List getLabelIdsList(); + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @return The count of labelIds. + */ + int getLabelIdsCount(); + /** + * + * + *
+   * The list of label IDs to overwrite the existing account label IDs.
+   * If the list is empty, all currently assigned label IDs will be deleted.
+   * 
+ * + * repeated int64 label_ids = 2; + * + * @param index The index of the element to return. + * @return The labelIds at the given index. + */ + long getLabelIds(int index); + + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the parent field is set. + */ + boolean hasParent(); + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Optional. Only required when updating MC account labels.
+   * The CSS domain that is the parent resource of the MC account.
+   * Format: accounts/{account}
+   * 
+ * + * + * optional string parent = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Channel.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Channel.java new file mode 100644 index 000000000000..5ee421705cc4 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Channel.java @@ -0,0 +1,587 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * [Channel](https://support.google.com/merchants/answer/7361332) of a product.
+ *
+ * Channel is used to distinguish between online and local products.
+ * 
+ * + * Protobuf type {@code google.shopping.type.Channel} + */ +public final class Channel extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Channel) + ChannelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Channel.newBuilder() to construct. + private Channel(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Channel() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Channel(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Channel.class, com.google.shopping.type.Channel.Builder.class); + } + + /** + * + * + *
+   * Channel values.
+   * 
+ * + * Protobuf enum {@code google.shopping.type.Channel.ChannelEnum} + */ + public enum ChannelEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * CHANNEL_ENUM_UNSPECIFIED = 0; + */ + CHANNEL_ENUM_UNSPECIFIED(0), + /** + * + * + *
+     * Online product.
+     * 
+ * + * ONLINE = 1; + */ + ONLINE(1), + /** + * + * + *
+     * Local product.
+     * 
+ * + * LOCAL = 2; + */ + LOCAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * CHANNEL_ENUM_UNSPECIFIED = 0; + */ + public static final int CHANNEL_ENUM_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Online product.
+     * 
+ * + * ONLINE = 1; + */ + public static final int ONLINE_VALUE = 1; + /** + * + * + *
+     * Local product.
+     * 
+ * + * LOCAL = 2; + */ + public static final int LOCAL_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 ChannelEnum 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 ChannelEnum forNumber(int value) { + switch (value) { + case 0: + return CHANNEL_ENUM_UNSPECIFIED; + case 1: + return ONLINE; + case 2: + return LOCAL; + 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 ChannelEnum findValueByNumber(int number) { + return ChannelEnum.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.type.Channel.getDescriptor().getEnumTypes().get(0); + } + + private static final ChannelEnum[] VALUES = values(); + + public static ChannelEnum 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 ChannelEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Channel.ChannelEnum) + } + + 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.type.Channel)) { + return super.equals(obj); + } + com.google.shopping.type.Channel other = (com.google.shopping.type.Channel) 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.type.Channel parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel 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.type.Channel parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel 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.type.Channel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Channel parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Channel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel 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.type.Channel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel 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.type.Channel parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Channel 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.type.Channel 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; + } + /** + * + * + *
+   * [Channel](https://support.google.com/merchants/answer/7361332) of a product.
+   *
+   * Channel is used to distinguish between online and local products.
+   * 
+ * + * Protobuf type {@code google.shopping.type.Channel} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Channel) + com.google.shopping.type.ChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Channel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Channel.class, + com.google.shopping.type.Channel.Builder.class); + } + + // Construct using com.google.shopping.type.Channel.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.type.TypesProto + .internal_static_google_shopping_type_Channel_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Channel getDefaultInstanceForType() { + return com.google.shopping.type.Channel.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Channel build() { + com.google.shopping.type.Channel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Channel buildPartial() { + com.google.shopping.type.Channel result = new com.google.shopping.type.Channel(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.type.Channel) { + return mergeFrom((com.google.shopping.type.Channel) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Channel other) { + if (other == com.google.shopping.type.Channel.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.type.Channel) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Channel) + private static final com.google.shopping.type.Channel DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Channel(); + } + + public static com.google.shopping.type.Channel getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Channel 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.type.Channel getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ChannelOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ChannelOrBuilder.java new file mode 100644 index 000000000000..06aee0067e60 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ChannelOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public interface ChannelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Channel) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttribute.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttribute.java new file mode 100644 index 000000000000..bd71ca66a62b --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttribute.java @@ -0,0 +1,1405 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * A message that represents custom attributes. Exactly one of `value` or
+ * `group_values` must not be empty.
+ * 
+ * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ +public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.CustomAttribute) + CustomAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomAttribute.newBuilder() to construct. + private CustomAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomAttribute() { + name_ = ""; + value_ = ""; + groupValues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAttribute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @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 VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List groupValues_; + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List getGroupValuesList() { + return groupValues_; + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List + getGroupValuesOrBuilderList() { + return groupValues_; + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public int getGroupValuesCount() { + return groupValues_.size(); + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + return groupValues_.get(index); + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + return groupValues_.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, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + output.writeMessage(3, groupValues_.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(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, groupValues_.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.type.CustomAttribute)) { + return super.equals(obj); + } + com.google.shopping.type.CustomAttribute other = (com.google.shopping.type.CustomAttribute) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) return false; + } + if (!getGroupValuesList().equals(other.getGroupValuesList())) 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 (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + if (getGroupValuesCount() > 0) { + hash = (37 * hash) + GROUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getGroupValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute 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.type.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute 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.type.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute 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.type.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute 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.type.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute 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.type.CustomAttribute prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A message that represents custom attributes. Exactly one of `value` or
+   * `group_values` must not be empty.
+   * 
+ * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.CustomAttribute) + com.google.shopping.type.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + // Construct using com.google.shopping.type.CustomAttribute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + } else { + groupValues_ = null; + groupValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute getDefaultInstanceForType() { + return com.google.shopping.type.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute build() { + com.google.shopping.type.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute buildPartial() { + com.google.shopping.type.CustomAttribute result = + new com.google.shopping.type.CustomAttribute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.type.CustomAttribute result) { + if (groupValuesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + groupValues_ = java.util.Collections.unmodifiableList(groupValues_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.groupValues_ = groupValues_; + } else { + result.groupValues_ = groupValuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.type.CustomAttribute result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + 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.type.CustomAttribute) { + return mergeFrom((com.google.shopping.type.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.CustomAttribute other) { + if (other == com.google.shopping.type.CustomAttribute.getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValue()) { + value_ = other.value_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (groupValuesBuilder_ == null) { + if (!other.groupValues_.isEmpty()) { + if (groupValues_.isEmpty()) { + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureGroupValuesIsMutable(); + groupValues_.addAll(other.groupValues_); + } + onChanged(); + } + } else { + if (!other.groupValues_.isEmpty()) { + if (groupValuesBuilder_.isEmpty()) { + groupValuesBuilder_.dispose(); + groupValuesBuilder_ = null; + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + groupValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupValuesFieldBuilder() + : null; + } else { + groupValuesBuilder_.addAllMessages(other.groupValues_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(m); + } else { + groupValuesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @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; + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List groupValues_ = + java.util.Collections.emptyList(); + + private void ensureGroupValuesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + groupValues_ = + new java.util.ArrayList(groupValues_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + groupValuesBuilder_; + + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List getGroupValuesList() { + if (groupValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupValues_); + } else { + return groupValuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public int getGroupValuesCount() { + if (groupValuesBuilder_ == null) { + return groupValues_.size(); + } else { + return groupValuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.set(index, value); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.set(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(index, value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addAllGroupValues( + java.lang.Iterable values) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupValues_); + onChanged(); + } else { + groupValuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder clearGroupValues() { + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + groupValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder removeGroupValues(int index) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.remove(index); + onChanged(); + } else { + groupValuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder getGroupValuesBuilder(int index) { + return getGroupValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesOrBuilderList() { + if (groupValuesBuilder_ != null) { + return groupValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupValues_); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder() { + return getGroupValuesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder(int index) { + return getGroupValuesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesBuilderList() { + return getGroupValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getGroupValuesFieldBuilder() { + if (groupValuesBuilder_ == null) { + groupValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + groupValues_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + groupValues_ = null; + } + return groupValuesBuilder_; + } + + @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.type.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.CustomAttribute) + private static final com.google.shopping.type.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.CustomAttribute(); + } + + public static com.google.shopping.type.CustomAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAttribute 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.type.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java new file mode 100644 index 000000000000..6e2f027973f6 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.CustomAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + boolean hasName(); + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List getGroupValuesList(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttribute getGroupValues(int index); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + int getGroupValuesCount(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List + getGroupValuesOrBuilderList(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Destination.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Destination.java new file mode 100644 index 000000000000..ba5b3940a70a --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Destination.java @@ -0,0 +1,684 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * Destinations available for a product.
+ *
+ * Destinations are used in Merchant Center to allow you to control where the
+ * products from your data feed should be displayed.
+ * 
+ * + * Protobuf type {@code google.shopping.type.Destination} + */ +public final class Destination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.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() {} + + @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.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Destination.class, + com.google.shopping.type.Destination.Builder.class); + } + + /** + * + * + *
+   * Destination values.
+   * 
+ * + * Protobuf enum {@code google.shopping.type.Destination.DestinationEnum} + */ + public enum DestinationEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * DESTINATION_ENUM_UNSPECIFIED = 0; + */ + DESTINATION_ENUM_UNSPECIFIED(0), + /** + * + * + *
+     * [Shopping ads](https://support.google.com/google-ads/answer/2454022).
+     * 
+ * + * SHOPPING_ADS = 1; + */ + SHOPPING_ADS(1), + /** + * + * + *
+     * [Display ads](https://support.google.com/merchants/answer/6069387).
+     * 
+ * + * DISPLAY_ADS = 2; + */ + DISPLAY_ADS(2), + /** + * + * + *
+     * [Local inventory
+     * ads](https://support.google.com/merchants/answer/3057972).
+     * 
+ * + * LOCAL_INVENTORY_ADS = 3; + */ + LOCAL_INVENTORY_ADS(3), + /** + * + * + *
+     * [Free listings](https://support.google.com/merchants/answer/9199328).
+     * 
+ * + * FREE_LISTINGS = 4; + */ + FREE_LISTINGS(4), + /** + * + * + *
+     * [Free local product
+     * listings](https://support.google.com/merchants/answer/9825611).
+     * 
+ * + * FREE_LOCAL_LISTINGS = 5; + */ + FREE_LOCAL_LISTINGS(5), + /** + * + * + *
+     * [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
+     * 
+ * + * YOUTUBE_SHOPPING = 6; + */ + YOUTUBE_SHOPPING(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * DESTINATION_ENUM_UNSPECIFIED = 0; + */ + public static final int DESTINATION_ENUM_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * [Shopping ads](https://support.google.com/google-ads/answer/2454022).
+     * 
+ * + * SHOPPING_ADS = 1; + */ + public static final int SHOPPING_ADS_VALUE = 1; + /** + * + * + *
+     * [Display ads](https://support.google.com/merchants/answer/6069387).
+     * 
+ * + * DISPLAY_ADS = 2; + */ + public static final int DISPLAY_ADS_VALUE = 2; + /** + * + * + *
+     * [Local inventory
+     * ads](https://support.google.com/merchants/answer/3057972).
+     * 
+ * + * LOCAL_INVENTORY_ADS = 3; + */ + public static final int LOCAL_INVENTORY_ADS_VALUE = 3; + /** + * + * + *
+     * [Free listings](https://support.google.com/merchants/answer/9199328).
+     * 
+ * + * FREE_LISTINGS = 4; + */ + public static final int FREE_LISTINGS_VALUE = 4; + /** + * + * + *
+     * [Free local product
+     * listings](https://support.google.com/merchants/answer/9825611).
+     * 
+ * + * FREE_LOCAL_LISTINGS = 5; + */ + public static final int FREE_LOCAL_LISTINGS_VALUE = 5; + /** + * + * + *
+     * [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
+     * 
+ * + * YOUTUBE_SHOPPING = 6; + */ + public static final int YOUTUBE_SHOPPING_VALUE = 6; + + 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 DestinationEnum 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 DestinationEnum forNumber(int value) { + switch (value) { + case 0: + return DESTINATION_ENUM_UNSPECIFIED; + case 1: + return SHOPPING_ADS; + case 2: + return DISPLAY_ADS; + case 3: + return LOCAL_INVENTORY_ADS; + case 4: + return FREE_LISTINGS; + case 5: + return FREE_LOCAL_LISTINGS; + case 6: + return YOUTUBE_SHOPPING; + 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 DestinationEnum findValueByNumber(int number) { + return DestinationEnum.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.type.Destination.getDescriptor().getEnumTypes().get(0); + } + + private static final DestinationEnum[] VALUES = values(); + + public static DestinationEnum 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 DestinationEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Destination.DestinationEnum) + } + + 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.type.Destination)) { + return super.equals(obj); + } + com.google.shopping.type.Destination other = (com.google.shopping.type.Destination) 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.type.Destination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.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.type.Destination parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.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.type.Destination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Destination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Destination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.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.type.Destination parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.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.type.Destination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.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.type.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 available for a product.
+   *
+   * Destinations are used in Merchant Center to allow you to control where the
+   * products from your data feed should be displayed.
+   * 
+ * + * Protobuf type {@code google.shopping.type.Destination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Destination) + com.google.shopping.type.DestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Destination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Destination.class, + com.google.shopping.type.Destination.Builder.class); + } + + // Construct using com.google.shopping.type.Destination.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.type.TypesProto + .internal_static_google_shopping_type_Destination_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Destination getDefaultInstanceForType() { + return com.google.shopping.type.Destination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Destination build() { + com.google.shopping.type.Destination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Destination buildPartial() { + com.google.shopping.type.Destination result = new com.google.shopping.type.Destination(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.type.Destination) { + return mergeFrom((com.google.shopping.type.Destination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Destination other) { + if (other == com.google.shopping.type.Destination.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.type.Destination) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Destination) + private static final com.google.shopping.type.Destination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Destination(); + } + + public static com.google.shopping.type.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.type.Destination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/DestinationOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/DestinationOrBuilder.java new file mode 100644 index 000000000000..ccec8f709da9 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/DestinationOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public interface DestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Destination) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Price.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Price.java new file mode 100644 index 000000000000..daf2dbcc9282 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/Price.java @@ -0,0 +1,818 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * The price represented as a number and currency.
+ * 
+ * + * Protobuf type {@code google.shopping.type.Price} + */ +public final class Price extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Price) + PriceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Price.newBuilder() to construct. + private Price(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Price() { + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Price(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + private int bitField0_; + public static final int AMOUNT_MICROS_FIELD_NUMBER = 1; + private long amountMicros_ = 0L; + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object currencyCode_ = ""; + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + @java.lang.Override + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, currencyCode_); + } + 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.computeInt64Size(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, currencyCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.type.Price)) { + return super.equals(obj); + } + com.google.shopping.type.Price other = (com.google.shopping.type.Price) obj; + + if (hasAmountMicros() != other.hasAmountMicros()) return false; + if (hasAmountMicros()) { + if (getAmountMicros() != other.getAmountMicros()) return false; + } + if (hasCurrencyCode() != other.hasCurrencyCode()) return false; + if (hasCurrencyCode()) { + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAmountMicros()) { + hash = (37 * hash) + AMOUNT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmountMicros()); + } + if (hasCurrencyCode()) { + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.Price parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price 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.type.Price parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price 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.type.Price parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price 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.type.Price parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price 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.type.Price parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price 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.type.Price 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 price represented as a number and currency.
+   * 
+ * + * Protobuf type {@code google.shopping.type.Price} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Price) + com.google.shopping.type.PriceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + // Construct using com.google.shopping.type.Price.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amountMicros_ = 0L; + currencyCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Price getDefaultInstanceForType() { + return com.google.shopping.type.Price.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Price build() { + com.google.shopping.type.Price result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Price buildPartial() { + com.google.shopping.type.Price result = new com.google.shopping.type.Price(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.type.Price result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amountMicros_ = amountMicros_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.currencyCode_ = currencyCode_; + 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.type.Price) { + return mergeFrom((com.google.shopping.type.Price) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Price other) { + if (other == com.google.shopping.type.Price.getDefaultInstance()) return this; + if (other.hasAmountMicros()) { + setAmountMicros(other.getAmountMicros()); + } + if (other.hasCurrencyCode()) { + currencyCode_ = other.currencyCode_; + 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 8: + { + amountMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + currencyCode_ = 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 long amountMicros_; + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @param value The amountMicros to set. + * @return This builder for chaining. + */ + public Builder setAmountMicros(long value) { + + amountMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmountMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + amountMicros_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + currencyCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + currencyCode_ = getDefaultInstance().getCurrencyCode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + currencyCode_ = value; + bitField0_ |= 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.type.Price) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Price) + private static final com.google.shopping.type.Price DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Price(); + } + + public static com.google.shopping.type.Price getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Price 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.type.Price getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/PriceOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/PriceOrBuilder.java new file mode 100644 index 000000000000..daad96b93806 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/PriceOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public interface PriceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Price) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + boolean hasAmountMicros(); + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + long getAmountMicros(); + + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + boolean hasCurrencyCode(); + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContext.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContext.java new file mode 100644 index 000000000000..891f8b1ea958 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContext.java @@ -0,0 +1,836 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * Reporting contexts that your account and product issues apply to.
+ *
+ * Reporting contexts are groups of surfaces and formats for product results on
+ * Google. They can represent the entire destination (for example, [Shopping
+ * ads](https://support.google.com/merchants/answer/6149970)) or a subset of
+ * formats within a destination (for example, [Discovery
+ * ads](https://support.google.com/merchants/answer/13389785)).
+ * 
+ * + * Protobuf type {@code google.shopping.type.ReportingContext} + */ +public final class ReportingContext extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.ReportingContext) + ReportingContextOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReportingContext.newBuilder() to construct. + private ReportingContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReportingContext() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReportingContext(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.ReportingContext.class, + com.google.shopping.type.ReportingContext.Builder.class); + } + + /** + * + * + *
+   * Reporting context values.
+   * 
+ * + * Protobuf enum {@code google.shopping.type.ReportingContext.ReportingContextEnum} + */ + public enum ReportingContextEnum implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; + */ + REPORTING_CONTEXT_ENUM_UNSPECIFIED(0), + /** + * + * + *
+     * [Shopping ads](https://support.google.com/merchants/answer/6149970).
+     * 
+ * + * SHOPPING_ADS = 1; + */ + SHOPPING_ADS(1), + /** + * + * + *
+     * [Discovery and Demand Gen
+     * ads](https://support.google.com/merchants/answer/13389785).
+     * 
+ * + * DISCOVERY_ADS = 2; + */ + DISCOVERY_ADS(2), + /** + * + * + *
+     * [Video ads](https://support.google.com/google-ads/answer/6340491).
+     * 
+ * + * VIDEO_ADS = 3; + */ + VIDEO_ADS(3), + /** + * + * + *
+     * [Display ads](https://support.google.com/merchants/answer/6069387).
+     * 
+ * + * DISPLAY_ADS = 4; + */ + DISPLAY_ADS(4), + /** + * + * + *
+     * [Local inventory
+     * ads](https://support.google.com/merchants/answer/3271956).
+     * 
+ * + * LOCAL_INVENTORY_ADS = 5; + */ + LOCAL_INVENTORY_ADS(5), + /** + * + * + *
+     * [Vehicle inventory
+     * ads](https://support.google.com/merchants/answer/11544533).
+     * 
+ * + * VEHICLE_INVENTORY_ADS = 6; + */ + VEHICLE_INVENTORY_ADS(6), + /** + * + * + *
+     * [Free product
+     * listings](https://support.google.com/merchants/answer/9199328).
+     * 
+ * + * FREE_LISTINGS = 7; + */ + FREE_LISTINGS(7), + /** + * + * + *
+     * [Free local product
+     * listings](https://support.google.com/merchants/answer/9825611).
+     * 
+ * + * FREE_LOCAL_LISTINGS = 8; + */ + FREE_LOCAL_LISTINGS(8), + /** + * + * + *
+     * [Free local vehicle
+     * listings](https://support.google.com/merchants/answer/11544533).
+     * 
+ * + * FREE_LOCAL_VEHICLE_LISTINGS = 9; + */ + FREE_LOCAL_VEHICLE_LISTINGS(9), + /** + * + * + *
+     * [YouTube
+     * Shopping](https://support.google.com/merchants/answer/13478370).
+     * 
+ * + * YOUTUBE_SHOPPING = 10; + */ + YOUTUBE_SHOPPING(10), + /** + * + * + *
+     * [Cloud retail](https://cloud.google.com/solutions/retail).
+     * 
+ * + * CLOUD_RETAIL = 11; + */ + CLOUD_RETAIL(11), + /** + * + * + *
+     * [Local cloud retail](https://cloud.google.com/solutions/retail).
+     * 
+ * + * LOCAL_CLOUD_RETAIL = 12; + */ + LOCAL_CLOUD_RETAIL(12), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; + */ + public static final int REPORTING_CONTEXT_ENUM_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * [Shopping ads](https://support.google.com/merchants/answer/6149970).
+     * 
+ * + * SHOPPING_ADS = 1; + */ + public static final int SHOPPING_ADS_VALUE = 1; + /** + * + * + *
+     * [Discovery and Demand Gen
+     * ads](https://support.google.com/merchants/answer/13389785).
+     * 
+ * + * DISCOVERY_ADS = 2; + */ + public static final int DISCOVERY_ADS_VALUE = 2; + /** + * + * + *
+     * [Video ads](https://support.google.com/google-ads/answer/6340491).
+     * 
+ * + * VIDEO_ADS = 3; + */ + public static final int VIDEO_ADS_VALUE = 3; + /** + * + * + *
+     * [Display ads](https://support.google.com/merchants/answer/6069387).
+     * 
+ * + * DISPLAY_ADS = 4; + */ + public static final int DISPLAY_ADS_VALUE = 4; + /** + * + * + *
+     * [Local inventory
+     * ads](https://support.google.com/merchants/answer/3271956).
+     * 
+ * + * LOCAL_INVENTORY_ADS = 5; + */ + public static final int LOCAL_INVENTORY_ADS_VALUE = 5; + /** + * + * + *
+     * [Vehicle inventory
+     * ads](https://support.google.com/merchants/answer/11544533).
+     * 
+ * + * VEHICLE_INVENTORY_ADS = 6; + */ + public static final int VEHICLE_INVENTORY_ADS_VALUE = 6; + /** + * + * + *
+     * [Free product
+     * listings](https://support.google.com/merchants/answer/9199328).
+     * 
+ * + * FREE_LISTINGS = 7; + */ + public static final int FREE_LISTINGS_VALUE = 7; + /** + * + * + *
+     * [Free local product
+     * listings](https://support.google.com/merchants/answer/9825611).
+     * 
+ * + * FREE_LOCAL_LISTINGS = 8; + */ + public static final int FREE_LOCAL_LISTINGS_VALUE = 8; + /** + * + * + *
+     * [Free local vehicle
+     * listings](https://support.google.com/merchants/answer/11544533).
+     * 
+ * + * FREE_LOCAL_VEHICLE_LISTINGS = 9; + */ + public static final int FREE_LOCAL_VEHICLE_LISTINGS_VALUE = 9; + /** + * + * + *
+     * [YouTube
+     * Shopping](https://support.google.com/merchants/answer/13478370).
+     * 
+ * + * YOUTUBE_SHOPPING = 10; + */ + public static final int YOUTUBE_SHOPPING_VALUE = 10; + /** + * + * + *
+     * [Cloud retail](https://cloud.google.com/solutions/retail).
+     * 
+ * + * CLOUD_RETAIL = 11; + */ + public static final int CLOUD_RETAIL_VALUE = 11; + /** + * + * + *
+     * [Local cloud retail](https://cloud.google.com/solutions/retail).
+     * 
+ * + * LOCAL_CLOUD_RETAIL = 12; + */ + public static final int LOCAL_CLOUD_RETAIL_VALUE = 12; + + 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 ReportingContextEnum 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 ReportingContextEnum forNumber(int value) { + switch (value) { + case 0: + return REPORTING_CONTEXT_ENUM_UNSPECIFIED; + case 1: + return SHOPPING_ADS; + case 2: + return DISCOVERY_ADS; + case 3: + return VIDEO_ADS; + case 4: + return DISPLAY_ADS; + case 5: + return LOCAL_INVENTORY_ADS; + case 6: + return VEHICLE_INVENTORY_ADS; + case 7: + return FREE_LISTINGS; + case 8: + return FREE_LOCAL_LISTINGS; + case 9: + return FREE_LOCAL_VEHICLE_LISTINGS; + case 10: + return YOUTUBE_SHOPPING; + case 11: + return CLOUD_RETAIL; + case 12: + return LOCAL_CLOUD_RETAIL; + 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 ReportingContextEnum findValueByNumber(int number) { + return ReportingContextEnum.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.type.ReportingContext.getDescriptor().getEnumTypes().get(0); + } + + private static final ReportingContextEnum[] VALUES = values(); + + public static ReportingContextEnum 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 ReportingContextEnum(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.ReportingContext.ReportingContextEnum) + } + + 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.type.ReportingContext)) { + return super.equals(obj); + } + com.google.shopping.type.ReportingContext other = + (com.google.shopping.type.ReportingContext) 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.type.ReportingContext parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext 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.type.ReportingContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext 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.type.ReportingContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.ReportingContext parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.ReportingContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext 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.type.ReportingContext parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext 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.type.ReportingContext parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.ReportingContext 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.type.ReportingContext 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; + } + /** + * + * + *
+   * Reporting contexts that your account and product issues apply to.
+   *
+   * Reporting contexts are groups of surfaces and formats for product results on
+   * Google. They can represent the entire destination (for example, [Shopping
+   * ads](https://support.google.com/merchants/answer/6149970)) or a subset of
+   * formats within a destination (for example, [Discovery
+   * ads](https://support.google.com/merchants/answer/13389785)).
+   * 
+ * + * Protobuf type {@code google.shopping.type.ReportingContext} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.ReportingContext) + com.google.shopping.type.ReportingContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.ReportingContext.class, + com.google.shopping.type.ReportingContext.Builder.class); + } + + // Construct using com.google.shopping.type.ReportingContext.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.type.TypesProto + .internal_static_google_shopping_type_ReportingContext_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext getDefaultInstanceForType() { + return com.google.shopping.type.ReportingContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext build() { + com.google.shopping.type.ReportingContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.ReportingContext buildPartial() { + com.google.shopping.type.ReportingContext result = + new com.google.shopping.type.ReportingContext(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.type.ReportingContext) { + return mergeFrom((com.google.shopping.type.ReportingContext) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.ReportingContext other) { + if (other == com.google.shopping.type.ReportingContext.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.type.ReportingContext) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.ReportingContext) + private static final com.google.shopping.type.ReportingContext DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.ReportingContext(); + } + + public static com.google.shopping.type.ReportingContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReportingContext 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.type.ReportingContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java new file mode 100644 index 000000000000..e3650d6489ef --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/ReportingContextOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public interface ReportingContextOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.ReportingContext) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/TypesProto.java b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/TypesProto.java new file mode 100644 index 000000000000..39d4af4b9716 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/java/com/google/shopping/type/TypesProto.java @@ -0,0 +1,125 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/type/types.proto + +package com.google.shopping.type; + +public final class TypesProto { + private TypesProto() {} + + 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_type_Price_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_Price_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Destination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_Destination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_ReportingContext_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_ReportingContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Channel_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_Channel_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/type/types.proto\022\024goog" + + "le.shopping.type\"c\n\005Price\022\032\n\ramount_micr" + + "os\030\001 \001(\003H\000\210\001\001\022\032\n\rcurrency_code\030\002 \001(\tH\001\210\001" + + "\001B\020\n\016_amount_microsB\020\n\016_currency_code\"\210\001" + + "\n\017CustomAttribute\022\021\n\004name\030\001 \001(\tH\000\210\001\001\022\022\n\005" + + "value\030\002 \001(\tH\001\210\001\001\022;\n\014group_values\030\003 \003(\0132%" + + ".google.shopping.type.CustomAttributeB\007\n" + + "\005_nameB\010\n\006_value\"\301\001\n\013Destination\"\261\001\n\017Des" + + "tinationEnum\022 \n\034DESTINATION_ENUM_UNSPECI" + + "FIED\020\000\022\020\n\014SHOPPING_ADS\020\001\022\017\n\013DISPLAY_ADS\020" + + "\002\022\027\n\023LOCAL_INVENTORY_ADS\020\003\022\021\n\rFREE_LISTI" + + "NGS\020\004\022\027\n\023FREE_LOCAL_LISTINGS\020\005\022\024\n\020YOUTUB" + + "E_SHOPPING\020\006\"\331\002\n\020ReportingContext\"\304\002\n\024Re" + + "portingContextEnum\022&\n\"REPORTING_CONTEXT_" + + "ENUM_UNSPECIFIED\020\000\022\020\n\014SHOPPING_ADS\020\001\022\021\n\r" + + "DISCOVERY_ADS\020\002\022\r\n\tVIDEO_ADS\020\003\022\017\n\013DISPLA" + + "Y_ADS\020\004\022\027\n\023LOCAL_INVENTORY_ADS\020\005\022\031\n\025VEHI" + + "CLE_INVENTORY_ADS\020\006\022\021\n\rFREE_LISTINGS\020\007\022\027" + + "\n\023FREE_LOCAL_LISTINGS\020\010\022\037\n\033FREE_LOCAL_VE" + + "HICLE_LISTINGS\020\t\022\024\n\020YOUTUBE_SHOPPING\020\n\022\020" + + "\n\014CLOUD_RETAIL\020\013\022\026\n\022LOCAL_CLOUD_RETAIL\020\014" + + "\"M\n\007Channel\"B\n\013ChannelEnum\022\034\n\030CHANNEL_EN" + + "UM_UNSPECIFIED\020\000\022\n\n\006ONLINE\020\001\022\t\n\005LOCAL\020\002B" + + "p\n\030com.google.shopping.typeB\nTypesProtoP" + + "\001Z/cloud.google.com/go/shopping/type/typ" + + "epb;typepb\252\002\024Google.Shopping.Typeb\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_shopping_type_Price_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_type_Price_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_Price_descriptor, + new java.lang.String[] { + "AmountMicros", "CurrencyCode", "AmountMicros", "CurrencyCode", + }); + internal_static_google_shopping_type_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_CustomAttribute_descriptor, + new java.lang.String[] { + "Name", "Value", "GroupValues", "Name", "Value", + }); + internal_static_google_shopping_type_Destination_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_type_Destination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_Destination_descriptor, new java.lang.String[] {}); + internal_static_google_shopping_type_ReportingContext_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_type_ReportingContext_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_ReportingContext_descriptor, + new java.lang.String[] {}); + internal_static_google_shopping_type_Channel_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_type_Channel_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_Channel_descriptor, new java.lang.String[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts.proto new file mode 100644 index 000000000000..6c098ccec6e1 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts.proto @@ -0,0 +1,218 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.css.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Shopping.Css.V1"; +option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountsProto"; +option java_package = "com.google.shopping.css.v1"; +option php_namespace = "Google\\Shopping\\Css\\V1"; +option ruby_package = "Google::Shopping::Css::V1"; + +// Service for managing CSS/MC account information. +service AccountsService { + option (google.api.default_host) = "css.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists all the accounts under the specified CSS account ID, and + // optionally filters by label ID and account name. + rpc ListChildAccounts(ListChildAccountsRequest) + returns (ListChildAccountsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}:listChildAccounts" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a single CSS/MC account by ID. + rpc GetAccount(GetAccountRequest) returns (Account) { + option (google.api.http) = { + get: "/v1/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates labels assigned to CSS/MC accounts by a CSS domain. + rpc UpdateLabels(UpdateAccountLabelsRequest) returns (Account) { + option (google.api.http) = { + post: "/v1/{name=accounts/*}:updateLabels" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// The request message for the `ListChildAccounts` method. +message ListChildAccountsRequest { + // Required. The parent account. Must be a CSS group or domain. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "css.googleapis.com/Account" } + ]; + + // If set, only the MC accounts with the given label ID will be returned. + optional int64 label_id = 2; + + // If set, only the MC accounts with the given name (case sensitive) will be + // returned. + optional string full_name = 3; + + // Optional. The maximum number of accounts to return. The service may return + // fewer than this value. If unspecified, at most 50 accounts will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListChildAccounts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListChildAccounts` must + // match the call that provided the page token. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListChildAccounts` method. +message ListChildAccountsResponse { + // The CSS/MC accounts returned for the specified CSS parent account. + repeated Account accounts = 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; +} + +// The request message for the `GetAccount` method. +message GetAccountRequest { + // Required. The name of the managed CSS/MC account. + // Format: accounts/{account} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "css.googleapis.com/Account" } + ]; + + // Optional. Only required when retrieving MC account information. + // The CSS domain that is the parent resource of the MC account. + // Format: accounts/{account} + optional string parent = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "css.googleapis.com/Account" } + ]; +} + +// The request message for the `UpdateLabels` method. +message UpdateAccountLabelsRequest { + // Required. The label resource name. + // Format: accounts/{account} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "css.googleapis.com/Account" } + ]; + + // The list of label IDs to overwrite the existing account label IDs. + // If the list is empty, all currently assigned label IDs will be deleted. + repeated int64 label_ids = 2; + + // Optional. Only required when updating MC account labels. + // The CSS domain that is the parent resource of the MC account. + // Format: accounts/{account} + optional string parent = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "css.googleapis.com/Account" } + ]; +} + +// Information about CSS/MC account. +message Account { + option (google.api.resource) = { + type: "css.googleapis.com/Account" + pattern: "accounts/{account}" + plural: "accounts" + singular: "account" + }; + + // The account type. + enum AccountType { + // Unknown account type. + ACCOUNT_TYPE_UNSPECIFIED = 0; + + // CSS group account. + CSS_GROUP = 1; + + // CSS domain account. + CSS_DOMAIN = 2; + + // MC Primary CSS MCA account. + MC_PRIMARY_CSS_MCA = 3; + + // MC CSS MCA account. + MC_CSS_MCA = 4; + + // MC Marketplace MCA account. + MC_MARKETPLACE_MCA = 5; + + // MC Other MCA account. + MC_OTHER_MCA = 6; + + // MC Standalone account. + MC_STANDALONE = 7; + + // MC MCA sub-account. + MC_MCA_SUBACCOUNT = 8; + } + + // The label resource name. + // Format: accounts/{account} + string name = 1; + + // Output only. Immutable. The CSS/MC account's full name. + string full_name = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The CSS/MC account's short display name. + optional string display_name = 3; + + // Output only. Immutable. The CSS/MC account's homepage. + optional string homepage_uri = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The CSS/MC account's parent resource. CSS group for CSS domains; CSS + // domain for MC accounts. Returned only if the user has access to the + // parent account. + optional string parent = 5; + + // Manually created label IDs assigned to the CSS/MC account by a CSS parent + // account. + repeated int64 label_ids = 6; + + // Automatically created label IDs assigned to the MC account by + // CSS Center. + repeated int64 automatic_label_ids = 7; + + // Output only. The type of this account. + AccountType account_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts_labels.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts_labels.proto new file mode 100644 index 000000000000..fb6549923a66 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/accounts_labels.proto @@ -0,0 +1,182 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.css.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"; + +option csharp_namespace = "Google.Shopping.Css.V1"; +option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountsLabelsProto"; +option java_package = "com.google.shopping.css.v1"; +option php_namespace = "Google\\Shopping\\Css\\V1"; +option ruby_package = "Google::Shopping::Css::V1"; + +// Manages Merchant Center and CSS accounts labels. +service AccountLabelsService { + option (google.api.default_host) = "css.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists the labels assigned to an account. + rpc ListAccountLabels(ListAccountLabelsRequest) + returns (ListAccountLabelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/labels" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new label, not assigned to any account. + rpc CreateAccountLabel(CreateAccountLabelRequest) returns (AccountLabel) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/labels" + body: "account_label" + }; + option (google.api.method_signature) = "parent,account_label"; + } + + // Updates a label. + rpc UpdateAccountLabel(UpdateAccountLabelRequest) returns (AccountLabel) { + option (google.api.http) = { + patch: "/v1/{account_label.name=accounts/*/labels/*}" + body: "account_label" + }; + option (google.api.method_signature) = "account_label"; + } + + // Deletes a label and removes it from all accounts to which it was assigned. + rpc DeleteAccountLabel(DeleteAccountLabelRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/labels/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Label assigned by CSS domain or CSS group to one of its sub-accounts. +message AccountLabel { + option (google.api.resource) = { + type: "css.googleapis.com/AccountLabel" + pattern: "accounts/{account}/labels/{label}" + plural: "accountLabels" + singular: "accountLabel" + }; + + // The label type. + enum LabelType { + // Unknown label type. + LABEL_TYPE_UNSPECIFIED = 0; + + // Indicates that the label was created manually. + MANUAL = 1; + + // Indicates that the label was created automatically by CSS Center. + AUTOMATIC = 2; + } + + // The resource name of the label. + // Format: accounts/{account}/labels/{label} + string name = 1; + + // Output only. The ID of the label. + int64 label_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ID of account this label belongs to. + int64 account_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The display name of this label. + optional string display_name = 4; + + // The description of this label. + optional string description = 5; + + // Output only. The type of this label. + LabelType label_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the `ListAccountLabels` method. +message ListAccountLabelsRequest { + // Required. The parent account. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "css.googleapis.com/AccountLabel" + } + ]; + + // The maximum number of labels to return. The service may return fewer than + // this value. + // If unspecified, at most 50 labels will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListAccountLabels` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAccountLabels` must + // match the call that provided the page token. + string page_token = 3; +} + +// Response message for the `ListAccountLabels` method. +message ListAccountLabelsResponse { + // The labels from the specified account. + repeated AccountLabel account_labels = 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 'CreateAccountLanel' method. +message CreateAccountLabelRequest { + // Required. The parent account. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "css.googleapis.com/AccountLabel" + } + ]; + + // Required. The label to create. + AccountLabel account_label = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `UpdateAccountLabel` method. +message UpdateAccountLabelRequest { + // Required. The updated label. All fields must be provided. + AccountLabel account_label = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the 'DeleteAccountLabel' method. +message DeleteAccountLabelRequest { + // Required. The name of the label to delete. + // Format: accounts/{account}/labels/{label} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "css.googleapis.com/AccountLabel" + } + ]; +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto new file mode 100644 index 000000000000..9df0eea25a51 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_common.proto @@ -0,0 +1,331 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.css.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/shopping/type/types.proto"; + +option csharp_namespace = "Google.Shopping.Css.V1"; +option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; +option java_multiple_files = true; +option java_outer_classname = "CssProductCommonProto"; +option java_package = "com.google.shopping.css.v1"; +option php_namespace = "Google\\Shopping\\Css\\V1"; +option ruby_package = "Google::Shopping::Css::V1"; + +// Attributes for CSS Product. +message Attributes { + // URL directly linking to your the Product Detail Page of the CSS. + optional string cpp_link = 1; + + // URL for the mobile-optimized version of the Product Detail Page of the CSS. + optional string cpp_mobile_link = 2; + + // Allows advertisers to override the item URL when the product is shown + // within the context of Product Ads. + optional string cpp_ads_redirect = 42; + + // Low Price of the aggregate offer. + google.shopping.type.Price low_price = 3; + + // High Price of the aggregate offer. + google.shopping.type.Price high_price = 4; + + // The number of aggregate offers. + optional int64 number_of_offers = 5; + + // Condition of the headline offer. + optional string headline_offer_condition = 6; + + // Headline Price of the aggregate offer. + google.shopping.type.Price headline_offer_price = 7; + + // Link to the headline offer. + optional string headline_offer_link = 8; + + // Mobile Link to the headline offer. + optional string headline_offer_mobile_link = 9; + + // Headline Price of the aggregate offer. + google.shopping.type.Price headline_offer_shipping_price = 41; + + // Title of the item. + optional string title = 10; + + // URL of an image of the item. + optional string image_link = 11; + + // Additional URL of images of the item. + repeated string additional_image_links = 12; + + // Description of the item. + optional string description = 13; + + // Product Related Attributes.[14-36] + // Brand of the item. + optional string brand = 14; + + // Manufacturer Part Number + // ([MPN](https://support.google.com/merchants/answer/188494#mpn)) of the + // item. + optional string mpn = 15; + + // Global Trade Item Number + // ([GTIN](https://support.google.com/merchants/answer/188494#gtin)) of the + // item. + optional string gtin = 16; + + // Categories of the item (formatted as in [products data + // specification](https://support.google.com/merchants/answer/6324406)). + repeated string product_types = 36; + + // Google's category of the item (see [Google product + // taxonomy](https://support.google.com/merchants/answer/1705911)). When + // querying products, this field will contain the user provided value. There + // is currently no way to get back the auto assigned google product + // categories through the API. + optional string google_product_category = 17; + + // Set to true if the item is targeted towards adults. + optional bool adult = 18; + + // The number of identical products in a merchant-defined multipack. + optional int64 multipack = 19; + + // Whether the item is a merchant-defined bundle. A bundle is a custom + // grouping of different products sold by a merchant for a single price. + optional bool is_bundle = 20; + + // Target age group of the item. + optional string age_group = 21; + + // Color of the item. + optional string color = 22; + + // Target gender of the item. + optional string gender = 23; + + // The material of which the item is made. + optional string material = 24; + + // The item's pattern (e.g. polka dots). + optional string pattern = 25; + + // Size of the item. Only one value is allowed. For variants with different + // sizes, insert a separate product for each size with the same + // `itemGroupId` value (see + // [https://support.google.com/merchants/answer/6324492](size definition)). + optional string size = 26; + + // System in which the size is specified. Recommended for apparel items. + optional string size_system = 27; + + // The cut of the item. It can be used to represent combined size types for + // apparel items. Maximum two of size types can be provided (see + // [https://support.google.com/merchants/answer/6324497](size type)). + repeated string size_types = 28; + + // Shared identifier for all variants of the same product. + optional string item_group_id = 29; + + // Technical specification or additional product details. + repeated ProductDetail product_details = 30; + + // The weight of the product in the units provided. The value must be + // between 0 (exclusive) and 2000 (inclusive). + ProductWeight product_weight = 31; + + // The length of the product in the units provided. The value must be + // between 0 (exclusive) and 3000 (inclusive). + ProductDimension product_length = 32; + + // The width of the product in the units provided. The value must be between + // 0 (exclusive) and 3000 (inclusive). + ProductDimension product_width = 33; + + // The height of the product in the units provided. The value must be + // between + // 0 (exclusive) and 3000 (inclusive). + ProductDimension product_height = 34; + + // Bullet points describing the most relevant highlights of a product. + repeated string product_highlights = 35; + + // A list of certificates claimed by the CSS for the given product. + repeated Certification certifications = 39; + + // Date on which the item should expire, as specified upon insertion, in + // [ISO + // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. The actual + // expiration date in Google Shopping is exposed in `productstatuses` as + // [googleExpirationDate](https://support.google.com/merchants/answer/6324499) + // and might be earlier if `expirationDate` is too far in the future. + // Note: It may take 2+ days from the expiration date for the item to + // actually get deleted. + google.protobuf.Timestamp expiration_date = 40; + + // The list of destinations to include for this target (corresponds to + // checked check boxes in Merchant Center). Default destinations are always + // included unless provided in `excludedDestinations`. + repeated string included_destinations = 43; + + // The list of destinations to exclude for this target (corresponds to + // unchecked check boxes in Merchant Center). + repeated string excluded_destinations = 44; + + // Publication of this item will be temporarily paused. + optional string pause = 45; + + // Custom label 0 for custom grouping of items in a Shopping campaign. + optional string custom_label_0 = 46; + + // Custom label 1 for custom grouping of items in a Shopping campaign. + optional string custom_label_1 = 47; + + // Custom label 2 for custom grouping of items in a Shopping campaign. + optional string custom_label_2 = 48; + + // Custom label 3 for custom grouping of items in a Shopping campaign. + optional string custom_label_3 = 49; + + // Custom label 4 for custom grouping of items in a Shopping campaign. + optional string custom_label_4 = 50; +} + +// The certification for the product. +message Certification { + // Name of the certification. + string name = 1; + + // Name of the certification body. + string authority = 2; + + // A unique code to identify the certification. + string code = 3; +} + +// The product details. +message ProductDetail { + // The section header used to group a set of product details. + string section_name = 1; + + // The name of the product detail. + string attribute_name = 2; + + // The value of the product detail. + string attribute_value = 3; +} + +// The dimension of the product. +message ProductDimension { + // Required. The dimension value represented as a number. The value can have a + // maximum precision of four decimal places. + double value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The dimension units. + // Acceptable values are: + // * "`in`" + // * "`cm`" + string unit = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The weight of the product. +message ProductWeight { + // Required. The weight represented as a number. The weight can have a maximum + // precision of four decimal places. + double value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The weight unit. + // Acceptable values are: + // * "`g`" + // * "`kg`" + // * "`oz`" + // * "`lb`" + string unit = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The status of the Css Product, data validation issues, that is, +// information about the Css Product computed asynchronously. +message CssProductStatus { + // The destination status of the product status. + message DestinationStatus { + // The name of the destination + string destination = 1; + + // List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is + // approved. + repeated string approved_countries = 2; + + // List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is + // pending approval. + repeated string pending_countries = 3; + + // List of country codes (ISO 3166-1 alpha-2) where the aggregate offer is + // disapproved. + repeated string disapproved_countries = 4; + } + + // The ItemLevelIssue of the product status. + message ItemLevelIssue { + // The error code of the issue. + string code = 1; + + // How this issue affects serving of the aggregate offer. + string servability = 2; + + // Whether the issue can be resolved by the merchant. + string resolution = 3; + + // The attribute's name, if the issue is caused by a single attribute. + string attribute = 4; + + // The destination the issue applies to. + string destination = 5; + + // A short issue description in English. + string description = 6; + + // A detailed issue description in English. + string detail = 7; + + // The URL of a web page to help with resolving this issue. + string documentation = 8; + + // List of country codes (ISO 3166-1 alpha-2) where issue applies to the + // aggregate offer. + repeated string applicable_countries = 9; + } + + // The intended destinations for the product. + repeated DestinationStatus destination_statuses = 3; + + // A list of all issues associated with the product. + repeated ItemLevelIssue item_level_issues = 4; + + // Date on which the item has been created, in [ISO + // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + google.protobuf.Timestamp creation_date = 5; + + // Date on which the item has been last updated, in [ISO + // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + google.protobuf.Timestamp last_update_date = 6; + + // Date on which the item expires in Google Shopping, in [ISO + // 8601](http://en.wikipedia.org/wiki/ISO_8601) format. + google.protobuf.Timestamp google_expiration_date = 7; +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_inputs.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_inputs.proto new file mode 100644 index 000000000000..ad71c170cbaa --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_product_inputs.proto @@ -0,0 +1,178 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.css.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/timestamp.proto"; +import "google/shopping/css/v1/css_product_common.proto"; +import "google/shopping/type/types.proto"; + +option csharp_namespace = "Google.Shopping.Css.V1"; +option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; +option java_multiple_files = true; +option java_outer_classname = "CssProductInputsProto"; +option java_package = "com.google.shopping.css.v1"; +option php_namespace = "Google\\Shopping\\Css\\V1"; +option ruby_package = "Google::Shopping::Css::V1"; + +// Service to use CssProductInput resource. +// This service helps to insert/update/delete CSS Products. +service CssProductInputsService { + option (google.api.default_host) = "css.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Uploads a CssProductInput to your CSS Center account. If an + // input with the same contentLanguage, identity, feedLabel and feedId already + // exists, this method replaces that entry. + // + // After inserting, updating, or deleting a CSS Product input, it may + // take several minutes before the processed CSS Product can be retrieved. + rpc InsertCssProductInput(InsertCssProductInputRequest) + returns (CssProductInput) { + option (google.api.http) = { + post: "/v1/{parent=accounts/*}/cssProductInputs:insert" + body: "css_product_input" + }; + } + + // Deletes a CSS Product input from your CSS Center account. + // + // After a delete it may take several minutes until the input is no longer + // available. + rpc DeleteCssProductInput(DeleteCssProductInputRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=accounts/*/cssProductInputs/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// This resource represents input data you submit for a CSS Product, not +// the processed CSS Product that you see in CSS Center, in Shopping Ads, or +// across Google surfaces. +message CssProductInput { + option (google.api.resource) = { + type: "css.googleapis.com/CssProductInput" + pattern: "accounts/{account}/cssProductInputs/{css_product_input}" + }; + + // The name of the CSS Product input. + // Format: + // `accounts/{account}/cssProductInputs/{css_product_input}` + string name = 1; + + // Output only. The name of the processed CSS Product. + // Format: + // `accounts/{account}/cssProducts/{css_product}` + // " + string final_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Your unique identifier for the CSS Product. This is the same for + // the CSS Product input and processed CSS Product. We only allow ids with + // alphanumerics, underscores and dashes. See the [products feed + // specification](https://support.google.com/merchants/answer/188494#id) for + // details. + string raw_provided_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The two-letter [ISO + // 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the CSS + // Product. + string content_language = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [feed + // label](https://developers.google.com/shopping-content/guides/products/feed-labels) + // for the CSS Product. + // Feed Label is synonymous to "target country" and hence should always be a + // valid region code. For example: 'DE' for Germany, 'FR' for France. + string feed_label = 5 [(google.api.field_behavior) = REQUIRED]; + + // Represents the existing version (freshness) of the CSS Product, which + // can be used to preserve the right order when multiple updates are done at + // the same time. + // + // This field must not be set to the future time. + // + // If set, the update is prevented if a newer version of the item already + // exists in our system (that is the last update time of the existing + // CSS products is later than the freshness time set in the update). If + // the update happens, the last update time is then set to this freshness + // time. + // + // If not set, the update will not be prevented and the last update time will + // default to when this request was received by the CSS API. + // + // If the operation is prevented, the aborted exception will be + // thrown. + google.protobuf.Timestamp freshness_time = 6; + + // A list of CSS Product attributes. + Attributes attributes = 7; + + // A list of custom (CSS-provided) attributes. It can also be used for + // submitting any attribute of the feed specification in its generic + // form (for example: + // `{ "name": "size type", "value": "regular" }`). + // This is useful for submitting attributes not explicitly exposed by the + // API, such as additional attributes used for Buy on Google. + repeated google.shopping.type.CustomAttribute custom_attributes = 8; +} + +// Request message for the InsertCssProductInput method. +message InsertCssProductInputRequest { + // Required. The account where this CSS Product will be inserted. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "css.googleapis.com/CssProductInput" + } + ]; + + // Required. The CSS Product Input to insert. + CssProductInput css_product_input = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The primary or supplemental feed id. If CSS Product already + // exists and feed id provided is different, then the CSS Product will be + // moved to a new feed. Note: For now, CSSs do not need to provide feed ids as + // we create feeds on the fly. We do not have supplemental feed support for + // CSS Products yet. + int64 feed_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the DeleteCssProductInput method. +message DeleteCssProductInputRequest { + // Required. The name of the CSS product input resource to delete. + // Format: accounts/{account}/cssProductInputs/{css_product_input} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "css.googleapis.com/CssProductInput" + } + ]; + + // The Content API Supplemental Feed ID. + // The field must not be set if the action applies to a primary feed. + // If the field is set, then product action applies to a supplemental feed + // instead of primary Content API feed. + optional int64 supplemental_feed_id = 2; +} diff --git a/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_products.proto b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_products.proto new file mode 100644 index 000000000000..7c0076dd4729 --- /dev/null +++ b/java-shopping-css/proto-google-shopping-css-v1/src/main/proto/google/shopping/css/v1/css_products.proto @@ -0,0 +1,152 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.css.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/shopping/css/v1/css_product_common.proto"; +import "google/shopping/type/types.proto"; + +option csharp_namespace = "Google.Shopping.Css.V1"; +option go_package = "cloud.google.com/go/shopping/css/apiv1/csspb;csspb"; +option java_multiple_files = true; +option java_outer_classname = "CssProductsProto"; +option java_package = "com.google.shopping.css.v1"; +option php_namespace = "Google\\Shopping\\Css\\V1"; +option ruby_package = "Google::Shopping::Css::V1"; + +// Service for doing get and list on Css Products(a.k.a Aggregate Offers +// internally). +service CssProductsService { + option (google.api.default_host) = "css.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the processed CSS Product from your CSS Center account. After + // inserting, updating, or deleting a product input, it may take several + // minutes before the updated final product can be retrieved. + rpc GetCssProduct(GetCssProductRequest) returns (CssProduct) { + option (google.api.http) = { + get: "/v1/{name=accounts/*/cssProducts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the processed CSS Products in your CSS Center account. The response + // might contain fewer items than specified by pageSize. Rely on pageToken to + // determine if there are more items to be requested. + // + // After inserting, updating, or deleting a CSS product input, it may + // take several minutes before the updated processed CSS product can be + // retrieved. + rpc ListCssProducts(ListCssProductsRequest) + returns (ListCssProductsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accounts/*}/cssProducts" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The request message for the `GetCssProduct` method. +message GetCssProductRequest { + // Required. The name of the CSS product to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "css.googleapis.com/CssProduct" } + ]; +} + +// The processed CSS Product(a.k.a Aggregate Offer internally). +message CssProduct { + option (google.api.resource) = { + type: "css.googleapis.com/CssProduct" + pattern: "accounts/{account}/cssProducts/{css_product}" + plural: "cssProducts" + singular: "cssProduct" + }; + + // The name of the CSS Product. + // Format: + // `"accounts/{account}/cssProducts/{css_product}"` + string name = 1; + + // Output only. Your unique raw identifier for the product. + string raw_provided_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The two-letter [ISO + // 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the + // product. + string content_language = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The feed label for the product. + string feed_label = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of product attributes. + Attributes attributes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of custom (CSS-provided) attributes. It can also be + // used to submit any attribute of the feed specification in its generic form + // (for example, + // `{ "name": "size type", "value": "regular" }`). + // This is useful for submitting attributes not explicitly exposed by the + // API, such as additional attributes used for Buy on Google. + repeated google.shopping.type.CustomAttribute custom_attributes = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of a product, data validation issues, that is, + // information about a product computed asynchronously. + CssProductStatus css_product_status = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the ListCssProducts method. +message ListCssProductsRequest { + // Required. The account/domain to list processed CSS Products for. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "css.googleapis.com/CssProduct" + } + ]; + + // The maximum number of CSS Products 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 CSS products will be returned. + int32 page_size = 2; + + // A page token, received from a previous `ListCssProducts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCssProducts` + // must match the call that provided the page token. + string page_token = 3; +} + +// Response message for the ListCssProducts method. +message ListCssProductsResponse { + // The processed CSS products from the specified account. These are your + // processed CSS products after applying rules and supplemental feeds. + repeated CssProduct css_products = 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; +} diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..cdeb4ea0d745 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountLabelsServiceSettings; +import com.google.shopping.css.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 + AccountLabelsServiceSettings accountLabelsServiceSettings = + AccountLabelsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create(accountLabelsServiceSettings); + } +} +// [END css_v1_generated_AccountLabelsService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..7961115bf97b --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountLabelsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AccountLabelsServiceSettings accountLabelsServiceSettings = + AccountLabelsServiceSettings.newHttpJsonBuilder().build(); + AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create(accountLabelsServiceSettings); + } +} +// [END css_v1_generated_AccountLabelsService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetEndpoint.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..aa2f8d483446 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_Create_SetEndpoint_sync] +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountLabelsServiceSettings; +import com.google.shopping.css.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 + AccountLabelsServiceSettings accountLabelsServiceSettings = + AccountLabelsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create(accountLabelsServiceSettings); + } +} +// [END css_v1_generated_AccountLabelsService_Create_SetEndpoint_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/AsyncCreateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/AsyncCreateAccountLabel.java new file mode 100644 index 000000000000..030a5b34d387 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/AsyncCreateAccountLabel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_CreateAccountLabel_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CreateAccountLabelRequest; + +public class AsyncCreateAccountLabel { + + public static void main(String[] args) throws Exception { + asyncCreateAccountLabel(); + } + + public static void asyncCreateAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + CreateAccountLabelRequest request = + CreateAccountLabelRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setAccountLabel(AccountLabel.newBuilder().build()) + .build(); + ApiFuture future = + accountLabelsServiceClient.createAccountLabelCallable().futureCall(request); + // Do something. + AccountLabel response = future.get(); + } + } +} +// [END css_v1_generated_AccountLabelsService_CreateAccountLabel_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabel.java new file mode 100644 index 000000000000..9b63ee360b74 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabel.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_CreateAccountLabel_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CreateAccountLabelRequest; + +public class SyncCreateAccountLabel { + + public static void main(String[] args) throws Exception { + syncCreateAccountLabel(); + } + + public static void syncCreateAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + CreateAccountLabelRequest request = + CreateAccountLabelRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setAccountLabel(AccountLabel.newBuilder().build()) + .build(); + AccountLabel response = accountLabelsServiceClient.createAccountLabel(request); + } + } +} +// [END css_v1_generated_AccountLabelsService_CreateAccountLabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelAccountnameAccountlabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelAccountnameAccountlabel.java new file mode 100644 index 000000000000..856810f918dc --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelAccountnameAccountlabel.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_CreateAccountLabel_AccountnameAccountlabel_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; + +public class SyncCreateAccountLabelAccountnameAccountlabel { + + public static void main(String[] args) throws Exception { + syncCreateAccountLabelAccountnameAccountlabel(); + } + + public static void syncCreateAccountLabelAccountnameAccountlabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel); + } + } +} +// [END css_v1_generated_AccountLabelsService_CreateAccountLabel_AccountnameAccountlabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelStringAccountlabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelStringAccountlabel.java new file mode 100644 index 000000000000..e7522ba4315f --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/createaccountlabel/SyncCreateAccountLabelStringAccountlabel.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_CreateAccountLabel_StringAccountlabel_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; + +public class SyncCreateAccountLabelStringAccountlabel { + + public static void main(String[] args) throws Exception { + syncCreateAccountLabelStringAccountlabel(); + } + + public static void syncCreateAccountLabelStringAccountlabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + AccountLabel response = accountLabelsServiceClient.createAccountLabel(parent, accountLabel); + } + } +} +// [END css_v1_generated_AccountLabelsService_CreateAccountLabel_StringAccountlabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/AsyncDeleteAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/AsyncDeleteAccountLabel.java new file mode 100644 index 000000000000..1d87591026a6 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/AsyncDeleteAccountLabel.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_DeleteAccountLabel_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabelName; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; + +public class AsyncDeleteAccountLabel { + + public static void main(String[] args) throws Exception { + asyncDeleteAccountLabel(); + } + + public static void asyncDeleteAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + DeleteAccountLabelRequest request = + DeleteAccountLabelRequest.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .build(); + ApiFuture future = + accountLabelsServiceClient.deleteAccountLabelCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END css_v1_generated_AccountLabelsService_DeleteAccountLabel_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabel.java new file mode 100644 index 000000000000..2c0189757bca --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabel.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_DeleteAccountLabel_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabelName; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.DeleteAccountLabelRequest; + +public class SyncDeleteAccountLabel { + + public static void main(String[] args) throws Exception { + syncDeleteAccountLabel(); + } + + public static void syncDeleteAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + DeleteAccountLabelRequest request = + DeleteAccountLabelRequest.newBuilder() + .setName(AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString()) + .build(); + accountLabelsServiceClient.deleteAccountLabel(request); + } + } +} +// [END css_v1_generated_AccountLabelsService_DeleteAccountLabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelAccountlabelname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelAccountlabelname.java new file mode 100644 index 000000000000..6628d1aae973 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelAccountlabelname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_DeleteAccountLabel_Accountlabelname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabelName; +import com.google.shopping.css.v1.AccountLabelsServiceClient; + +public class SyncDeleteAccountLabelAccountlabelname { + + public static void main(String[] args) throws Exception { + syncDeleteAccountLabelAccountlabelname(); + } + + public static void syncDeleteAccountLabelAccountlabelname() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + AccountLabelName name = AccountLabelName.of("[ACCOUNT]", "[LABEL]"); + accountLabelsServiceClient.deleteAccountLabel(name); + } + } +} +// [END css_v1_generated_AccountLabelsService_DeleteAccountLabel_Accountlabelname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelString.java new file mode 100644 index 000000000000..fe4d1a3c9f19 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/deleteaccountlabel/SyncDeleteAccountLabelString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_DeleteAccountLabel_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.AccountLabelName; +import com.google.shopping.css.v1.AccountLabelsServiceClient; + +public class SyncDeleteAccountLabelString { + + public static void main(String[] args) throws Exception { + syncDeleteAccountLabelString(); + } + + public static void syncDeleteAccountLabelString() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + String name = AccountLabelName.of("[ACCOUNT]", "[LABEL]").toString(); + accountLabelsServiceClient.deleteAccountLabel(name); + } + } +} +// [END css_v1_generated_AccountLabelsService_DeleteAccountLabel_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabels.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabels.java new file mode 100644 index 000000000000..507e908db06f --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabels.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_ListAccountLabels_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.ListAccountLabelsRequest; + +public class AsyncListAccountLabels { + + public static void main(String[] args) throws Exception { + asyncListAccountLabels(); + } + + public static void asyncListAccountLabels() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + ListAccountLabelsRequest request = + ListAccountLabelsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + accountLabelsServiceClient.listAccountLabelsPagedCallable().futureCall(request); + // Do something. + for (AccountLabel element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountLabelsService_ListAccountLabels_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabelsPaged.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabelsPaged.java new file mode 100644 index 000000000000..76ffcb3d02fc --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/AsyncListAccountLabelsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_ListAccountLabels_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.ListAccountLabelsRequest; +import com.google.shopping.css.v1.ListAccountLabelsResponse; + +public class AsyncListAccountLabelsPaged { + + public static void main(String[] args) throws Exception { + asyncListAccountLabelsPaged(); + } + + public static void asyncListAccountLabelsPaged() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + ListAccountLabelsRequest request = + ListAccountLabelsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAccountLabelsResponse response = + accountLabelsServiceClient.listAccountLabelsCallable().call(request); + for (AccountLabel element : response.getAccountLabelsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END css_v1_generated_AccountLabelsService_ListAccountLabels_Paged_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabels.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabels.java new file mode 100644 index 000000000000..698cf6d48afb --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabels.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_ListAccountLabels_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.ListAccountLabelsRequest; + +public class SyncListAccountLabels { + + public static void main(String[] args) throws Exception { + syncListAccountLabels(); + } + + public static void syncListAccountLabels() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + ListAccountLabelsRequest request = + ListAccountLabelsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (AccountLabel element : + accountLabelsServiceClient.listAccountLabels(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountLabelsService_ListAccountLabels_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsAccountname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsAccountname.java new file mode 100644 index 000000000000..f0fbecfd517c --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsAccountname.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_ListAccountLabels_Accountname_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; + +public class SyncListAccountLabelsAccountname { + + public static void main(String[] args) throws Exception { + syncListAccountLabelsAccountname(); + } + + public static void syncListAccountLabelsAccountname() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (AccountLabel element : + accountLabelsServiceClient.listAccountLabels(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountLabelsService_ListAccountLabels_Accountname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsString.java new file mode 100644 index 000000000000..e57cf72020c1 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/listaccountlabels/SyncListAccountLabelsString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_ListAccountLabels_String_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.AccountName; + +public class SyncListAccountLabelsString { + + public static void main(String[] args) throws Exception { + syncListAccountLabelsString(); + } + + public static void syncListAccountLabelsString() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (AccountLabel element : + accountLabelsServiceClient.listAccountLabels(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountLabelsService_ListAccountLabels_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/AsyncUpdateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/AsyncUpdateAccountLabel.java new file mode 100644 index 000000000000..c46c9db90cda --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/AsyncUpdateAccountLabel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_UpdateAccountLabel_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; + +public class AsyncUpdateAccountLabel { + + public static void main(String[] args) throws Exception { + asyncUpdateAccountLabel(); + } + + public static void asyncUpdateAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + UpdateAccountLabelRequest request = + UpdateAccountLabelRequest.newBuilder() + .setAccountLabel(AccountLabel.newBuilder().build()) + .build(); + ApiFuture future = + accountLabelsServiceClient.updateAccountLabelCallable().futureCall(request); + // Do something. + AccountLabel response = future.get(); + } + } +} +// [END css_v1_generated_AccountLabelsService_UpdateAccountLabel_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabel.java new file mode 100644 index 000000000000..1c29640526e1 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabel.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_UpdateAccountLabel_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; +import com.google.shopping.css.v1.UpdateAccountLabelRequest; + +public class SyncUpdateAccountLabel { + + public static void main(String[] args) throws Exception { + syncUpdateAccountLabel(); + } + + public static void syncUpdateAccountLabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + UpdateAccountLabelRequest request = + UpdateAccountLabelRequest.newBuilder() + .setAccountLabel(AccountLabel.newBuilder().build()) + .build(); + AccountLabel response = accountLabelsServiceClient.updateAccountLabel(request); + } + } +} +// [END css_v1_generated_AccountLabelsService_UpdateAccountLabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabelAccountlabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabelAccountlabel.java new file mode 100644 index 000000000000..77b1de79b3d9 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservice/updateaccountlabel/SyncUpdateAccountLabelAccountlabel.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsService_UpdateAccountLabel_Accountlabel_sync] +import com.google.shopping.css.v1.AccountLabel; +import com.google.shopping.css.v1.AccountLabelsServiceClient; + +public class SyncUpdateAccountLabelAccountlabel { + + public static void main(String[] args) throws Exception { + syncUpdateAccountLabelAccountlabel(); + } + + public static void syncUpdateAccountLabelAccountlabel() 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 (AccountLabelsServiceClient accountLabelsServiceClient = + AccountLabelsServiceClient.create()) { + AccountLabel accountLabel = AccountLabel.newBuilder().build(); + AccountLabel response = accountLabelsServiceClient.updateAccountLabel(accountLabel); + } + } +} +// [END css_v1_generated_AccountLabelsService_UpdateAccountLabel_Accountlabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservicesettings/createaccountlabel/SyncCreateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservicesettings/createaccountlabel/SyncCreateAccountLabel.java new file mode 100644 index 000000000000..78ea96ca2927 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountlabelsservicesettings/createaccountlabel/SyncCreateAccountLabel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountLabelsServiceSettings_CreateAccountLabel_sync] +import com.google.shopping.css.v1.AccountLabelsServiceSettings; +import java.time.Duration; + +public class SyncCreateAccountLabel { + + public static void main(String[] args) throws Exception { + syncCreateAccountLabel(); + } + + public static void syncCreateAccountLabel() 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 + AccountLabelsServiceSettings.Builder accountLabelsServiceSettingsBuilder = + AccountLabelsServiceSettings.newBuilder(); + accountLabelsServiceSettingsBuilder + .createAccountLabelSettings() + .setRetrySettings( + accountLabelsServiceSettingsBuilder + .createAccountLabelSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AccountLabelsServiceSettings accountLabelsServiceSettings = + accountLabelsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_AccountLabelsServiceSettings_CreateAccountLabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..cc67cc0238d6 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.AccountsServiceSettings; +import com.google.shopping.css.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 + AccountsServiceSettings accountsServiceSettings = + AccountsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AccountsServiceClient accountsServiceClient = + AccountsServiceClient.create(accountsServiceSettings); + } +} +// [END css_v1_generated_AccountsService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..76d816d9f3ea --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.AccountsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AccountsServiceSettings accountsServiceSettings = + AccountsServiceSettings.newHttpJsonBuilder().build(); + AccountsServiceClient accountsServiceClient = + AccountsServiceClient.create(accountsServiceSettings); + } +} +// [END css_v1_generated_AccountsService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetEndpoint.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4e6e924e2aa8 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_Create_SetEndpoint_sync] +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.AccountsServiceSettings; +import com.google.shopping.css.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 + AccountsServiceSettings accountsServiceSettings = + AccountsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AccountsServiceClient accountsServiceClient = + AccountsServiceClient.create(accountsServiceSettings); + } +} +// [END css_v1_generated_AccountsService_Create_SetEndpoint_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/AsyncGetAccount.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/AsyncGetAccount.java new file mode 100644 index 000000000000..78282a45642c --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/AsyncGetAccount.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_GetAccount_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.GetAccountRequest; + +public class AsyncGetAccount { + + public static void main(String[] args) throws Exception { + asyncGetAccount(); + } + + public static void asyncGetAccount() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + GetAccountRequest request = + GetAccountRequest.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setParent(AccountName.of("[ACCOUNT]").toString()) + .build(); + ApiFuture future = accountsServiceClient.getAccountCallable().futureCall(request); + // Do something. + Account response = future.get(); + } + } +} +// [END css_v1_generated_AccountsService_GetAccount_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccount.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccount.java new file mode 100644 index 000000000000..a90cee2d3cd9 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccount.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_GetAccount_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.GetAccountRequest; + +public class SyncGetAccount { + + public static void main(String[] args) throws Exception { + syncGetAccount(); + } + + public static void syncGetAccount() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + GetAccountRequest request = + GetAccountRequest.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .setParent(AccountName.of("[ACCOUNT]").toString()) + .build(); + Account response = accountsServiceClient.getAccount(request); + } + } +} +// [END css_v1_generated_AccountsService_GetAccount_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountAccountname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountAccountname.java new file mode 100644 index 000000000000..265aaa9afee1 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountAccountname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_GetAccount_Accountname_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncGetAccountAccountname { + + public static void main(String[] args) throws Exception { + syncGetAccountAccountname(); + } + + public static void syncGetAccountAccountname() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + AccountName name = AccountName.of("[ACCOUNT]"); + Account response = accountsServiceClient.getAccount(name); + } + } +} +// [END css_v1_generated_AccountsService_GetAccount_Accountname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountString.java new file mode 100644 index 000000000000..9999e61cf80f --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/getaccount/SyncGetAccountString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_GetAccount_String_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncGetAccountString { + + public static void main(String[] args) throws Exception { + syncGetAccountString(); + } + + public static void syncGetAccountString() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + String name = AccountName.of("[ACCOUNT]").toString(); + Account response = accountsServiceClient.getAccount(name); + } + } +} +// [END css_v1_generated_AccountsService_GetAccount_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccounts.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccounts.java new file mode 100644 index 000000000000..5a64a9900723 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccounts.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_ListChildAccounts_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.ListChildAccountsRequest; + +public class AsyncListChildAccounts { + + public static void main(String[] args) throws Exception { + asyncListChildAccounts(); + } + + public static void asyncListChildAccounts() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + ListChildAccountsRequest request = + ListChildAccountsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setLabelId(-1959256506) + .setFullName("fullName1330852282") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + accountsServiceClient.listChildAccountsPagedCallable().futureCall(request); + // Do something. + for (Account element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountsService_ListChildAccounts_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccountsPaged.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccountsPaged.java new file mode 100644 index 000000000000..3fcb3bec34cf --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/AsyncListChildAccountsPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_ListChildAccounts_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.ListChildAccountsRequest; +import com.google.shopping.css.v1.ListChildAccountsResponse; + +public class AsyncListChildAccountsPaged { + + public static void main(String[] args) throws Exception { + asyncListChildAccountsPaged(); + } + + public static void asyncListChildAccountsPaged() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + ListChildAccountsRequest request = + ListChildAccountsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setLabelId(-1959256506) + .setFullName("fullName1330852282") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListChildAccountsResponse response = + accountsServiceClient.listChildAccountsCallable().call(request); + for (Account element : response.getAccountsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END css_v1_generated_AccountsService_ListChildAccounts_Paged_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccounts.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccounts.java new file mode 100644 index 000000000000..f26d9f072561 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccounts.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_ListChildAccounts_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.ListChildAccountsRequest; + +public class SyncListChildAccounts { + + public static void main(String[] args) throws Exception { + syncListChildAccounts(); + } + + public static void syncListChildAccounts() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + ListChildAccountsRequest request = + ListChildAccountsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setLabelId(-1959256506) + .setFullName("fullName1330852282") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Account element : accountsServiceClient.listChildAccounts(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountsService_ListChildAccounts_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsAccountname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsAccountname.java new file mode 100644 index 000000000000..6f6431c21a51 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsAccountname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_ListChildAccounts_Accountname_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncListChildAccountsAccountname { + + public static void main(String[] args) throws Exception { + syncListChildAccountsAccountname(); + } + + public static void syncListChildAccountsAccountname() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (Account element : accountsServiceClient.listChildAccounts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountsService_ListChildAccounts_Accountname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsString.java new file mode 100644 index 000000000000..d70cc541bf56 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/listchildaccounts/SyncListChildAccountsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_ListChildAccounts_String_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncListChildAccountsString { + + public static void main(String[] args) throws Exception { + syncListChildAccountsString(); + } + + public static void syncListChildAccountsString() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (Account element : accountsServiceClient.listChildAccounts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_AccountsService_ListChildAccounts_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/AsyncUpdateLabels.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/AsyncUpdateLabels.java new file mode 100644 index 000000000000..bcd48eaca045 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/AsyncUpdateLabels.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_UpdateLabels_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +import java.util.ArrayList; + +public class AsyncUpdateLabels { + + public static void main(String[] args) throws Exception { + asyncUpdateLabels(); + } + + public static void asyncUpdateLabels() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + UpdateAccountLabelsRequest request = + UpdateAccountLabelsRequest.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .addAllLabelIds(new ArrayList()) + .setParent(AccountName.of("[ACCOUNT]").toString()) + .build(); + ApiFuture future = accountsServiceClient.updateLabelsCallable().futureCall(request); + // Do something. + Account response = future.get(); + } + } +} +// [END css_v1_generated_AccountsService_UpdateLabels_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabels.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabels.java new file mode 100644 index 000000000000..63680858afec --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabels.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_UpdateLabels_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; +import com.google.shopping.css.v1.UpdateAccountLabelsRequest; +import java.util.ArrayList; + +public class SyncUpdateLabels { + + public static void main(String[] args) throws Exception { + syncUpdateLabels(); + } + + public static void syncUpdateLabels() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + UpdateAccountLabelsRequest request = + UpdateAccountLabelsRequest.newBuilder() + .setName(AccountName.of("[ACCOUNT]").toString()) + .addAllLabelIds(new ArrayList()) + .setParent(AccountName.of("[ACCOUNT]").toString()) + .build(); + Account response = accountsServiceClient.updateLabels(request); + } + } +} +// [END css_v1_generated_AccountsService_UpdateLabels_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsAccountname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsAccountname.java new file mode 100644 index 000000000000..1def37633941 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsAccountname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_UpdateLabels_Accountname_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncUpdateLabelsAccountname { + + public static void main(String[] args) throws Exception { + syncUpdateLabelsAccountname(); + } + + public static void syncUpdateLabelsAccountname() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + AccountName name = AccountName.of("[ACCOUNT]"); + Account response = accountsServiceClient.updateLabels(name); + } + } +} +// [END css_v1_generated_AccountsService_UpdateLabels_Accountname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsString.java new file mode 100644 index 000000000000..99729ec6f065 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservice/updatelabels/SyncUpdateLabelsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsService_UpdateLabels_String_sync] +import com.google.shopping.css.v1.Account; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.AccountsServiceClient; + +public class SyncUpdateLabelsString { + + public static void main(String[] args) throws Exception { + syncUpdateLabelsString(); + } + + public static void syncUpdateLabelsString() 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 (AccountsServiceClient accountsServiceClient = AccountsServiceClient.create()) { + String name = AccountName.of("[ACCOUNT]").toString(); + Account response = accountsServiceClient.updateLabels(name); + } + } +} +// [END css_v1_generated_AccountsService_UpdateLabels_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservicesettings/getaccount/SyncGetAccount.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservicesettings/getaccount/SyncGetAccount.java new file mode 100644 index 000000000000..6979fd2eb669 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/accountsservicesettings/getaccount/SyncGetAccount.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_AccountsServiceSettings_GetAccount_sync] +import com.google.shopping.css.v1.AccountsServiceSettings; +import java.time.Duration; + +public class SyncGetAccount { + + public static void main(String[] args) throws Exception { + syncGetAccount(); + } + + public static void syncGetAccount() 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 + AccountsServiceSettings.Builder accountsServiceSettingsBuilder = + AccountsServiceSettings.newBuilder(); + accountsServiceSettingsBuilder + .getAccountSettings() + .setRetrySettings( + accountsServiceSettingsBuilder + .getAccountSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AccountsServiceSettings accountsServiceSettings = accountsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_AccountsServiceSettings_GetAccount_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ba39e3e30748 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.CssProductInputsServiceSettings; +import com.google.shopping.css.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 + CssProductInputsServiceSettings cssProductInputsServiceSettings = + CssProductInputsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create(cssProductInputsServiceSettings); + } +} +// [END css_v1_generated_CssProductInputsService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..844d41781f2a --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.CssProductInputsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CssProductInputsServiceSettings cssProductInputsServiceSettings = + CssProductInputsServiceSettings.newHttpJsonBuilder().build(); + CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create(cssProductInputsServiceSettings); + } +} +// [END css_v1_generated_CssProductInputsService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetEndpoint.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..47b6a3e7e7fb --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_Create_SetEndpoint_sync] +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.CssProductInputsServiceSettings; +import com.google.shopping.css.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 + CssProductInputsServiceSettings cssProductInputsServiceSettings = + CssProductInputsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create(cssProductInputsServiceSettings); + } +} +// [END css_v1_generated_CssProductInputsService_Create_SetEndpoint_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/AsyncDeleteCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/AsyncDeleteCssProductInput.java new file mode 100644 index 000000000000..7cc0e5024638 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/AsyncDeleteCssProductInput.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_DeleteCssProductInput_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInputName; +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; + +public class AsyncDeleteCssProductInput { + + public static void main(String[] args) throws Exception { + asyncDeleteCssProductInput(); + } + + public static void asyncDeleteCssProductInput() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + DeleteCssProductInputRequest request = + DeleteCssProductInputRequest.newBuilder() + .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString()) + .setSupplementalFeedId(1845271745) + .build(); + ApiFuture future = + cssProductInputsServiceClient.deleteCssProductInputCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END css_v1_generated_CssProductInputsService_DeleteCssProductInput_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInput.java new file mode 100644 index 000000000000..c0d7e9817629 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInput.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_DeleteCssProductInput_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInputName; +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.DeleteCssProductInputRequest; + +public class SyncDeleteCssProductInput { + + public static void main(String[] args) throws Exception { + syncDeleteCssProductInput(); + } + + public static void syncDeleteCssProductInput() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + DeleteCssProductInputRequest request = + DeleteCssProductInputRequest.newBuilder() + .setName(CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString()) + .setSupplementalFeedId(1845271745) + .build(); + cssProductInputsServiceClient.deleteCssProductInput(request); + } + } +} +// [END css_v1_generated_CssProductInputsService_DeleteCssProductInput_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputCssproductinputname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputCssproductinputname.java new file mode 100644 index 000000000000..cecc2c53a583 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputCssproductinputname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_DeleteCssProductInput_Cssproductinputname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInputName; +import com.google.shopping.css.v1.CssProductInputsServiceClient; + +public class SyncDeleteCssProductInputCssproductinputname { + + public static void main(String[] args) throws Exception { + syncDeleteCssProductInputCssproductinputname(); + } + + public static void syncDeleteCssProductInputCssproductinputname() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + CssProductInputName name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]"); + cssProductInputsServiceClient.deleteCssProductInput(name); + } + } +} +// [END css_v1_generated_CssProductInputsService_DeleteCssProductInput_Cssproductinputname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputString.java new file mode 100644 index 000000000000..1e0205866a36 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/deletecssproductinput/SyncDeleteCssProductInputString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_DeleteCssProductInput_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.css.v1.CssProductInputName; +import com.google.shopping.css.v1.CssProductInputsServiceClient; + +public class SyncDeleteCssProductInputString { + + public static void main(String[] args) throws Exception { + syncDeleteCssProductInputString(); + } + + public static void syncDeleteCssProductInputString() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + String name = CssProductInputName.of("[ACCOUNT]", "[CSS_PRODUCT_INPUT]").toString(); + cssProductInputsServiceClient.deleteCssProductInput(name); + } + } +} +// [END css_v1_generated_CssProductInputsService_DeleteCssProductInput_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/AsyncInsertCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/AsyncInsertCssProductInput.java new file mode 100644 index 000000000000..cb8d262b1ce3 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/AsyncInsertCssProductInput.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_InsertCssProductInput_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.InsertCssProductInputRequest; + +public class AsyncInsertCssProductInput { + + public static void main(String[] args) throws Exception { + asyncInsertCssProductInput(); + } + + public static void asyncInsertCssProductInput() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + ApiFuture future = + cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request); + // Do something. + CssProductInput response = future.get(); + } + } +} +// [END css_v1_generated_CssProductInputsService_InsertCssProductInput_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/SyncInsertCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/SyncInsertCssProductInput.java new file mode 100644 index 000000000000..acd53c11aef6 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservice/insertcssproductinput/SyncInsertCssProductInput.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsService_InsertCssProductInput_sync] +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProductInput; +import com.google.shopping.css.v1.CssProductInputsServiceClient; +import com.google.shopping.css.v1.InsertCssProductInputRequest; + +public class SyncInsertCssProductInput { + + public static void main(String[] args) throws Exception { + syncInsertCssProductInput(); + } + + public static void syncInsertCssProductInput() 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 (CssProductInputsServiceClient cssProductInputsServiceClient = + CssProductInputsServiceClient.create()) { + InsertCssProductInputRequest request = + InsertCssProductInputRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setCssProductInput(CssProductInput.newBuilder().build()) + .setFeedId(-976011428) + .build(); + CssProductInput response = cssProductInputsServiceClient.insertCssProductInput(request); + } + } +} +// [END css_v1_generated_CssProductInputsService_InsertCssProductInput_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservicesettings/insertcssproductinput/SyncInsertCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservicesettings/insertcssproductinput/SyncInsertCssProductInput.java new file mode 100644 index 000000000000..7302dd20c30d --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductinputsservicesettings/insertcssproductinput/SyncInsertCssProductInput.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductInputsServiceSettings_InsertCssProductInput_sync] +import com.google.shopping.css.v1.CssProductInputsServiceSettings; +import java.time.Duration; + +public class SyncInsertCssProductInput { + + public static void main(String[] args) throws Exception { + syncInsertCssProductInput(); + } + + public static void syncInsertCssProductInput() 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 + CssProductInputsServiceSettings.Builder cssProductInputsServiceSettingsBuilder = + CssProductInputsServiceSettings.newBuilder(); + cssProductInputsServiceSettingsBuilder + .insertCssProductInputSettings() + .setRetrySettings( + cssProductInputsServiceSettingsBuilder + .insertCssProductInputSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CssProductInputsServiceSettings cssProductInputsServiceSettings = + cssProductInputsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_CssProductInputsServiceSettings_InsertCssProductInput_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7024298c76b2 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.CssProductsServiceSettings; +import com.google.shopping.css.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 + CssProductsServiceSettings cssProductsServiceSettings = + CssProductsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CssProductsServiceClient cssProductsServiceClient = + CssProductsServiceClient.create(cssProductsServiceSettings); + } +} +// [END css_v1_generated_CssProductsService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..dc7a83fb7b0c --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.CssProductsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CssProductsServiceSettings cssProductsServiceSettings = + CssProductsServiceSettings.newHttpJsonBuilder().build(); + CssProductsServiceClient cssProductsServiceClient = + CssProductsServiceClient.create(cssProductsServiceSettings); + } +} +// [END css_v1_generated_CssProductsService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetEndpoint.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a79185925dbb --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_Create_SetEndpoint_sync] +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.CssProductsServiceSettings; +import com.google.shopping.css.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 + CssProductsServiceSettings cssProductsServiceSettings = + CssProductsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + CssProductsServiceClient cssProductsServiceClient = + CssProductsServiceClient.create(cssProductsServiceSettings); + } +} +// [END css_v1_generated_CssProductsService_Create_SetEndpoint_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/AsyncGetCssProduct.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/AsyncGetCssProduct.java new file mode 100644 index 000000000000..48ce8e4a02a7 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/AsyncGetCssProduct.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_GetCssProduct_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductName; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.GetCssProductRequest; + +public class AsyncGetCssProduct { + + public static void main(String[] args) throws Exception { + asyncGetCssProduct(); + } + + public static void asyncGetCssProduct() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + GetCssProductRequest request = + GetCssProductRequest.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .build(); + ApiFuture future = + cssProductsServiceClient.getCssProductCallable().futureCall(request); + // Do something. + CssProduct response = future.get(); + } + } +} +// [END css_v1_generated_CssProductsService_GetCssProduct_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProduct.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProduct.java new file mode 100644 index 000000000000..93e176f91cf4 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProduct.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_GetCssProduct_sync] +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductName; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.GetCssProductRequest; + +public class SyncGetCssProduct { + + public static void main(String[] args) throws Exception { + syncGetCssProduct(); + } + + public static void syncGetCssProduct() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + GetCssProductRequest request = + GetCssProductRequest.newBuilder() + .setName(CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString()) + .build(); + CssProduct response = cssProductsServiceClient.getCssProduct(request); + } + } +} +// [END css_v1_generated_CssProductsService_GetCssProduct_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductCssproductname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductCssproductname.java new file mode 100644 index 000000000000..5f0d20f5790b --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductCssproductname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_GetCssProduct_Cssproductname_sync] +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductName; +import com.google.shopping.css.v1.CssProductsServiceClient; + +public class SyncGetCssProductCssproductname { + + public static void main(String[] args) throws Exception { + syncGetCssProductCssproductname(); + } + + public static void syncGetCssProductCssproductname() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + CssProductName name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]"); + CssProduct response = cssProductsServiceClient.getCssProduct(name); + } + } +} +// [END css_v1_generated_CssProductsService_GetCssProduct_Cssproductname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductString.java new file mode 100644 index 000000000000..db15e2c98ca7 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/getcssproduct/SyncGetCssProductString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_GetCssProduct_String_sync] +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductName; +import com.google.shopping.css.v1.CssProductsServiceClient; + +public class SyncGetCssProductString { + + public static void main(String[] args) throws Exception { + syncGetCssProductString(); + } + + public static void syncGetCssProductString() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + String name = CssProductName.of("[ACCOUNT]", "[CSS_PRODUCT]").toString(); + CssProduct response = cssProductsServiceClient.getCssProduct(name); + } + } +} +// [END css_v1_generated_CssProductsService_GetCssProduct_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProducts.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProducts.java new file mode 100644 index 000000000000..20e44dbb1960 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProducts.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_ListCssProducts_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.ListCssProductsRequest; + +public class AsyncListCssProducts { + + public static void main(String[] args) throws Exception { + asyncListCssProducts(); + } + + public static void asyncListCssProducts() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + ListCssProductsRequest request = + ListCssProductsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cssProductsServiceClient.listCssProductsPagedCallable().futureCall(request); + // Do something. + for (CssProduct element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_CssProductsService_ListCssProducts_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProductsPaged.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProductsPaged.java new file mode 100644 index 000000000000..e608a08843c9 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/AsyncListCssProductsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_ListCssProducts_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.ListCssProductsRequest; +import com.google.shopping.css.v1.ListCssProductsResponse; + +public class AsyncListCssProductsPaged { + + public static void main(String[] args) throws Exception { + asyncListCssProductsPaged(); + } + + public static void asyncListCssProductsPaged() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + ListCssProductsRequest request = + ListCssProductsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListCssProductsResponse response = + cssProductsServiceClient.listCssProductsCallable().call(request); + for (CssProduct element : response.getCssProductsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END css_v1_generated_CssProductsService_ListCssProducts_Paged_async] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProducts.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProducts.java new file mode 100644 index 000000000000..0e1ac7c97826 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProducts.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_ListCssProducts_sync] +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductsServiceClient; +import com.google.shopping.css.v1.ListCssProductsRequest; + +public class SyncListCssProducts { + + public static void main(String[] args) throws Exception { + syncListCssProducts(); + } + + public static void syncListCssProducts() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + ListCssProductsRequest request = + ListCssProductsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (CssProduct element : cssProductsServiceClient.listCssProducts(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_CssProductsService_ListCssProducts_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsAccountname.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsAccountname.java new file mode 100644 index 000000000000..145cb408943e --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsAccountname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_ListCssProducts_Accountname_sync] +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductsServiceClient; + +public class SyncListCssProductsAccountname { + + public static void main(String[] args) throws Exception { + syncListCssProductsAccountname(); + } + + public static void syncListCssProductsAccountname() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (CssProduct element : cssProductsServiceClient.listCssProducts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_CssProductsService_ListCssProducts_Accountname_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsString.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsString.java new file mode 100644 index 000000000000..42e826f87251 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservice/listcssproducts/SyncListCssProductsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsService_ListCssProducts_String_sync] +import com.google.shopping.css.v1.AccountName; +import com.google.shopping.css.v1.CssProduct; +import com.google.shopping.css.v1.CssProductsServiceClient; + +public class SyncListCssProductsString { + + public static void main(String[] args) throws Exception { + syncListCssProductsString(); + } + + public static void syncListCssProductsString() 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 (CssProductsServiceClient cssProductsServiceClient = CssProductsServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (CssProduct element : cssProductsServiceClient.listCssProducts(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END css_v1_generated_CssProductsService_ListCssProducts_String_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservicesettings/getcssproduct/SyncGetCssProduct.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservicesettings/getcssproduct/SyncGetCssProduct.java new file mode 100644 index 000000000000..93e186569d70 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/cssproductsservicesettings/getcssproduct/SyncGetCssProduct.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.samples; + +// [START css_v1_generated_CssProductsServiceSettings_GetCssProduct_sync] +import com.google.shopping.css.v1.CssProductsServiceSettings; +import java.time.Duration; + +public class SyncGetCssProduct { + + public static void main(String[] args) throws Exception { + syncGetCssProduct(); + } + + public static void syncGetCssProduct() 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 + CssProductsServiceSettings.Builder cssProductsServiceSettingsBuilder = + CssProductsServiceSettings.newBuilder(); + cssProductsServiceSettingsBuilder + .getCssProductSettings() + .setRetrySettings( + cssProductsServiceSettingsBuilder + .getCssProductSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CssProductsServiceSettings cssProductsServiceSettings = + cssProductsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_CssProductsServiceSettings_GetCssProduct_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountlabelsservicestubsettings/createaccountlabel/SyncCreateAccountLabel.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountlabelsservicestubsettings/createaccountlabel/SyncCreateAccountLabel.java new file mode 100644 index 000000000000..37be8e752974 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountlabelsservicestubsettings/createaccountlabel/SyncCreateAccountLabel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub.samples; + +// [START css_v1_generated_AccountLabelsServiceStubSettings_CreateAccountLabel_sync] +import com.google.shopping.css.v1.stub.AccountLabelsServiceStubSettings; +import java.time.Duration; + +public class SyncCreateAccountLabel { + + public static void main(String[] args) throws Exception { + syncCreateAccountLabel(); + } + + public static void syncCreateAccountLabel() 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 + AccountLabelsServiceStubSettings.Builder accountLabelsServiceSettingsBuilder = + AccountLabelsServiceStubSettings.newBuilder(); + accountLabelsServiceSettingsBuilder + .createAccountLabelSettings() + .setRetrySettings( + accountLabelsServiceSettingsBuilder + .createAccountLabelSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AccountLabelsServiceStubSettings accountLabelsServiceSettings = + accountLabelsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_AccountLabelsServiceStubSettings_CreateAccountLabel_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountsservicestubsettings/getaccount/SyncGetAccount.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountsservicestubsettings/getaccount/SyncGetAccount.java new file mode 100644 index 000000000000..b215b3154644 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/accountsservicestubsettings/getaccount/SyncGetAccount.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub.samples; + +// [START css_v1_generated_AccountsServiceStubSettings_GetAccount_sync] +import com.google.shopping.css.v1.stub.AccountsServiceStubSettings; +import java.time.Duration; + +public class SyncGetAccount { + + public static void main(String[] args) throws Exception { + syncGetAccount(); + } + + public static void syncGetAccount() 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 + AccountsServiceStubSettings.Builder accountsServiceSettingsBuilder = + AccountsServiceStubSettings.newBuilder(); + accountsServiceSettingsBuilder + .getAccountSettings() + .setRetrySettings( + accountsServiceSettingsBuilder + .getAccountSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AccountsServiceStubSettings accountsServiceSettings = accountsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_AccountsServiceStubSettings_GetAccount_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductinputsservicestubsettings/insertcssproductinput/SyncInsertCssProductInput.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductinputsservicestubsettings/insertcssproductinput/SyncInsertCssProductInput.java new file mode 100644 index 000000000000..227ca5ebd974 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductinputsservicestubsettings/insertcssproductinput/SyncInsertCssProductInput.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub.samples; + +// [START css_v1_generated_CssProductInputsServiceStubSettings_InsertCssProductInput_sync] +import com.google.shopping.css.v1.stub.CssProductInputsServiceStubSettings; +import java.time.Duration; + +public class SyncInsertCssProductInput { + + public static void main(String[] args) throws Exception { + syncInsertCssProductInput(); + } + + public static void syncInsertCssProductInput() 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 + CssProductInputsServiceStubSettings.Builder cssProductInputsServiceSettingsBuilder = + CssProductInputsServiceStubSettings.newBuilder(); + cssProductInputsServiceSettingsBuilder + .insertCssProductInputSettings() + .setRetrySettings( + cssProductInputsServiceSettingsBuilder + .insertCssProductInputSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CssProductInputsServiceStubSettings cssProductInputsServiceSettings = + cssProductInputsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_CssProductInputsServiceStubSettings_InsertCssProductInput_sync] diff --git a/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductsservicestubsettings/getcssproduct/SyncGetCssProduct.java b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductsservicestubsettings/getcssproduct/SyncGetCssProduct.java new file mode 100644 index 000000000000..7469288b7116 --- /dev/null +++ b/java-shopping-css/samples/snippets/generated/com/google/shopping/css/v1/stub/cssproductsservicestubsettings/getcssproduct/SyncGetCssProduct.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.css.v1.stub.samples; + +// [START css_v1_generated_CssProductsServiceStubSettings_GetCssProduct_sync] +import com.google.shopping.css.v1.stub.CssProductsServiceStubSettings; +import java.time.Duration; + +public class SyncGetCssProduct { + + public static void main(String[] args) throws Exception { + syncGetCssProduct(); + } + + public static void syncGetCssProduct() 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 + CssProductsServiceStubSettings.Builder cssProductsServiceSettingsBuilder = + CssProductsServiceStubSettings.newBuilder(); + cssProductsServiceSettingsBuilder + .getCssProductSettings() + .setRetrySettings( + cssProductsServiceSettingsBuilder + .getCssProductSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CssProductsServiceStubSettings cssProductsServiceSettings = + cssProductsServiceSettingsBuilder.build(); + } +} +// [END css_v1_generated_CssProductsServiceStubSettings_GetCssProduct_sync] diff --git a/pom.xml b/pom.xml index 87dd51d37b71..e37a24107c22 100644 --- a/pom.xml +++ b/pom.xml @@ -157,6 +157,7 @@ java-service-management java-service-usage java-shell + java-shopping-css java-shopping-merchant-inventories java-shopping-merchant-reports java-speech diff --git a/versions.txt b/versions.txt index 80b7d58a05a7..c40152b986bf 100644 --- a/versions.txt +++ b/versions.txt @@ -715,4 +715,7 @@ proto-google-cloud-cloudquotas-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-cloudquotas-v1:0.0.0:0.0.1-SNAPSHOT google-cloud-securitycentermanagement:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-securitycentermanagement-v1:0.0.0:0.0.1-SNAPSHOT -grpc-google-cloud-securitycentermanagement-v1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file +grpc-google-cloud-securitycentermanagement-v1:0.0.0:0.0.1-SNAPSHOT +google-shopping-css:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-css-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-shopping-css-v1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file