com.google.photos.library.v1.internal.stub.GrpcPhotosLibraryStub Maven / Gradle / Ivy
Show all versions of google-photos-library-client Show documentation
/*
* 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
*
* 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.photos.library.v1.internal.stub;
import static com.google.photos.library.v1.internal.InternalPhotosLibraryClient.ListAlbumsPagedResponse;
import static com.google.photos.library.v1.internal.InternalPhotosLibraryClient.ListMediaItemsPagedResponse;
import static com.google.photos.library.v1.internal.InternalPhotosLibraryClient.ListSharedAlbumsPagedResponse;
import static com.google.photos.library.v1.internal.InternalPhotosLibraryClient.SearchMediaItemsPagedResponse;
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.UnaryCallable;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.photos.library.v1.proto.AddEnrichmentToAlbumRequest;
import com.google.photos.library.v1.proto.AddEnrichmentToAlbumResponse;
import com.google.photos.library.v1.proto.BatchAddMediaItemsToAlbumRequest;
import com.google.photos.library.v1.proto.BatchAddMediaItemsToAlbumResponse;
import com.google.photos.library.v1.proto.BatchCreateMediaItemsRequest;
import com.google.photos.library.v1.proto.BatchCreateMediaItemsResponse;
import com.google.photos.library.v1.proto.BatchGetMediaItemsRequest;
import com.google.photos.library.v1.proto.BatchGetMediaItemsResponse;
import com.google.photos.library.v1.proto.BatchRemoveMediaItemsFromAlbumRequest;
import com.google.photos.library.v1.proto.BatchRemoveMediaItemsFromAlbumResponse;
import com.google.photos.library.v1.proto.CreateAlbumRequest;
import com.google.photos.library.v1.proto.GetAlbumRequest;
import com.google.photos.library.v1.proto.GetMediaItemRequest;
import com.google.photos.library.v1.proto.GetSharedAlbumRequest;
import com.google.photos.library.v1.proto.JoinSharedAlbumRequest;
import com.google.photos.library.v1.proto.JoinSharedAlbumResponse;
import com.google.photos.library.v1.proto.LeaveSharedAlbumRequest;
import com.google.photos.library.v1.proto.LeaveSharedAlbumResponse;
import com.google.photos.library.v1.proto.ListAlbumsRequest;
import com.google.photos.library.v1.proto.ListAlbumsResponse;
import com.google.photos.library.v1.proto.ListMediaItemsRequest;
import com.google.photos.library.v1.proto.ListMediaItemsResponse;
import com.google.photos.library.v1.proto.ListSharedAlbumsRequest;
import com.google.photos.library.v1.proto.ListSharedAlbumsResponse;
import com.google.photos.library.v1.proto.SearchMediaItemsRequest;
import com.google.photos.library.v1.proto.SearchMediaItemsResponse;
import com.google.photos.library.v1.proto.ShareAlbumRequest;
import com.google.photos.library.v1.proto.ShareAlbumResponse;
import com.google.photos.library.v1.proto.UnshareAlbumRequest;
import com.google.photos.library.v1.proto.UnshareAlbumResponse;
import com.google.photos.library.v1.proto.UpdateAlbumRequest;
import com.google.photos.library.v1.proto.UpdateMediaItemRequest;
import com.google.photos.types.proto.Album;
import com.google.photos.types.proto.MediaItem;
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 PhotosLibrary service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcPhotosLibraryStub extends PhotosLibraryStub {
private static final MethodDescriptor createAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/CreateAlbum")
.setRequestMarshaller(ProtoUtils.marshaller(CreateAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Album.getDefaultInstance()))
.build();
private static final MethodDescriptor
batchCreateMediaItemsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/BatchCreateMediaItems")
.setRequestMarshaller(
ProtoUtils.marshaller(BatchCreateMediaItemsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(BatchCreateMediaItemsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor<
BatchAddMediaItemsToAlbumRequest, BatchAddMediaItemsToAlbumResponse>
batchAddMediaItemsToAlbumMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/BatchAddMediaItemsToAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(BatchAddMediaItemsToAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(BatchAddMediaItemsToAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
searchMediaItemsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/SearchMediaItems")
.setRequestMarshaller(
ProtoUtils.marshaller(SearchMediaItemsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(SearchMediaItemsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listMediaItemsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/ListMediaItems")
.setRequestMarshaller(
ProtoUtils.marshaller(ListMediaItemsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListMediaItemsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
getMediaItemMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/GetMediaItem")
.setRequestMarshaller(ProtoUtils.marshaller(GetMediaItemRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(MediaItem.getDefaultInstance()))
.build();
private static final MethodDescriptor
batchGetMediaItemsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/BatchGetMediaItems")
.setRequestMarshaller(
ProtoUtils.marshaller(BatchGetMediaItemsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(BatchGetMediaItemsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listAlbumsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/ListAlbums")
.setRequestMarshaller(ProtoUtils.marshaller(ListAlbumsRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListAlbumsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/GetAlbum")
.setRequestMarshaller(ProtoUtils.marshaller(GetAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Album.getDefaultInstance()))
.build();
private static final MethodDescriptor
getSharedAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/GetSharedAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(GetSharedAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Album.getDefaultInstance()))
.build();
private static final MethodDescriptor
addEnrichmentToAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/AddEnrichmentToAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(AddEnrichmentToAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(AddEnrichmentToAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
joinSharedAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/JoinSharedAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(JoinSharedAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(JoinSharedAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
leaveSharedAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/LeaveSharedAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(LeaveSharedAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(LeaveSharedAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
shareAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/ShareAlbum")
.setRequestMarshaller(ProtoUtils.marshaller(ShareAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ShareAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listSharedAlbumsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/ListSharedAlbums")
.setRequestMarshaller(
ProtoUtils.marshaller(ListSharedAlbumsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListSharedAlbumsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
unshareAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/UnshareAlbum")
.setRequestMarshaller(ProtoUtils.marshaller(UnshareAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(UnshareAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor<
BatchRemoveMediaItemsFromAlbumRequest, BatchRemoveMediaItemsFromAlbumResponse>
batchRemoveMediaItemsFromAlbumMethodDescriptor =
MethodDescriptor
.
newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.photos.library.v1.PhotosLibrary/BatchRemoveMediaItemsFromAlbum")
.setRequestMarshaller(
ProtoUtils.marshaller(BatchRemoveMediaItemsFromAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(
BatchRemoveMediaItemsFromAlbumResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor updateAlbumMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/UpdateAlbum")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateAlbumRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Album.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateMediaItemMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.photos.library.v1.PhotosLibrary/UpdateMediaItem")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateMediaItemRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(MediaItem.getDefaultInstance()))
.build();
private final UnaryCallable createAlbumCallable;
private final UnaryCallable
batchCreateMediaItemsCallable;
private final UnaryCallable
batchAddMediaItemsToAlbumCallable;
private final UnaryCallable
searchMediaItemsCallable;
private final UnaryCallable
searchMediaItemsPagedCallable;
private final UnaryCallable listMediaItemsCallable;
private final UnaryCallable
listMediaItemsPagedCallable;
private final UnaryCallable getMediaItemCallable;
private final UnaryCallable
batchGetMediaItemsCallable;
private final UnaryCallable listAlbumsCallable;
private final UnaryCallable listAlbumsPagedCallable;
private final UnaryCallable getAlbumCallable;
private final UnaryCallable getSharedAlbumCallable;
private final UnaryCallable
addEnrichmentToAlbumCallable;
private final UnaryCallable
joinSharedAlbumCallable;
private final UnaryCallable
leaveSharedAlbumCallable;
private final UnaryCallable shareAlbumCallable;
private final UnaryCallable
listSharedAlbumsCallable;
private final UnaryCallable
listSharedAlbumsPagedCallable;
private final UnaryCallable unshareAlbumCallable;
private final UnaryCallable<
BatchRemoveMediaItemsFromAlbumRequest, BatchRemoveMediaItemsFromAlbumResponse>
batchRemoveMediaItemsFromAlbumCallable;
private final UnaryCallable updateAlbumCallable;
private final UnaryCallable updateMediaItemCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcPhotosLibraryStub create(PhotosLibraryStubSettings settings)
throws IOException {
return new GrpcPhotosLibraryStub(settings, ClientContext.create(settings));
}
public static final GrpcPhotosLibraryStub create(ClientContext clientContext) throws IOException {
return new GrpcPhotosLibraryStub(PhotosLibraryStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcPhotosLibraryStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcPhotosLibraryStub(
PhotosLibraryStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcPhotosLibraryStub, 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 GrpcPhotosLibraryStub(PhotosLibraryStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new GrpcPhotosLibraryCallableFactory());
}
/**
* Constructs an instance of GrpcPhotosLibraryStub, 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 GrpcPhotosLibraryStub(
PhotosLibraryStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings createAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createAlbumMethodDescriptor)
.build();
GrpcCallSettings
batchCreateMediaItemsTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(batchCreateMediaItemsMethodDescriptor)
.build();
GrpcCallSettings
batchAddMediaItemsToAlbumTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(batchAddMediaItemsToAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings
searchMediaItemsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(searchMediaItemsMethodDescriptor)
.build();
GrpcCallSettings
listMediaItemsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listMediaItemsMethodDescriptor)
.build();
GrpcCallSettings getMediaItemTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getMediaItemMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("media_item_id", String.valueOf(request.getMediaItemId()));
return params.build();
})
.build();
GrpcCallSettings
batchGetMediaItemsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(batchGetMediaItemsMethodDescriptor)
.build();
GrpcCallSettings listAlbumsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listAlbumsMethodDescriptor)
.build();
GrpcCallSettings getAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings getSharedAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getSharedAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("share_token", String.valueOf(request.getShareToken()));
return params.build();
})
.build();
GrpcCallSettings
addEnrichmentToAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(addEnrichmentToAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings
joinSharedAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(joinSharedAlbumMethodDescriptor)
.build();
GrpcCallSettings
leaveSharedAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(leaveSharedAlbumMethodDescriptor)
.build();
GrpcCallSettings shareAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(shareAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings
listSharedAlbumsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listSharedAlbumsMethodDescriptor)
.build();
GrpcCallSettings unshareAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(unshareAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings
batchRemoveMediaItemsFromAlbumTransportSettings =
GrpcCallSettings
.
newBuilder()
.setMethodDescriptor(batchRemoveMediaItemsFromAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album_id", String.valueOf(request.getAlbumId()));
return params.build();
})
.build();
GrpcCallSettings updateAlbumTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateAlbumMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("album.id", String.valueOf(request.getAlbum().getId()));
return params.build();
})
.build();
GrpcCallSettings updateMediaItemTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateMediaItemMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("media_item.id", String.valueOf(request.getMediaItem().getId()));
return params.build();
})
.build();
this.createAlbumCallable =
callableFactory.createUnaryCallable(
createAlbumTransportSettings, settings.createAlbumSettings(), clientContext);
this.batchCreateMediaItemsCallable =
callableFactory.createUnaryCallable(
batchCreateMediaItemsTransportSettings,
settings.batchCreateMediaItemsSettings(),
clientContext);
this.batchAddMediaItemsToAlbumCallable =
callableFactory.createUnaryCallable(
batchAddMediaItemsToAlbumTransportSettings,
settings.batchAddMediaItemsToAlbumSettings(),
clientContext);
this.searchMediaItemsCallable =
callableFactory.createUnaryCallable(
searchMediaItemsTransportSettings, settings.searchMediaItemsSettings(), clientContext);
this.searchMediaItemsPagedCallable =
callableFactory.createPagedCallable(
searchMediaItemsTransportSettings, settings.searchMediaItemsSettings(), clientContext);
this.listMediaItemsCallable =
callableFactory.createUnaryCallable(
listMediaItemsTransportSettings, settings.listMediaItemsSettings(), clientContext);
this.listMediaItemsPagedCallable =
callableFactory.createPagedCallable(
listMediaItemsTransportSettings, settings.listMediaItemsSettings(), clientContext);
this.getMediaItemCallable =
callableFactory.createUnaryCallable(
getMediaItemTransportSettings, settings.getMediaItemSettings(), clientContext);
this.batchGetMediaItemsCallable =
callableFactory.createUnaryCallable(
batchGetMediaItemsTransportSettings,
settings.batchGetMediaItemsSettings(),
clientContext);
this.listAlbumsCallable =
callableFactory.createUnaryCallable(
listAlbumsTransportSettings, settings.listAlbumsSettings(), clientContext);
this.listAlbumsPagedCallable =
callableFactory.createPagedCallable(
listAlbumsTransportSettings, settings.listAlbumsSettings(), clientContext);
this.getAlbumCallable =
callableFactory.createUnaryCallable(
getAlbumTransportSettings, settings.getAlbumSettings(), clientContext);
this.getSharedAlbumCallable =
callableFactory.createUnaryCallable(
getSharedAlbumTransportSettings, settings.getSharedAlbumSettings(), clientContext);
this.addEnrichmentToAlbumCallable =
callableFactory.createUnaryCallable(
addEnrichmentToAlbumTransportSettings,
settings.addEnrichmentToAlbumSettings(),
clientContext);
this.joinSharedAlbumCallable =
callableFactory.createUnaryCallable(
joinSharedAlbumTransportSettings, settings.joinSharedAlbumSettings(), clientContext);
this.leaveSharedAlbumCallable =
callableFactory.createUnaryCallable(
leaveSharedAlbumTransportSettings, settings.leaveSharedAlbumSettings(), clientContext);
this.shareAlbumCallable =
callableFactory.createUnaryCallable(
shareAlbumTransportSettings, settings.shareAlbumSettings(), clientContext);
this.listSharedAlbumsCallable =
callableFactory.createUnaryCallable(
listSharedAlbumsTransportSettings, settings.listSharedAlbumsSettings(), clientContext);
this.listSharedAlbumsPagedCallable =
callableFactory.createPagedCallable(
listSharedAlbumsTransportSettings, settings.listSharedAlbumsSettings(), clientContext);
this.unshareAlbumCallable =
callableFactory.createUnaryCallable(
unshareAlbumTransportSettings, settings.unshareAlbumSettings(), clientContext);
this.batchRemoveMediaItemsFromAlbumCallable =
callableFactory.createUnaryCallable(
batchRemoveMediaItemsFromAlbumTransportSettings,
settings.batchRemoveMediaItemsFromAlbumSettings(),
clientContext);
this.updateAlbumCallable =
callableFactory.createUnaryCallable(
updateAlbumTransportSettings, settings.updateAlbumSettings(), clientContext);
this.updateMediaItemCallable =
callableFactory.createUnaryCallable(
updateMediaItemTransportSettings, settings.updateMediaItemSettings(), clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable createAlbumCallable() {
return createAlbumCallable;
}
@Override
public UnaryCallable
batchCreateMediaItemsCallable() {
return batchCreateMediaItemsCallable;
}
@Override
public UnaryCallable
batchAddMediaItemsToAlbumCallable() {
return batchAddMediaItemsToAlbumCallable;
}
@Override
public UnaryCallable
searchMediaItemsCallable() {
return searchMediaItemsCallable;
}
@Override
public UnaryCallable
searchMediaItemsPagedCallable() {
return searchMediaItemsPagedCallable;
}
@Override
public UnaryCallable listMediaItemsCallable() {
return listMediaItemsCallable;
}
@Override
public UnaryCallable
listMediaItemsPagedCallable() {
return listMediaItemsPagedCallable;
}
@Override
public UnaryCallable getMediaItemCallable() {
return getMediaItemCallable;
}
@Override
public UnaryCallable
batchGetMediaItemsCallable() {
return batchGetMediaItemsCallable;
}
@Override
public UnaryCallable listAlbumsCallable() {
return listAlbumsCallable;
}
@Override
public UnaryCallable listAlbumsPagedCallable() {
return listAlbumsPagedCallable;
}
@Override
public UnaryCallable getAlbumCallable() {
return getAlbumCallable;
}
@Override
public UnaryCallable getSharedAlbumCallable() {
return getSharedAlbumCallable;
}
@Override
public UnaryCallable
addEnrichmentToAlbumCallable() {
return addEnrichmentToAlbumCallable;
}
@Override
public UnaryCallable joinSharedAlbumCallable() {
return joinSharedAlbumCallable;
}
@Override
public UnaryCallable
leaveSharedAlbumCallable() {
return leaveSharedAlbumCallable;
}
@Override
public UnaryCallable shareAlbumCallable() {
return shareAlbumCallable;
}
@Override
public UnaryCallable
listSharedAlbumsCallable() {
return listSharedAlbumsCallable;
}
@Override
public UnaryCallable
listSharedAlbumsPagedCallable() {
return listSharedAlbumsPagedCallable;
}
@Override
public UnaryCallable unshareAlbumCallable() {
return unshareAlbumCallable;
}
@Override
public UnaryCallable<
BatchRemoveMediaItemsFromAlbumRequest, BatchRemoveMediaItemsFromAlbumResponse>
batchRemoveMediaItemsFromAlbumCallable() {
return batchRemoveMediaItemsFromAlbumCallable;
}
@Override
public UnaryCallable updateAlbumCallable() {
return updateAlbumCallable;
}
@Override
public UnaryCallable updateMediaItemCallable() {
return updateMediaItemCallable;
}
@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);
}
}