Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

fix: update gapic-generator-java with mock service generation fixes #266

Merged
merged 10 commits into from
Jun 28, 2022
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-artifact-registry</artifactId>
<version>1.1.2</version>
<version>1.2.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-artifact-registry:1.1.2'
implementation 'com.google.cloud:google-cloud-artifact-registry:1.2.0'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-artifact-registry" % "1.1.2"
libraryDependencies += "com.google.cloud" % "google-cloud-artifact-registry" % "1.2.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
Expand Down Expand Up @@ -151,7 +150,6 @@ public static final ArtifactRegistryClient create(ArtifactRegistrySettings setti
* Constructs an instance of ArtifactRegistryClient, using the given stub for making calls. This
* is for advanced usage - prefer using create(ArtifactRegistrySettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ArtifactRegistryClient create(ArtifactRegistryStub stub) {
return new ArtifactRegistryClient(stub);
}
Expand All @@ -167,7 +165,6 @@ protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOExc
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected ArtifactRegistryClient(ArtifactRegistryStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -178,7 +175,6 @@ public final ArtifactRegistrySettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub getStub() {
return stub;
}
Expand Down Expand Up @@ -295,7 +291,7 @@ public final ListDockerImagesPagedResponse listDockerImages(ListDockerImagesRequ
* while (true) {
* ListDockerImagesResponse response =
* artifactRegistryClient.listDockerImagesCallable().call(request);
* for (DockerImage element : response.getResponsesList()) {
* for (DockerImage element : response.getDockerImagesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -707,7 +703,7 @@ public final ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequ
* while (true) {
* ListRepositoriesResponse response =
* artifactRegistryClient.listRepositoriesCallable().call(request);
* for (Repository element : response.getResponsesList()) {
* for (Repository element : response.getRepositoriesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1297,7 +1293,7 @@ public final ListPackagesPagedResponse listPackages(ListPackagesRequest request)
* .build();
* while (true) {
* ListPackagesResponse response = artifactRegistryClient.listPackagesCallable().call(request);
* for (Package element : response.getResponsesList()) {
* for (Package element : response.getPackagesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1586,7 +1582,7 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request)
* .build();
* while (true) {
* ListVersionsResponse response = artifactRegistryClient.listVersionsCallable().call(request);
* for (Version element : response.getResponsesList()) {
* for (Version element : response.getVersionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1882,7 +1878,7 @@ public final UnaryCallable<ListFilesRequest, ListFilesPagedResponse> listFilesPa
* .build();
* while (true) {
* ListFilesResponse response = artifactRegistryClient.listFilesCallable().call(request);
* for (File element : response.getResponsesList()) {
* for (File element : response.getFilesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -2068,7 +2064,7 @@ public final UnaryCallable<ListTagsRequest, ListTagsPagedResponse> listTagsPaged
* .build();
* while (true) {
* ListTagsResponse response = artifactRegistryClient.listTagsCallable().call(request);
* for (Tag element : response.getResponsesList()) {
* for (Tag element : response.getTagsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -2388,9 +2384,7 @@ public final UnaryCallable<DeleteTagRequest, Empty> deleteTagCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -2417,9 +2411,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -2445,9 +2437,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = artifactRegistryClient.getIamPolicy(request);
Expand All @@ -2473,9 +2463,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture<Policy> future = artifactRegistryClient.getIamPolicyCallable().futureCall(request);
Expand All @@ -2500,9 +2488,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* TestIamPermissionsResponse response = artifactRegistryClient.testIamPermissions(request);
Expand All @@ -2528,9 +2514,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* DockerImageName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]", "[DOCKER_IMAGE]")
* .toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* ApiFuture<TestIamPermissionsResponse> future =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,6 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return updateProjectSettingsSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public static final ArtifactRegistryClient create(ArtifactRegistrySettings setti
* Constructs an instance of ArtifactRegistryClient, using the given stub for making calls. This
* is for advanced usage - prefer using create(ArtifactRegistrySettings).
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ArtifactRegistryClient create(ArtifactRegistryStub stub) {
return new ArtifactRegistryClient(stub);
}
Expand All @@ -167,7 +166,6 @@ protected ArtifactRegistryClient(ArtifactRegistrySettings settings) throws IOExc
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected ArtifactRegistryClient(ArtifactRegistryStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -178,7 +176,6 @@ public final ArtifactRegistrySettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub getStub() {
return stub;
}
Expand Down Expand Up @@ -481,7 +478,7 @@ public final ListRepositoriesPagedResponse listRepositories(ListRepositoriesRequ
* while (true) {
* ListRepositoriesResponse response =
* artifactRegistryClient.listRepositoriesCallable().call(request);
* for (Repository element : response.getResponsesList()) {
* for (Repository element : response.getRepositoriesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1071,7 +1068,7 @@ public final ListPackagesPagedResponse listPackages(ListPackagesRequest request)
* .build();
* while (true) {
* ListPackagesResponse response = artifactRegistryClient.listPackagesCallable().call(request);
* for (Package element : response.getResponsesList()) {
* for (Package element : response.getPackagesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1360,7 +1357,7 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request)
* .build();
* while (true) {
* ListVersionsResponse response = artifactRegistryClient.listVersionsCallable().call(request);
* for (Version element : response.getResponsesList()) {
* for (Version element : response.getVersionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1653,7 +1650,7 @@ public final UnaryCallable<ListFilesRequest, ListFilesPagedResponse> listFilesPa
* .build();
* while (true) {
* ListFilesResponse response = artifactRegistryClient.listFilesCallable().call(request);
* for (File element : response.getResponsesList()) {
* for (File element : response.getFilesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1839,7 +1836,7 @@ public final UnaryCallable<ListTagsRequest, ListTagsPagedResponse> listTagsPaged
* .build();
* while (true) {
* ListTagsResponse response = artifactRegistryClient.listTagsCallable().call(request);
* for (Tag element : response.getResponsesList()) {
* for (Tag element : response.getTagsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -2159,7 +2156,7 @@ public final UnaryCallable<DeleteTagRequest, Empty> deleteTagCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -2186,7 +2183,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -2212,7 +2209,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = artifactRegistryClient.getIamPolicy(request);
Expand All @@ -2238,7 +2235,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture<Policy> future = artifactRegistryClient.getIamPolicyCallable().futureCall(request);
Expand All @@ -2263,7 +2260,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* TestIamPermissionsResponse response = artifactRegistryClient.testIamPermissions(request);
Expand All @@ -2289,7 +2286,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(ProjectSettingsName.of("[PROJECT]").toString())
* .setResource(RepositoryName.of("[PROJECT]", "[LOCATION]", "[REPOSITORY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* ApiFuture<TestIamPermissionsResponse> future =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return updateProjectSettingsSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public ArtifactRegistryStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down
Loading