@BetaApi @Generated(value="by gapic-generator-java") public class SpacesServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
Space space = Space.newBuilder().build();
Space response = spacesServiceClient.createSpace(space);
}
Note: close() needs to be called on the SpacesServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateSpace |
[Developer Preview](https://developers.google.com/workspace/preview). Creates a space. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSpace |
[Developer Preview](https://developers.google.com/workspace/preview). Gets a space by `space_id` or `meeting_code`. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSpace |
[Developer Preview](https://developers.google.com/workspace/preview). Updates a space. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
EndActiveConference |
[Developer Preview](https://developers.google.com/workspace/preview). Ends an active conference (if there is one). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of SpacesServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SpacesServiceSettings spacesServiceSettings =
SpacesServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SpacesServiceClient spacesServiceClient = SpacesServiceClient.create(spacesServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SpacesServiceSettings spacesServiceSettings =
SpacesServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
SpacesServiceClient spacesServiceClient = SpacesServiceClient.create(spacesServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SpacesServiceSettings spacesServiceSettings =
SpacesServiceSettings.newHttpJsonBuilder().build();
SpacesServiceClient spacesServiceClient = SpacesServiceClient.create(spacesServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
SpacesServiceClient(SpacesServiceSettings settings)
Constructs an instance of SpacesServiceClient, using the given settings.
|
protected |
SpacesServiceClient(SpacesServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static SpacesServiceClient |
create()
Constructs an instance of SpacesServiceClient with default settings.
|
static SpacesServiceClient |
create(SpacesServiceSettings settings)
Constructs an instance of SpacesServiceClient, using the given settings.
|
static SpacesServiceClient |
create(SpacesServiceStub stub)
Constructs an instance of SpacesServiceClient, using the given stub for making calls.
|
Space |
createSpace(CreateSpaceRequest request)
[Developer Preview](https://developers.google.com/workspace/preview).
|
Space |
createSpace(Space space)
[Developer Preview](https://developers.google.com/workspace/preview).
|
com.google.api.gax.rpc.UnaryCallable<CreateSpaceRequest,Space> |
createSpaceCallable()
[Developer Preview](https://developers.google.com/workspace/preview).
|
void |
endActiveConference(EndActiveConferenceRequest request)
[Developer Preview](https://developers.google.com/workspace/preview).
|
void |
endActiveConference(SpaceName name)
[Developer Preview](https://developers.google.com/workspace/preview).
|
void |
endActiveConference(String name)
[Developer Preview](https://developers.google.com/workspace/preview).
|
com.google.api.gax.rpc.UnaryCallable<EndActiveConferenceRequest,com.google.protobuf.Empty> |
endActiveConferenceCallable()
[Developer Preview](https://developers.google.com/workspace/preview).
|
SpacesServiceSettings |
getSettings() |
Space |
getSpace(GetSpaceRequest request)
[Developer Preview](https://developers.google.com/workspace/preview).
|
Space |
getSpace(SpaceName name)
[Developer Preview](https://developers.google.com/workspace/preview).
|
Space |
getSpace(String name)
[Developer Preview](https://developers.google.com/workspace/preview).
|
com.google.api.gax.rpc.UnaryCallable<GetSpaceRequest,Space> |
getSpaceCallable()
[Developer Preview](https://developers.google.com/workspace/preview).
|
SpacesServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
void |
shutdownNow() |
Space |
updateSpace(Space space,
com.google.protobuf.FieldMask updateMask)
[Developer Preview](https://developers.google.com/workspace/preview).
|
Space |
updateSpace(UpdateSpaceRequest request)
[Developer Preview](https://developers.google.com/workspace/preview).
|
com.google.api.gax.rpc.UnaryCallable<UpdateSpaceRequest,Space> |
updateSpaceCallable()
[Developer Preview](https://developers.google.com/workspace/preview).
|
protected SpacesServiceClient(SpacesServiceSettings settings) throws IOException
IOExceptionprotected SpacesServiceClient(SpacesServiceStub stub)
public static final SpacesServiceClient create() throws IOException
IOExceptionpublic static final SpacesServiceClient create(SpacesServiceSettings settings) throws IOException
IOExceptionpublic static final SpacesServiceClient create(SpacesServiceStub stub)
public final SpacesServiceSettings getSettings()
public SpacesServiceStub getStub()
public final Space createSpace(Space space)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
Space space = Space.newBuilder().build();
Space response = spacesServiceClient.createSpace(space);
}
space - Space to be created. As of May 2023, the input space can be empty. Later on the
input space can be non-empty when space configuration is introduced.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Space createSpace(CreateSpaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
CreateSpaceRequest request =
CreateSpaceRequest.newBuilder().setSpace(Space.newBuilder().build()).build();
Space response = spacesServiceClient.createSpace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateSpaceRequest,Space> createSpaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
CreateSpaceRequest request =
CreateSpaceRequest.newBuilder().setSpace(Space.newBuilder().build()).build();
ApiFuture<Space> future = spacesServiceClient.createSpaceCallable().futureCall(request);
// Do something.
Space response = future.get();
}
public final Space getSpace(SpaceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
SpaceName name = SpaceName.of("[SPACE]");
Space response = spacesServiceClient.getSpace(name);
}
name - Required. Resource name of the space.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Space getSpace(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
String name = SpaceName.of("[SPACE]").toString();
Space response = spacesServiceClient.getSpace(name);
}
name - Required. Resource name of the space.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Space getSpace(GetSpaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
GetSpaceRequest request =
GetSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
Space response = spacesServiceClient.getSpace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetSpaceRequest,Space> getSpaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
GetSpaceRequest request =
GetSpaceRequest.newBuilder().setName(SpaceName.of("[SPACE]").toString()).build();
ApiFuture<Space> future = spacesServiceClient.getSpaceCallable().futureCall(request);
// Do something.
Space response = future.get();
}
public final Space updateSpace(Space space, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
Space space = Space.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Space response = spacesServiceClient.updateSpace(space, updateMask);
}
space - Required. Space to be updated.updateMask - Optional. Field mask used to specify the fields to be updated in the space.
If update_mask isn't provided, it defaults to '*' and updates all fields provided in
the request, including deleting fields not set in the request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Space updateSpace(UpdateSpaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
UpdateSpaceRequest request =
UpdateSpaceRequest.newBuilder()
.setSpace(Space.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Space response = spacesServiceClient.updateSpace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateSpaceRequest,Space> updateSpaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
UpdateSpaceRequest request =
UpdateSpaceRequest.newBuilder()
.setSpace(Space.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Space> future = spacesServiceClient.updateSpaceCallable().futureCall(request);
// Do something.
Space response = future.get();
}
public final void endActiveConference(SpaceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
SpaceName name = SpaceName.of("[SPACE]");
spacesServiceClient.endActiveConference(name);
}
name - Required. Resource name of the space.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void endActiveConference(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
String name = SpaceName.of("[SPACE]").toString();
spacesServiceClient.endActiveConference(name);
}
name - Required. Resource name of the space.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void endActiveConference(EndActiveConferenceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
EndActiveConferenceRequest request =
EndActiveConferenceRequest.newBuilder()
.setName(SpaceName.of("[SPACE]").toString())
.build();
spacesServiceClient.endActiveConference(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<EndActiveConferenceRequest,com.google.protobuf.Empty> endActiveConferenceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SpacesServiceClient spacesServiceClient = SpacesServiceClient.create()) {
EndActiveConferenceRequest request =
EndActiveConferenceRequest.newBuilder()
.setName(SpaceName.of("[SPACE]").toString())
.build();
ApiFuture<Empty> future =
spacesServiceClient.endActiveConferenceCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.