Skip to content

Commit 4e89023

Browse files
chore: [artifactregistry] regenerate API index (#8944)
* chore: regenerate API index Source-Link: googleapis/googleapis@b84b4fe Source-Link: https://github.com/googleapis/googleapis-gen/commit/916424c97215b12211037b5057b833447d073bbd Copy-Tag: eyJwIjoiamF2YS1hcnRpZmFjdC1yZWdpc3RyeS8uT3dsQm90LnlhbWwiLCJoIjoiOTE2NDI0Yzk3MjE1YjEyMjExMDM3YjUwNTdiODMzNDQ3ZDA3M2JiZCJ9 feat: Add location methods PiperOrigin-RevId: 499263614 Source-Link: googleapis/googleapis@ba2db0d Source-Link: https://github.com/googleapis/googleapis-gen/commit/503d1e8eff04535fc5d4b74fe1c894e67fd596b2 Copy-Tag: eyJwIjoiamF2YS1hcnRpZmFjdC1yZWdpc3RyeS8uT3dsQm90LnlhbWwiLCJoIjoiNTAzZDFlOGVmZjA0NTM1ZmM1ZDRiNzRmZTFjODk0ZTY3ZmQ1OTZiMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add grpc dependency to google-cloud-artifact-registry Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Joe Wang <[email protected]>
1 parent ef83331 commit 4e89023

25 files changed

+1991
-14
lines changed

java-artifact-registry/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>google-cloud-artifact-registry</artifactId>
22-
<version>1.5.0</version>
22+
<version>1.6.0</version>
2323
</dependency>
2424
```
2525

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

2828
```Groovy
29-
implementation 'com.google.cloud:google-cloud-artifact-registry:1.5.0'
29+
implementation 'com.google.cloud:google-cloud-artifact-registry:1.6.0'
3030
```
3131

3232
If you are using SBT, add this to your dependencies:
3333

3434
```Scala
35-
libraryDependencies += "com.google.cloud" % "google-cloud-artifact-registry" % "1.5.0"
35+
libraryDependencies += "com.google.cloud" % "google-cloud-artifact-registry" % "1.6.0"
3636
```
3737

3838
## Authentication

java-artifact-registry/google-cloud-artifact-registry/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,10 @@
110110
<classifier>testlib</classifier>
111111
<scope>test</scope>
112112
</dependency>
113+
<dependency>
114+
<groupId>com.google.api.grpc</groupId>
115+
<artifactId>grpc-google-common-protos</artifactId>
116+
<scope>test</scope>
117+
</dependency>
113118
</dependencies>
114119
</project>

java-artifact-registry/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistryClient.java

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
import com.google.api.gax.rpc.OperationCallable;
2929
import com.google.api.gax.rpc.PageContext;
3030
import com.google.api.gax.rpc.UnaryCallable;
31+
import com.google.cloud.location.GetLocationRequest;
32+
import com.google.cloud.location.ListLocationsRequest;
33+
import com.google.cloud.location.ListLocationsResponse;
34+
import com.google.cloud.location.Location;
3135
import com.google.common.util.concurrent.MoreExecutors;
3236
import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStub;
3337
import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStubSettings;
@@ -3035,6 +3039,162 @@ public final ProjectSettings updateProjectSettings(UpdateProjectSettingsRequest
30353039
return stub.updateProjectSettingsCallable();
30363040
}
30373041

3042+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
3043+
/**
3044+
* Lists information about the supported locations for this service.
3045+
*
3046+
* <p>Sample code:
3047+
*
3048+
* <pre>{@code
3049+
* // This snippet has been automatically generated and should be regarded as a code template only.
3050+
* // It will require modifications to work:
3051+
* // - It may require correct/in-range values for request initialization.
3052+
* // - It may require specifying regional endpoints when creating the service client as shown in
3053+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3054+
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
3055+
* ListLocationsRequest request =
3056+
* ListLocationsRequest.newBuilder()
3057+
* .setName("name3373707")
3058+
* .setFilter("filter-1274492040")
3059+
* .setPageSize(883849137)
3060+
* .setPageToken("pageToken873572522")
3061+
* .build();
3062+
* for (Location element : artifactRegistryClient.listLocations(request).iterateAll()) {
3063+
* // doThingsWith(element);
3064+
* }
3065+
* }
3066+
* }</pre>
3067+
*
3068+
* @param request The request object containing all of the parameters for the API call.
3069+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
3070+
*/
3071+
public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
3072+
return listLocationsPagedCallable().call(request);
3073+
}
3074+
3075+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
3076+
/**
3077+
* Lists information about the supported locations for this service.
3078+
*
3079+
* <p>Sample code:
3080+
*
3081+
* <pre>{@code
3082+
* // This snippet has been automatically generated and should be regarded as a code template only.
3083+
* // It will require modifications to work:
3084+
* // - It may require correct/in-range values for request initialization.
3085+
* // - It may require specifying regional endpoints when creating the service client as shown in
3086+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3087+
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
3088+
* ListLocationsRequest request =
3089+
* ListLocationsRequest.newBuilder()
3090+
* .setName("name3373707")
3091+
* .setFilter("filter-1274492040")
3092+
* .setPageSize(883849137)
3093+
* .setPageToken("pageToken873572522")
3094+
* .build();
3095+
* ApiFuture<Location> future =
3096+
* artifactRegistryClient.listLocationsPagedCallable().futureCall(request);
3097+
* // Do something.
3098+
* for (Location element : future.get().iterateAll()) {
3099+
* // doThingsWith(element);
3100+
* }
3101+
* }
3102+
* }</pre>
3103+
*/
3104+
public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
3105+
listLocationsPagedCallable() {
3106+
return stub.listLocationsPagedCallable();
3107+
}
3108+
3109+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
3110+
/**
3111+
* Lists information about the supported locations for this service.
3112+
*
3113+
* <p>Sample code:
3114+
*
3115+
* <pre>{@code
3116+
* // This snippet has been automatically generated and should be regarded as a code template only.
3117+
* // It will require modifications to work:
3118+
* // - It may require correct/in-range values for request initialization.
3119+
* // - It may require specifying regional endpoints when creating the service client as shown in
3120+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3121+
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
3122+
* ListLocationsRequest request =
3123+
* ListLocationsRequest.newBuilder()
3124+
* .setName("name3373707")
3125+
* .setFilter("filter-1274492040")
3126+
* .setPageSize(883849137)
3127+
* .setPageToken("pageToken873572522")
3128+
* .build();
3129+
* while (true) {
3130+
* ListLocationsResponse response =
3131+
* artifactRegistryClient.listLocationsCallable().call(request);
3132+
* for (Location element : response.getLocationsList()) {
3133+
* // doThingsWith(element);
3134+
* }
3135+
* String nextPageToken = response.getNextPageToken();
3136+
* if (!Strings.isNullOrEmpty(nextPageToken)) {
3137+
* request = request.toBuilder().setPageToken(nextPageToken).build();
3138+
* } else {
3139+
* break;
3140+
* }
3141+
* }
3142+
* }
3143+
* }</pre>
3144+
*/
3145+
public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
3146+
return stub.listLocationsCallable();
3147+
}
3148+
3149+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
3150+
/**
3151+
* Gets information about a location.
3152+
*
3153+
* <p>Sample code:
3154+
*
3155+
* <pre>{@code
3156+
* // This snippet has been automatically generated and should be regarded as a code template only.
3157+
* // It will require modifications to work:
3158+
* // - It may require correct/in-range values for request initialization.
3159+
* // - It may require specifying regional endpoints when creating the service client as shown in
3160+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3161+
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
3162+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
3163+
* Location response = artifactRegistryClient.getLocation(request);
3164+
* }
3165+
* }</pre>
3166+
*
3167+
* @param request The request object containing all of the parameters for the API call.
3168+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
3169+
*/
3170+
public final Location getLocation(GetLocationRequest request) {
3171+
return getLocationCallable().call(request);
3172+
}
3173+
3174+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
3175+
/**
3176+
* Gets information about a location.
3177+
*
3178+
* <p>Sample code:
3179+
*
3180+
* <pre>{@code
3181+
* // This snippet has been automatically generated and should be regarded as a code template only.
3182+
* // It will require modifications to work:
3183+
* // - It may require correct/in-range values for request initialization.
3184+
* // - It may require specifying regional endpoints when creating the service client as shown in
3185+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3186+
* try (ArtifactRegistryClient artifactRegistryClient = ArtifactRegistryClient.create()) {
3187+
* GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
3188+
* ApiFuture<Location> future = artifactRegistryClient.getLocationCallable().futureCall(request);
3189+
* // Do something.
3190+
* Location response = future.get();
3191+
* }
3192+
* }</pre>
3193+
*/
3194+
public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
3195+
return stub.getLocationCallable();
3196+
}
3197+
30383198
@Override
30393199
public final void close() {
30403200
stub.close();
@@ -3496,4 +3656,80 @@ protected ListTagsFixedSizeCollection createCollection(
34963656
return new ListTagsFixedSizeCollection(pages, collectionSize);
34973657
}
34983658
}
3659+
3660+
public static class ListLocationsPagedResponse
3661+
extends AbstractPagedListResponse<
3662+
ListLocationsRequest,
3663+
ListLocationsResponse,
3664+
Location,
3665+
ListLocationsPage,
3666+
ListLocationsFixedSizeCollection> {
3667+
3668+
public static ApiFuture<ListLocationsPagedResponse> createAsync(
3669+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
3670+
ApiFuture<ListLocationsResponse> futureResponse) {
3671+
ApiFuture<ListLocationsPage> futurePage =
3672+
ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
3673+
return ApiFutures.transform(
3674+
futurePage,
3675+
input -> new ListLocationsPagedResponse(input),
3676+
MoreExecutors.directExecutor());
3677+
}
3678+
3679+
private ListLocationsPagedResponse(ListLocationsPage page) {
3680+
super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
3681+
}
3682+
}
3683+
3684+
public static class ListLocationsPage
3685+
extends AbstractPage<
3686+
ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
3687+
3688+
private ListLocationsPage(
3689+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
3690+
ListLocationsResponse response) {
3691+
super(context, response);
3692+
}
3693+
3694+
private static ListLocationsPage createEmptyPage() {
3695+
return new ListLocationsPage(null, null);
3696+
}
3697+
3698+
@Override
3699+
protected ListLocationsPage createPage(
3700+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
3701+
ListLocationsResponse response) {
3702+
return new ListLocationsPage(context, response);
3703+
}
3704+
3705+
@Override
3706+
public ApiFuture<ListLocationsPage> createPageAsync(
3707+
PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
3708+
ApiFuture<ListLocationsResponse> futureResponse) {
3709+
return super.createPageAsync(context, futureResponse);
3710+
}
3711+
}
3712+
3713+
public static class ListLocationsFixedSizeCollection
3714+
extends AbstractFixedSizeCollection<
3715+
ListLocationsRequest,
3716+
ListLocationsResponse,
3717+
Location,
3718+
ListLocationsPage,
3719+
ListLocationsFixedSizeCollection> {
3720+
3721+
private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) {
3722+
super(pages, collectionSize);
3723+
}
3724+
3725+
private static ListLocationsFixedSizeCollection createEmptyCollection() {
3726+
return new ListLocationsFixedSizeCollection(null, 0);
3727+
}
3728+
3729+
@Override
3730+
protected ListLocationsFixedSizeCollection createCollection(
3731+
List<ListLocationsPage> pages, int collectionSize) {
3732+
return new ListLocationsFixedSizeCollection(pages, collectionSize);
3733+
}
3734+
}
34993735
}

java-artifact-registry/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/ArtifactRegistrySettings.java

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListDockerImagesPagedResponse;
2020
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListFilesPagedResponse;
21+
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListLocationsPagedResponse;
2122
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListPackagesPagedResponse;
2223
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListRepositoriesPagedResponse;
2324
import static com.google.devtools.artifactregistry.v1.ArtifactRegistryClient.ListTagsPagedResponse;
@@ -36,6 +37,10 @@
3637
import com.google.api.gax.rpc.PagedCallSettings;
3738
import com.google.api.gax.rpc.TransportChannelProvider;
3839
import com.google.api.gax.rpc.UnaryCallSettings;
40+
import com.google.cloud.location.GetLocationRequest;
41+
import com.google.cloud.location.ListLocationsRequest;
42+
import com.google.cloud.location.ListLocationsResponse;
43+
import com.google.cloud.location.Location;
3944
import com.google.devtools.artifactregistry.v1.stub.ArtifactRegistryStubSettings;
4045
import com.google.iam.v1.GetIamPolicyRequest;
4146
import com.google.iam.v1.Policy;
@@ -77,7 +82,10 @@
7782
* artifactRegistrySettingsBuilder
7883
* .getDockerImageSettings()
7984
* .setRetrySettings(
80-
* artifactRegistrySettingsBuilder.getDockerImageSettings().getRetrySettings().toBuilder()
85+
* artifactRegistrySettingsBuilder
86+
* .getDockerImageSettings()
87+
* .getRetrySettings()
88+
* .toBuilder()
8189
* .setTotalTimeout(Duration.ofSeconds(30))
8290
* .build());
8391
* ArtifactRegistrySettings artifactRegistrySettings = artifactRegistrySettingsBuilder.build();
@@ -270,6 +278,17 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
270278
return ((ArtifactRegistryStubSettings) getStubSettings()).updateProjectSettingsSettings();
271279
}
272280

281+
/** Returns the object with the settings used for calls to listLocations. */
282+
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
283+
listLocationsSettings() {
284+
return ((ArtifactRegistryStubSettings) getStubSettings()).listLocationsSettings();
285+
}
286+
287+
/** Returns the object with the settings used for calls to getLocation. */
288+
public UnaryCallSettings<GetLocationRequest, Location> getLocationSettings() {
289+
return ((ArtifactRegistryStubSettings) getStubSettings()).getLocationSettings();
290+
}
291+
273292
public static final ArtifactRegistrySettings create(ArtifactRegistryStubSettings stub)
274293
throws IOException {
275294
return new ArtifactRegistrySettings.Builder(stub.toBuilder()).build();
@@ -576,6 +595,18 @@ public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettin
576595
return getStubSettingsBuilder().updateProjectSettingsSettings();
577596
}
578597

598+
/** Returns the builder for the settings used for calls to listLocations. */
599+
public PagedCallSettings.Builder<
600+
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
601+
listLocationsSettings() {
602+
return getStubSettingsBuilder().listLocationsSettings();
603+
}
604+
605+
/** Returns the builder for the settings used for calls to getLocation. */
606+
public UnaryCallSettings.Builder<GetLocationRequest, Location> getLocationSettings() {
607+
return getStubSettingsBuilder().getLocationSettings();
608+
}
609+
579610
@Override
580611
public ArtifactRegistrySettings build() throws IOException {
581612
return new ArtifactRegistrySettings(this);

java-artifact-registry/google-cloud-artifact-registry/src/main/java/com/google/devtools/artifactregistry/v1/gapic_metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"GetIamPolicy": {
3838
"methods": ["getIamPolicy", "getIamPolicyCallable"]
3939
},
40+
"GetLocation": {
41+
"methods": ["getLocation", "getLocationCallable"]
42+
},
4043
"GetPackage": {
4144
"methods": ["getPackage", "getPackage", "getPackageCallable"]
4245
},
@@ -64,6 +67,9 @@
6467
"ListFiles": {
6568
"methods": ["listFiles", "listFiles", "listFilesPagedCallable", "listFilesCallable"]
6669
},
70+
"ListLocations": {
71+
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
72+
},
6773
"ListPackages": {
6874
"methods": ["listPackages", "listPackages", "listPackagesPagedCallable", "listPackagesCallable"]
6975
},

0 commit comments

Comments
 (0)