GitHub Repository | Product Reference |
Service Description: Service to access Developer Registration.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
RegisterGcpRequest request =
RegisterGcpRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.setDeveloperEmail("developerEmail251249138")
.build();
DeveloperRegistration response = developerRegistrationServiceClient.registerGcp(request);
}
Note: close() needs to be called on the DeveloperRegistrationServiceClient 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 |
---|---|---|
RegisterGcp |
Registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an "API developer" and add the "developer_email" as a contact with "API notifications" email preference on. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDeveloperRegistration |
Retrieves a developer registration for a merchant. |
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.
|
UnregisterGcp |
Unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
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 DeveloperRegistrationServiceSettings 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
DeveloperRegistrationServiceSettings developerRegistrationServiceSettings =
DeveloperRegistrationServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create(developerRegistrationServiceSettings);
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
DeveloperRegistrationServiceSettings developerRegistrationServiceSettings =
DeveloperRegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create(developerRegistrationServiceSettings);
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
DeveloperRegistrationServiceSettings developerRegistrationServiceSettings =
DeveloperRegistrationServiceSettings.newHttpJsonBuilder().build();
DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create(developerRegistrationServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final DeveloperRegistrationServiceClient create()
Constructs an instance of DeveloperRegistrationServiceClient with default settings.
Returns | |
---|---|
Type | Description |
DeveloperRegistrationServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(DeveloperRegistrationServiceSettings settings)
public static final DeveloperRegistrationServiceClient create(DeveloperRegistrationServiceSettings settings)
Constructs an instance of DeveloperRegistrationServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings |
DeveloperRegistrationServiceSettings |
Returns | |
---|---|
Type | Description |
DeveloperRegistrationServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(DeveloperRegistrationServiceStub stub)
public static final DeveloperRegistrationServiceClient create(DeveloperRegistrationServiceStub stub)
Constructs an instance of DeveloperRegistrationServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DeveloperRegistrationServiceSettings).
Parameter | |
---|---|
Name | Description |
stub |
DeveloperRegistrationServiceStub |
Returns | |
---|---|
Type | Description |
DeveloperRegistrationServiceClient |
Constructors
DeveloperRegistrationServiceClient(DeveloperRegistrationServiceSettings settings)
protected DeveloperRegistrationServiceClient(DeveloperRegistrationServiceSettings settings)
Constructs an instance of DeveloperRegistrationServiceClient, 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.
Parameter | |
---|---|
Name | Description |
settings |
DeveloperRegistrationServiceSettings |
DeveloperRegistrationServiceClient(DeveloperRegistrationServiceStub stub)
protected DeveloperRegistrationServiceClient(DeveloperRegistrationServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub |
DeveloperRegistrationServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
getDeveloperRegistration(DeveloperRegistrationName name)
public final DeveloperRegistration getDeveloperRegistration(DeveloperRegistrationName name)
Retrieves a developer registration for a merchant.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
DeveloperRegistrationName name = DeveloperRegistrationName.of("[ACCOUNT]");
DeveloperRegistration response =
developerRegistrationServiceClient.getDeveloperRegistration(name);
}
Parameter | |
---|---|
Name | Description |
name |
DeveloperRegistrationName Required. The |
Returns | |
---|---|
Type | Description |
DeveloperRegistration |
getDeveloperRegistration(GetDeveloperRegistrationRequest request)
public final DeveloperRegistration getDeveloperRegistration(GetDeveloperRegistrationRequest request)
Retrieves a developer registration for a merchant.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
GetDeveloperRegistrationRequest request =
GetDeveloperRegistrationRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.build();
DeveloperRegistration response =
developerRegistrationServiceClient.getDeveloperRegistration(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetDeveloperRegistrationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
DeveloperRegistration |
getDeveloperRegistration(String name)
public final DeveloperRegistration getDeveloperRegistration(String name)
Retrieves a developer registration for a merchant.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
String name = DeveloperRegistrationName.of("[ACCOUNT]").toString();
DeveloperRegistration response =
developerRegistrationServiceClient.getDeveloperRegistration(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The |
Returns | |
---|---|
Type | Description |
DeveloperRegistration |
getDeveloperRegistrationCallable()
public final UnaryCallable<GetDeveloperRegistrationRequest,DeveloperRegistration> getDeveloperRegistrationCallable()
Retrieves a developer registration for a merchant.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
GetDeveloperRegistrationRequest request =
GetDeveloperRegistrationRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.build();
ApiFuture<DeveloperRegistration> future =
developerRegistrationServiceClient.getDeveloperRegistrationCallable().futureCall(request);
// Do something.
DeveloperRegistration response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetDeveloperRegistrationRequest,DeveloperRegistration> |
getSettings()
public final DeveloperRegistrationServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
DeveloperRegistrationServiceSettings |
getStub()
public DeveloperRegistrationServiceStub getStub()
Returns | |
---|---|
Type | Description |
DeveloperRegistrationServiceStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
registerGcp(RegisterGcpRequest request)
public final DeveloperRegistration registerGcp(RegisterGcpRequest request)
Registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an "API developer" and add the "developer_email" as a contact with "API notifications" email preference on.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
RegisterGcpRequest request =
RegisterGcpRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.setDeveloperEmail("developerEmail251249138")
.build();
DeveloperRegistration response = developerRegistrationServiceClient.registerGcp(request);
}
Parameter | |
---|---|
Name | Description |
request |
RegisterGcpRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
DeveloperRegistration |
registerGcpCallable()
public final UnaryCallable<RegisterGcpRequest,DeveloperRegistration> registerGcpCallable()
Registers the GCP used for the API call to the shopping account passed in the request. Will create a user with an "API developer" and add the "developer_email" as a contact with "API notifications" email preference on.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
RegisterGcpRequest request =
RegisterGcpRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.setDeveloperEmail("developerEmail251249138")
.build();
ApiFuture<DeveloperRegistration> future =
developerRegistrationServiceClient.registerGcpCallable().futureCall(request);
// Do something.
DeveloperRegistration response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RegisterGcpRequest,DeveloperRegistration> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
unregisterGcp(UnregisterGcpRequest request)
public final void unregisterGcp(UnregisterGcpRequest request)
Unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
UnregisterGcpRequest request =
UnregisterGcpRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.build();
developerRegistrationServiceClient.unregisterGcp(request);
}
Parameter | |
---|---|
Name | Description |
request |
UnregisterGcpRequest The request object containing all of the parameters for the API call. |
unregisterGcpCallable()
public final UnaryCallable<UnregisterGcpRequest,Empty> unregisterGcpCallable()
Unregister the calling GCP from the calling shopping account. Note that the GCP will still be able to access the API for at most 1 day from the unregister succussful call.
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 (DeveloperRegistrationServiceClient developerRegistrationServiceClient =
DeveloperRegistrationServiceClient.create()) {
UnregisterGcpRequest request =
UnregisterGcpRequest.newBuilder()
.setName(DeveloperRegistrationName.of("[ACCOUNT]").toString())
.build();
ApiFuture<Empty> future =
developerRegistrationServiceClient.unregisterGcpCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UnregisterGcpRequest,Empty> |