README.md
1# Google Recommendations AI Client for Java
2
3Java idiomatic client for [Recommendations AI][product-docs].
4
5[![Maven][maven-version-image]][maven-version-link]
6![Stability][stability-image]
7
8- [Product Documentation][product-docs]
9- [Client Library Documentation][javadocs]
10> This repo contains beta version of Recommendations AI and may occasionally
11> make backwards-incompatible changes.
12> Recommendations AI is now GA and available as
13> [Google Cloud Retail](https://github.com/googleapis/java-retail)
14
15
16## Quickstart
17
18
19If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
20
21```xml
22<dependencyManagement>
23 <dependencies>
24 <dependency>
25 <groupId>com.google.cloud</groupId>
26 <artifactId>libraries-bom</artifactId>
27 <version>26.11.0</version>
28 <type>pom</type>
29 <scope>import</scope>
30 </dependency>
31 </dependencies>
32</dependencyManagement>
33
34<dependencies>
35 <dependency>
36 <groupId>com.google.cloud</groupId>
37 <artifactId>google-cloud-recommendations-ai</artifactId>
38 </dependency>
39```
40
41If you are using Maven without the BOM, add this to your dependencies:
42
43<!-- {x-version-update-start:google-cloud-recommendations-ai:released} -->
44
45```xml
46<dependency>
47 <groupId>com.google.cloud</groupId>
48 <artifactId>google-cloud-recommendations-ai</artifactId>
49 <version>0.24.0</version>
50</dependency>
51```
52
53If you are using Gradle without BOM, add this to your dependencies:
54
55```Groovy
56implementation 'com.google.cloud:google-cloud-recommendations-ai:0.24.0'
57```
58
59If you are using SBT, add this to your dependencies:
60
61```Scala
62libraryDependencies += "com.google.cloud" % "google-cloud-recommendations-ai" % "0.24.0"
63```
64<!-- {x-version-update-end} -->
65
66## Authentication
67
68See the [Authentication][authentication] section in the base directory's README.
69
70## Authorization
71
72The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Recommendations AI APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Recommendations AI API calls.
73
74## Getting Started
75
76### Prerequisites
77
78You will need a [Google Cloud Platform Console][developer-console] project with the Recommendations AI [API enabled][enable-api].
79You will need to [enable billing][enable-billing] to use Google Recommendations AI.
80[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by
81[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line:
82`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.
83
84### Installation and setup
85
86You'll need to obtain the `google-cloud-recommendations-ai` library. See the [Quickstart](#quickstart) section
87to add `google-cloud-recommendations-ai` as a dependency in your code.
88
89## About Recommendations AI
90
91
92[Recommendations AI][product-docs] delivers highly personalized product recommendations at scale.
93
94See the [Recommendations AI client library docs][javadocs] to learn how to
95use this Recommendations AI Client Library.
96
97
98
99
100
101
102## Troubleshooting
103
104To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting].
105
106## Transport
107
108Recommendations AI uses gRPC for the transport layer.
109
110## Supported Java Versions
111
112Java 8 or above is required for using this client.
113
114Google's Java client libraries,
115[Google Cloud Client Libraries][cloudlibs]
116and
117[Google Cloud API Libraries][apilibs],
118follow the
119[Oracle Java SE support roadmap][oracle]
120(see the Oracle Java SE Product Releases section).
121
122### For new development
123
124In general, new feature development occurs with support for the lowest Java
125LTS version covered by Oracle's Premier Support (which typically lasts 5 years
126from initial General Availability). If the minimum required JVM for a given
127library is changed, it is accompanied by a [semver][semver] major release.
128
129Java 11 and (in September 2021) Java 17 are the best choices for new
130development.
131
132### Keeping production systems current
133
134Google tests its client libraries with all current LTS versions covered by
135Oracle's Extended Support (which typically lasts 8 years from initial
136General Availability).
137
138#### Legacy support
139
140Google's client libraries support legacy versions of Java runtimes with long
141term stable libraries that don't receive feature updates on a best efforts basis
142as it may not be possible to backport all patches.
143
144Google provides updates on a best efforts basis to apps that continue to use
145Java 7, though apps might need to upgrade to current versions of the library
146that supports their JVM.
147
148#### Where to find specific information
149
150The latest versions and the supported Java versions are identified on
151the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME`
152and on [google-cloud-java][g-c-j].
153
154## Versioning
155
156
157This library follows [Semantic Versioning](http://semver.org/).
158
159
160It is currently in major version zero (``0.y.z``), which means that anything may change at any time
161and the public API should not be considered stable.
162
163
164## Contributing
165
166
167Contributions to this library are always welcome and highly encouraged.
168
169See [CONTRIBUTING][contributing] for more information how to get started.
170
171Please note that this project is released with a Contributor Code of Conduct. By participating in
172this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more
173information.
174
175
176## License
177
178Apache 2.0 - See [LICENSE][license] for more information.
179
180## CI Status
181
182Java Version | Status
183------------ | ------
184Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2]
185Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3]
186Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4]
187Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5]
188
189Java is a registered trademark of Oracle and/or its affiliates.
190
191[product-docs]: https://cloud.google.com/recommendations-ai/
192[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-recommendations-ai/latest/overview
193[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg
194[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html
195[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg
196[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html
197[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg
198[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html
199[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg
200[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html
201[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg
202[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
203[stability-image]: https://img.shields.io/badge/stability-preview-yellow
204[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-recommendations-ai.svg
205[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-recommendations-ai/0.21.0
206[authentication]: https://github.com/googleapis/google-cloud-java#authentication
207[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
208[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
209[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy
210[developer-console]: https://console.developers.google.com/
211[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
212[cloud-cli]: https://cloud.google.com/cli
213[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md
214[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
215[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
216[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE
217[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing
218[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=recommendationengine.googleapis.com
219[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
220[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
221
222[semver]: https://semver.org/
223[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained
224[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries
225[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html
226[g-c-j]: http://github.com/googleapis/google-cloud-java
227