@Generated(value="by GAPIC") @ExperimentalApi public class ErrorGroupServiceClient extends Object implements AutoCloseable
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:
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
GroupName groupName = GroupName.create("[PROJECT]", "[GROUP]");
ErrorGroup response = errorGroupServiceClient.getGroup(groupName);
}
Note: close() needs to be called on the errorGroupServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 ErrorGroupServiceSettings to create(). For example:
InstantiatingChannelProvider channelProvider =
ErrorGroupServiceSettings.defaultChannelProviderBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ErrorGroupServiceSettings errorGroupServiceSettings =
ErrorGroupServiceSettings.defaultBuilder().setChannelProvider(channelProvider).build();
ErrorGroupServiceClient errorGroupServiceClient =
ErrorGroupServiceClient.create(errorGroupServiceSettings);
| Modifier | Constructor and Description |
|---|---|
protected |
ErrorGroupServiceClient(ErrorGroupServiceSettings settings)
Constructs an instance of ErrorGroupServiceClient, using the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately
cancelled.
|
static ErrorGroupServiceClient |
create()
Constructs an instance of ErrorGroupServiceClient with default settings.
|
static ErrorGroupServiceClient |
create(ErrorGroupServiceSettings settings)
Constructs an instance of ErrorGroupServiceClient, using the given settings.
|
com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup |
getGroup(com.google.devtools.clouderrorreporting.v1beta1.GroupName groupName)
Get the specified group.
|
com.google.api.gax.grpc.UnaryCallable<com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest,com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup> |
getGroupCallable()
Get the specified group.
|
ErrorGroupServiceSettings |
getSettings() |
com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup |
updateGroup(com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup group)
Replace the data for the specified group.
|
com.google.api.gax.grpc.UnaryCallable<com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest,com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup> |
updateGroupCallable()
Replace the data for the specified group.
|
protected ErrorGroupServiceClient(ErrorGroupServiceSettings settings) throws IOException
IOExceptionpublic static final ErrorGroupServiceClient create() throws IOException
IOExceptionpublic static final ErrorGroupServiceClient create(ErrorGroupServiceSettings settings) throws IOException
IOExceptionpublic final ErrorGroupServiceSettings getSettings()
public final com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup getGroup(com.google.devtools.clouderrorreporting.v1beta1.GroupName groupName)
Sample code:
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
GroupName groupName = GroupName.create("[PROJECT]", "[GROUP]");
ErrorGroup response = errorGroupServiceClient.getGroup(groupName);
}
groupName - [Required] The group resource name. Written as
<code>projects/<var>projectID</var>/groups/<var>group_name</var></code>.
Call <a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list">
<code>groupStats.list</code></a> to return a list of groups belonging to
this project.
Example: <code>projects/my-project-123/groups/my-group</code>
com.google.api.gax.grpc.ApiException - if the remote call failspublic final com.google.api.gax.grpc.UnaryCallable<com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest,com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup> getGroupCallable()
Sample code:
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
GroupName groupName = GroupName.create("[PROJECT]", "[GROUP]");
GetGroupRequest request = GetGroupRequest.newBuilder()
.setGroupNameWithGroupName(groupName)
.build();
ApiFuture<ErrorGroup> future = errorGroupServiceClient.getGroupCallable().futureCall(request);
// Do something
ErrorGroup response = future.get();
}
public final com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup updateGroup(com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup group)
Sample code:
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
ErrorGroup group = ErrorGroup.newBuilder().build();
ErrorGroup response = errorGroupServiceClient.updateGroup(group);
}
group - [Required] The group which replaces the resource on the server.com.google.api.gax.grpc.ApiException - if the remote call failspublic final com.google.api.gax.grpc.UnaryCallable<com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest,com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup> updateGroupCallable()
Sample code:
try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
ErrorGroup group = ErrorGroup.newBuilder().build();
UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
.setGroup(group)
.build();
ApiFuture<ErrorGroup> future = errorGroupServiceClient.updateGroupCallable().futureCall(request);
// Do something
ErrorGroup response = future.get();
}
public final void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2017 Google. All rights reserved.