Skip to content

Commit f7f2df6

Browse files
authored
Merge branch 'main' into onboard-maps-isochrones
2 parents 523de42 + 9517313 commit f7f2df6

104 files changed

Lines changed: 28801 additions & 14 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gapic-libraries-bom/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,13 @@
11361136
<type>pom</type>
11371137
<scope>import</scope>
11381138
</dependency>
1139+
<dependency>
1140+
<groupId>com.google.cloud</groupId>
1141+
<artifactId>google-cloud-productregistry-bom</artifactId>
1142+
<version>0.1.0-SNAPSHOT</version><!-- {x-version-update:google-cloud-productregistry:current} -->
1143+
<type>pom</type>
1144+
<scope>import</scope>
1145+
</dependency>
11391146
<dependency>
11401147
<groupId>com.google.cloud</groupId>
11411148
<artifactId>google-cloud-profiler-bom</artifactId>

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import static org.mockito.Mockito.times;
2828
import static org.mockito.Mockito.verify;
2929
import static org.mockito.Mockito.when;
30+
import static org.mockito.Mockito.withSettings;
3031

3132
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
3233
import com.google.api.gax.paging.Page;
@@ -535,7 +536,7 @@ public void testGetDiscoveredProjects_Success() throws Exception {
535536
BigQuery mockBigQuery = mock(BigQuery.class);
536537
connection.bigQuery = mockBigQuery;
537538

538-
Page<Project> mockPage = mock(Page.class);
539+
Page<Project> mockPage = mock(Page.class, withSettings().withoutAnnotations());
539540
Project project1 = mock(Project.class);
540541
when(project1.getProjectId()).thenReturn("discovered-p1");
541542
Project project2 = mock(Project.class);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ public void testFindMatchingBigQueryObjects_Routines_ListWithPattern() throws Ex
10091009
Routine func1 = mockBigQueryRoutine(catalog, schema, "func_123", "FUNCTION", "f1");
10101010
Routine otherProc = mockBigQueryRoutine(catalog, schema, "another_proc", "PROCEDURE", "p3");
10111011

1012-
Page<Routine> page = mock(Page.class);
1012+
Page<Routine> page = mock(Page.class, withSettings().withoutAnnotations());
10131013
when(page.iterateAll()).thenReturn(Arrays.asList(proc1, func1, proc2, otherProc));
10141014
when(bigqueryClient.listRoutines(eq(datasetId), any(BigQuery.RoutineListOption[].class)))
10151015
.thenReturn(page);
@@ -1053,7 +1053,7 @@ public void testFindMatchingBigQueryObjects_Routines_ListNoPattern() throws Exce
10531053
Routine proc1 = mockBigQueryRoutine(catalog, schema, "proc_abc", "PROCEDURE", "p1");
10541054
Routine func1 = mockBigQueryRoutine(catalog, schema, "func_123", "FUNCTION", "f1");
10551055

1056-
Page<Routine> page = mock(Page.class);
1056+
Page<Routine> page = mock(Page.class, withSettings().withoutAnnotations());
10571057
when(page.iterateAll()).thenReturn(Arrays.asList(proc1, func1));
10581058
when(bigqueryClient.listRoutines(eq(datasetId), any(BigQuery.RoutineListOption[].class)))
10591059
.thenReturn(page);
@@ -1545,12 +1545,12 @@ public void testListMatchingProcedureIdsFromDatasets() throws Exception {
15451545
Routine func1_ds1 = mockBigQueryRoutine(catalog, schema1Name, "func_b", "FUNCTION", "desc b");
15461546
Routine proc2_ds2 = mockBigQueryRoutine(catalog, schema2Name, "proc_c", "PROCEDURE", "desc c");
15471547

1548-
Page<Routine> page1 = mock(Page.class);
1548+
Page<Routine> page1 = mock(Page.class, withSettings().withoutAnnotations());
15491549
when(page1.iterateAll()).thenReturn(Arrays.asList(proc1_ds1, func1_ds1));
15501550
when(bigqueryClient.listRoutines(eq(dataset1.getDatasetId()), any(RoutineListOption.class)))
15511551
.thenReturn(page1);
15521552

1553-
Page<Routine> page2 = mock(Page.class);
1553+
Page<Routine> page2 = mock(Page.class, withSettings().withoutAnnotations());
15541554
when(page2.iterateAll()).thenReturn(Collections.singletonList(proc2_ds2));
15551555
when(bigqueryClient.listRoutines(eq(dataset2.getDatasetId()), any(RoutineListOption.class)))
15561556
.thenReturn(page2);
@@ -3309,20 +3309,20 @@ public void testGetSchemas_WithProjectDiscovery() throws SQLException {
33093309
when(bigQueryConnection.getDiscoveredProjects()).thenReturn(Arrays.asList("discovered-1"));
33103310
when(bigQueryConnection.getAdditionalProjects()).thenReturn("additional-1");
33113311

3312-
Page<Dataset> pagePrimary = mock(Page.class);
3312+
Page<Dataset> pagePrimary = mock(Page.class, withSettings().withoutAnnotations());
33133313
Dataset dsPrimary = mockBigQueryDataset("primary-project", "dataset_p");
33143314
when(pagePrimary.iterateAll()).thenReturn(Collections.singletonList(dsPrimary));
33153315
when(bigqueryClient.listDatasets(
33163316
eq("primary-project"), any(BigQuery.DatasetListOption[].class)))
33173317
.thenReturn(pagePrimary);
33183318

3319-
Page<Dataset> pageAdditional = mock(Page.class);
3319+
Page<Dataset> pageAdditional = mock(Page.class, withSettings().withoutAnnotations());
33203320
Dataset dsAdditional = mockBigQueryDataset("additional-1", "dataset_a");
33213321
when(pageAdditional.iterateAll()).thenReturn(Collections.singletonList(dsAdditional));
33223322
when(bigqueryClient.listDatasets(eq("additional-1"), any(BigQuery.DatasetListOption[].class)))
33233323
.thenReturn(pageAdditional);
33243324

3325-
Page<Dataset> pageDiscovered = mock(Page.class);
3325+
Page<Dataset> pageDiscovered = mock(Page.class, withSettings().withoutAnnotations());
33263326
Dataset dsDiscovered = mockBigQueryDataset("discovered-1", "dataset_d");
33273327
when(pageDiscovered.iterateAll()).thenReturn(Collections.singletonList(dsDiscovered));
33283328
when(bigqueryClient.listDatasets(eq("discovered-1"), any(BigQuery.DatasetListOption[].class)))
@@ -3354,14 +3354,14 @@ public void testGetSchemas_WithoutProjectDiscovery() throws SQLException {
33543354
when(bigQueryConnection.getDiscoveredProjects()).thenReturn(Arrays.asList("discovered-1"));
33553355
when(bigQueryConnection.getAdditionalProjects()).thenReturn("additional-1");
33563356

3357-
Page<Dataset> pagePrimary = mock(Page.class);
3357+
Page<Dataset> pagePrimary = mock(Page.class, withSettings().withoutAnnotations());
33583358
Dataset dsPrimary = mockBigQueryDataset("primary-project", "dataset_p");
33593359
when(pagePrimary.iterateAll()).thenReturn(Collections.singletonList(dsPrimary));
33603360
when(bigqueryClient.listDatasets(
33613361
eq("primary-project"), any(BigQuery.DatasetListOption[].class)))
33623362
.thenReturn(pagePrimary);
33633363

3364-
Page<Dataset> pageAdditional = mock(Page.class);
3364+
Page<Dataset> pageAdditional = mock(Page.class, withSettings().withoutAnnotations());
33653365
Dataset dsAdditional = mockBigQueryDataset("additional-1", "dataset_a");
33663366
when(pageAdditional.iterateAll()).thenReturn(Collections.singletonList(dsAdditional));
33673367
when(bigqueryClient.listDatasets(eq("additional-1"), any(BigQuery.DatasetListOption[].class)))
@@ -3388,7 +3388,7 @@ public void testGetSchemas_WithoutProjectDiscovery() throws SQLException {
33883388
}
33893389

33903390
private void mockDatasetIteration(DatasetId datasetId) {
3391-
Page<Dataset> pagePrimary = mock(Page.class);
3391+
Page<Dataset> pagePrimary = mock(Page.class, withSettings().withoutAnnotations());
33923392
Dataset dsPrimary = mock(Dataset.class);
33933393
when(dsPrimary.getDatasetId()).thenReturn(datasetId);
33943394
when(pagePrimary.iterateAll()).thenReturn(Collections.singletonList(dsPrimary));
@@ -3411,7 +3411,7 @@ private Table mockTableWithConstraints(TableId tableId, TableConstraints constra
34113411
}
34123412

34133413
private void mockTableIteration(DatasetId datasetId, Table... tables) {
3414-
Page<Table> pageTables = mock(Page.class);
3414+
Page<Table> pageTables = mock(Page.class, withSettings().withoutAnnotations());
34153415
when(pageTables.iterateAll()).thenReturn(Arrays.asList(tables));
34163416
when(bigqueryClient.listTables(eq(datasetId), any(BigQuery.TableListOption[].class)))
34173417
.thenReturn(pageTables);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import static org.mockito.Mockito.doReturn;
2828
import static org.mockito.Mockito.mock;
2929
import static org.mockito.Mockito.verify;
30+
import static org.mockito.Mockito.withSettings;
3031

3132
import com.google.api.gax.rpc.ApiException;
3233
import com.google.api.gax.rpc.StatusCode;
@@ -596,8 +597,8 @@ private TableResult mockTableResultWithJob(String jobId) {
596597
}
597598

598599
private ApiException mockApiException(StatusCode.Code code) {
599-
ApiException apiExceptionMock = mock(ApiException.class);
600-
StatusCode statusCodeMock = mock(StatusCode.class);
600+
ApiException apiExceptionMock = mock(ApiException.class, withSettings().withoutAnnotations());
601+
StatusCode statusCodeMock = mock(StatusCode.class, withSettings().withoutAnnotations());
601602
doReturn(statusCodeMock).when(apiExceptionMock).getStatusCode();
602603
doReturn(code).when(statusCodeMock).getCode();
603604
return apiExceptionMock;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"api_shortname": "cloudproductregistry",
3+
"name_pretty": "Cloud Product Registry",
4+
"product_documentation": "https://docs.cloud.google.com/product-registry",
5+
"api_description": "cloudproductregistry.googleapis.com API.",
6+
"client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-productregistry/latest/overview",
7+
"release_level": "preview",
8+
"transport": "grpc+rest",
9+
"language": "java",
10+
"repo": "googleapis/google-cloud-java",
11+
"repo_short": "java-productregistry",
12+
"distribution_name": "com.google.cloud:google-cloud-productregistry",
13+
"api_id": "cloudproductregistry.googleapis.com",
14+
"library_type": "GAPIC_AUTO"
15+
}

java-productregistry/README.md

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

0 commit comments

Comments
 (0)