@Generated(value="by gapic-generator-java") public class ParameterManagerClient 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterName name = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]");
Parameter response = parameterManagerClient.getParameter(name);
}
Note: close() needs to be called on the ParameterManagerClient 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 |
|---|---|---|
ListParameters |
Lists Parameters in a given project and location. |
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.
|
GetParameter |
Gets details of a single Parameter. |
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.
|
CreateParameter |
Creates a new Parameter in a given project and location. |
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.
|
UpdateParameter |
Updates a single Parameter. |
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.
|
DeleteParameter |
Deletes a single Parameter. |
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.
|
ListParameterVersions |
Lists ParameterVersions in a given project, location, and parameter. |
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.
|
GetParameterVersion |
Gets details of a single ParameterVersion. |
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.
|
RenderParameterVersion |
Gets rendered version of a ParameterVersion. |
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.
|
CreateParameterVersion |
Creates a new ParameterVersion in a given project, location, and parameter. |
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.
|
UpdateParameterVersion |
Updates a single ParameterVersion. |
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.
|
DeleteParameterVersion |
Deletes a single ParameterVersion. |
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.
|
ListLocations |
Lists information about the supported locations for this service. |
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.
|
GetLocation |
Gets information about a location. |
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 ParameterManagerSettings 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
ParameterManagerSettings parameterManagerSettings =
ParameterManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ParameterManagerClient parameterManagerClient =
ParameterManagerClient.create(parameterManagerSettings);
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
ParameterManagerSettings parameterManagerSettings =
ParameterManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
ParameterManagerClient parameterManagerClient =
ParameterManagerClient.create(parameterManagerSettings);
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
ParameterManagerSettings parameterManagerSettings =
ParameterManagerSettings.newHttpJsonBuilder().build();
ParameterManagerClient parameterManagerClient =
ParameterManagerClient.create(parameterManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterManagerClient.ListLocationsFixedSizeCollection |
static class |
ParameterManagerClient.ListLocationsPage |
static class |
ParameterManagerClient.ListLocationsPagedResponse |
static class |
ParameterManagerClient.ListParametersFixedSizeCollection |
static class |
ParameterManagerClient.ListParametersPage |
static class |
ParameterManagerClient.ListParametersPagedResponse |
static class |
ParameterManagerClient.ListParameterVersionsFixedSizeCollection |
static class |
ParameterManagerClient.ListParameterVersionsPage |
static class |
ParameterManagerClient.ListParameterVersionsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
ParameterManagerClient(ParameterManagerSettings settings)
Constructs an instance of ParameterManagerClient, using the given settings.
|
protected |
ParameterManagerClient(ParameterManagerStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ParameterManagerClient |
create()
Constructs an instance of ParameterManagerClient with default settings.
|
static ParameterManagerClient |
create(ParameterManagerSettings settings)
Constructs an instance of ParameterManagerClient, using the given settings.
|
static ParameterManagerClient |
create(ParameterManagerStub stub)
Constructs an instance of ParameterManagerClient, using the given stub for making calls.
|
Parameter |
createParameter(CreateParameterRequest request)
Creates a new Parameter in a given project and location.
|
Parameter |
createParameter(LocationName parent,
Parameter parameter,
String parameterId)
Creates a new Parameter in a given project and location.
|
Parameter |
createParameter(String parent,
Parameter parameter,
String parameterId)
Creates a new Parameter in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateParameterRequest,Parameter> |
createParameterCallable()
Creates a new Parameter in a given project and location.
|
ParameterVersion |
createParameterVersion(CreateParameterVersionRequest request)
Creates a new ParameterVersion in a given project, location, and parameter.
|
ParameterVersion |
createParameterVersion(ParameterName parent,
ParameterVersion parameterVersion,
String parameterVersionId)
Creates a new ParameterVersion in a given project, location, and parameter.
|
ParameterVersion |
createParameterVersion(String parent,
ParameterVersion parameterVersion,
String parameterVersionId)
Creates a new ParameterVersion in a given project, location, and parameter.
|
com.google.api.gax.rpc.UnaryCallable<CreateParameterVersionRequest,ParameterVersion> |
createParameterVersionCallable()
Creates a new ParameterVersion in a given project, location, and parameter.
|
void |
deleteParameter(DeleteParameterRequest request)
Deletes a single Parameter.
|
void |
deleteParameter(ParameterName name)
Deletes a single Parameter.
|
void |
deleteParameter(String name)
Deletes a single Parameter.
|
com.google.api.gax.rpc.UnaryCallable<DeleteParameterRequest,com.google.protobuf.Empty> |
deleteParameterCallable()
Deletes a single Parameter.
|
void |
deleteParameterVersion(DeleteParameterVersionRequest request)
Deletes a single ParameterVersion.
|
void |
deleteParameterVersion(ParameterVersionName name)
Deletes a single ParameterVersion.
|
void |
deleteParameterVersion(String name)
Deletes a single ParameterVersion.
|
com.google.api.gax.rpc.UnaryCallable<DeleteParameterVersionRequest,com.google.protobuf.Empty> |
deleteParameterVersionCallable()
Deletes a single ParameterVersion.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
Parameter |
getParameter(GetParameterRequest request)
Gets details of a single Parameter.
|
Parameter |
getParameter(ParameterName name)
Gets details of a single Parameter.
|
Parameter |
getParameter(String name)
Gets details of a single Parameter.
|
com.google.api.gax.rpc.UnaryCallable<GetParameterRequest,Parameter> |
getParameterCallable()
Gets details of a single Parameter.
|
ParameterVersion |
getParameterVersion(GetParameterVersionRequest request)
Gets details of a single ParameterVersion.
|
ParameterVersion |
getParameterVersion(ParameterVersionName name)
Gets details of a single ParameterVersion.
|
ParameterVersion |
getParameterVersion(String name)
Gets details of a single ParameterVersion.
|
com.google.api.gax.rpc.UnaryCallable<GetParameterVersionRequest,ParameterVersion> |
getParameterVersionCallable()
Gets details of a single ParameterVersion.
|
ParameterManagerSettings |
getSettings() |
ParameterManagerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ParameterManagerClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ParameterManagerClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
ParameterManagerClient.ListParametersPagedResponse |
listParameters(ListParametersRequest request)
Lists Parameters in a given project and location.
|
ParameterManagerClient.ListParametersPagedResponse |
listParameters(LocationName parent)
Lists Parameters in a given project and location.
|
ParameterManagerClient.ListParametersPagedResponse |
listParameters(String parent)
Lists Parameters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListParametersRequest,ListParametersResponse> |
listParametersCallable()
Lists Parameters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListParametersRequest,ParameterManagerClient.ListParametersPagedResponse> |
listParametersPagedCallable()
Lists Parameters in a given project and location.
|
ParameterManagerClient.ListParameterVersionsPagedResponse |
listParameterVersions(ListParameterVersionsRequest request)
Lists ParameterVersions in a given project, location, and parameter.
|
ParameterManagerClient.ListParameterVersionsPagedResponse |
listParameterVersions(ParameterName parent)
Lists ParameterVersions in a given project, location, and parameter.
|
ParameterManagerClient.ListParameterVersionsPagedResponse |
listParameterVersions(String parent)
Lists ParameterVersions in a given project, location, and parameter.
|
com.google.api.gax.rpc.UnaryCallable<ListParameterVersionsRequest,ListParameterVersionsResponse> |
listParameterVersionsCallable()
Lists ParameterVersions in a given project, location, and parameter.
|
com.google.api.gax.rpc.UnaryCallable<ListParameterVersionsRequest,ParameterManagerClient.ListParameterVersionsPagedResponse> |
listParameterVersionsPagedCallable()
Lists ParameterVersions in a given project, location, and parameter.
|
RenderParameterVersionResponse |
renderParameterVersion(ParameterVersionName name)
Gets rendered version of a ParameterVersion.
|
RenderParameterVersionResponse |
renderParameterVersion(RenderParameterVersionRequest request)
Gets rendered version of a ParameterVersion.
|
RenderParameterVersionResponse |
renderParameterVersion(String name)
Gets rendered version of a ParameterVersion.
|
com.google.api.gax.rpc.UnaryCallable<RenderParameterVersionRequest,RenderParameterVersionResponse> |
renderParameterVersionCallable()
Gets rendered version of a ParameterVersion.
|
void |
shutdown() |
void |
shutdownNow() |
Parameter |
updateParameter(Parameter parameter,
com.google.protobuf.FieldMask updateMask)
Updates a single Parameter.
|
Parameter |
updateParameter(UpdateParameterRequest request)
Updates a single Parameter.
|
com.google.api.gax.rpc.UnaryCallable<UpdateParameterRequest,Parameter> |
updateParameterCallable()
Updates a single Parameter.
|
ParameterVersion |
updateParameterVersion(ParameterVersion parameterVersion,
com.google.protobuf.FieldMask updateMask)
Updates a single ParameterVersion.
|
ParameterVersion |
updateParameterVersion(UpdateParameterVersionRequest request)
Updates a single ParameterVersion.
|
com.google.api.gax.rpc.UnaryCallable<UpdateParameterVersionRequest,ParameterVersion> |
updateParameterVersionCallable()
Updates a single ParameterVersion.
|
protected ParameterManagerClient(ParameterManagerSettings settings) throws IOException
IOExceptionprotected ParameterManagerClient(ParameterManagerStub stub)
public static final ParameterManagerClient create() throws IOException
IOExceptionpublic static final ParameterManagerClient create(ParameterManagerSettings settings) throws IOException
IOExceptionpublic static final ParameterManagerClient create(ParameterManagerStub stub)
public final ParameterManagerSettings getSettings()
public ParameterManagerStub getStub()
public final ParameterManagerClient.ListParametersPagedResponse listParameters(LocationName parent)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Parameter element : parameterManagerClient.listParameters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListParametersRequest in the format
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterManagerClient.ListParametersPagedResponse listParameters(String parent)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Parameter element : parameterManagerClient.listParameters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListParametersRequest in the format
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterManagerClient.ListParametersPagedResponse listParameters(ListParametersRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParametersRequest request =
ListParametersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Parameter element : parameterManagerClient.listParameters(request).iterateAll()) {
// doThingsWith(element);
}
}
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<ListParametersRequest,ParameterManagerClient.ListParametersPagedResponse> listParametersPagedCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParametersRequest request =
ListParametersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Parameter> future =
parameterManagerClient.listParametersPagedCallable().futureCall(request);
// Do something.
for (Parameter element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListParametersRequest,ListParametersResponse> listParametersCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParametersRequest request =
ListParametersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListParametersResponse response =
parameterManagerClient.listParametersCallable().call(request);
for (Parameter element : response.getParametersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Parameter getParameter(ParameterName 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterName name = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]");
Parameter response = parameterManagerClient.getParameter(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Parameter getParameter(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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String name = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString();
Parameter response = parameterManagerClient.getParameter(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Parameter getParameter(GetParameterRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetParameterRequest request =
GetParameterRequest.newBuilder()
.setName(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.build();
Parameter response = parameterManagerClient.getParameter(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<GetParameterRequest,Parameter> getParameterCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetParameterRequest request =
GetParameterRequest.newBuilder()
.setName(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.build();
ApiFuture<Parameter> future =
parameterManagerClient.getParameterCallable().futureCall(request);
// Do something.
Parameter response = future.get();
}
public final Parameter createParameter(LocationName parent, Parameter parameter, String parameterId)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Parameter parameter = Parameter.newBuilder().build();
String parameterId = "parameterId1335916196";
Parameter response = parameterManagerClient.createParameter(parent, parameter, parameterId);
}
parent - Required. Value for parent in the format `projects/*/locations/*`.parameter - Required. The Parameter resource being createdparameterId - Required. Id of the Parameter resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final Parameter createParameter(String parent, Parameter parameter, String parameterId)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Parameter parameter = Parameter.newBuilder().build();
String parameterId = "parameterId1335916196";
Parameter response = parameterManagerClient.createParameter(parent, parameter, parameterId);
}
parent - Required. Value for parent in the format `projects/*/locations/*`.parameter - Required. The Parameter resource being createdparameterId - Required. Id of the Parameter resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final Parameter createParameter(CreateParameterRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
CreateParameterRequest request =
CreateParameterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setParameterId("parameterId1335916196")
.setParameter(Parameter.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Parameter response = parameterManagerClient.createParameter(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<CreateParameterRequest,Parameter> createParameterCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
CreateParameterRequest request =
CreateParameterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setParameterId("parameterId1335916196")
.setParameter(Parameter.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Parameter> future =
parameterManagerClient.createParameterCallable().futureCall(request);
// Do something.
Parameter response = future.get();
}
public final Parameter updateParameter(Parameter parameter, 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
Parameter parameter = Parameter.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Parameter response = parameterManagerClient.updateParameter(parameter, updateMask);
}
parameter - Required. The Parameter resource being updatedupdateMask - Optional. Field mask is used to specify the fields to be overwritten in the
Parameter resource by the update. The fields specified in the update_mask are relative to
the resource, not the full request. A mutable field will be overwritten if it is in the
mask. If the user does not provide a mask then all mutable fields present in the request
will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Parameter updateParameter(UpdateParameterRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
UpdateParameterRequest request =
UpdateParameterRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setParameter(Parameter.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Parameter response = parameterManagerClient.updateParameter(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<UpdateParameterRequest,Parameter> updateParameterCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
UpdateParameterRequest request =
UpdateParameterRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setParameter(Parameter.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Parameter> future =
parameterManagerClient.updateParameterCallable().futureCall(request);
// Do something.
Parameter response = future.get();
}
public final void deleteParameter(ParameterName 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterName name = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]");
parameterManagerClient.deleteParameter(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteParameter(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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String name = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString();
parameterManagerClient.deleteParameter(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteParameter(DeleteParameterRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
DeleteParameterRequest request =
DeleteParameterRequest.newBuilder()
.setName(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setRequestId("requestId693933066")
.build();
parameterManagerClient.deleteParameter(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<DeleteParameterRequest,com.google.protobuf.Empty> deleteParameterCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
DeleteParameterRequest request =
DeleteParameterRequest.newBuilder()
.setName(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Empty> future =
parameterManagerClient.deleteParameterCallable().futureCall(request);
// Do something.
future.get();
}
public final ParameterManagerClient.ListParameterVersionsPagedResponse listParameterVersions(ParameterName parent)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterName parent = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]");
for (ParameterVersion element :
parameterManagerClient.listParameterVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListParameterVersionsRequest in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterManagerClient.ListParameterVersionsPagedResponse listParameterVersions(String parent)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String parent = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString();
for (ParameterVersion element :
parameterManagerClient.listParameterVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Parent value for ListParameterVersionsRequest in the format
`projects/*/locations/*/parameters/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterManagerClient.ListParameterVersionsPagedResponse listParameterVersions(ListParameterVersionsRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParameterVersionsRequest request =
ListParameterVersionsRequest.newBuilder()
.setParent(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (ParameterVersion element :
parameterManagerClient.listParameterVersions(request).iterateAll()) {
// doThingsWith(element);
}
}
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<ListParameterVersionsRequest,ParameterManagerClient.ListParameterVersionsPagedResponse> listParameterVersionsPagedCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParameterVersionsRequest request =
ListParameterVersionsRequest.newBuilder()
.setParent(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<ParameterVersion> future =
parameterManagerClient.listParameterVersionsPagedCallable().futureCall(request);
// Do something.
for (ParameterVersion element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListParameterVersionsRequest,ListParameterVersionsResponse> listParameterVersionsCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListParameterVersionsRequest request =
ListParameterVersionsRequest.newBuilder()
.setParent(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListParameterVersionsResponse response =
parameterManagerClient.listParameterVersionsCallable().call(request);
for (ParameterVersion element : response.getParameterVersionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ParameterVersion getParameterVersion(ParameterVersionName 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterVersionName name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]");
ParameterVersion response = parameterManagerClient.getParameterVersion(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*/versions/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterVersion getParameterVersion(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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString();
ParameterVersion response = parameterManagerClient.getParameterVersion(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*/versions/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterVersion getParameterVersion(GetParameterVersionRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetParameterVersionRequest request =
GetParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.setView(View.forNumber(0))
.build();
ParameterVersion response = parameterManagerClient.getParameterVersion(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<GetParameterVersionRequest,ParameterVersion> getParameterVersionCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetParameterVersionRequest request =
GetParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.setView(View.forNumber(0))
.build();
ApiFuture<ParameterVersion> future =
parameterManagerClient.getParameterVersionCallable().futureCall(request);
// Do something.
ParameterVersion response = future.get();
}
public final RenderParameterVersionResponse renderParameterVersion(ParameterVersionName 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterVersionName name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]");
RenderParameterVersionResponse response = parameterManagerClient.renderParameterVersion(name);
}
name - Required. Name of the resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final RenderParameterVersionResponse renderParameterVersion(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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString();
RenderParameterVersionResponse response = parameterManagerClient.renderParameterVersion(name);
}
name - Required. Name of the resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final RenderParameterVersionResponse renderParameterVersion(RenderParameterVersionRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
RenderParameterVersionRequest request =
RenderParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.build();
RenderParameterVersionResponse response =
parameterManagerClient.renderParameterVersion(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<RenderParameterVersionRequest,RenderParameterVersionResponse> renderParameterVersionCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
RenderParameterVersionRequest request =
RenderParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.build();
ApiFuture<RenderParameterVersionResponse> future =
parameterManagerClient.renderParameterVersionCallable().futureCall(request);
// Do something.
RenderParameterVersionResponse response = future.get();
}
public final ParameterVersion createParameterVersion(ParameterName parent, ParameterVersion parameterVersion, String parameterVersionId)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterName parent = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]");
ParameterVersion parameterVersion = ParameterVersion.newBuilder().build();
String parameterVersionId = "parameterVersionId2070530666";
ParameterVersion response =
parameterManagerClient.createParameterVersion(
parent, parameterVersion, parameterVersionId);
}
parent - Required. Value for parent in the format
`projects/*/locations/*/parameters/*`.parameterVersion - Required. The ParameterVersion resource being createdparameterVersionId - Required. Id of the ParameterVersion resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterVersion createParameterVersion(String parent, ParameterVersion parameterVersion, String parameterVersionId)
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String parent = ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString();
ParameterVersion parameterVersion = ParameterVersion.newBuilder().build();
String parameterVersionId = "parameterVersionId2070530666";
ParameterVersion response =
parameterManagerClient.createParameterVersion(
parent, parameterVersion, parameterVersionId);
}
parent - Required. Value for parent in the format
`projects/*/locations/*/parameters/*`.parameterVersion - Required. The ParameterVersion resource being createdparameterVersionId - Required. Id of the ParameterVersion resourcecom.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterVersion createParameterVersion(CreateParameterVersionRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
CreateParameterVersionRequest request =
CreateParameterVersionRequest.newBuilder()
.setParent(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setParameterVersionId("parameterVersionId2070530666")
.setParameterVersion(ParameterVersion.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ParameterVersion response = parameterManagerClient.createParameterVersion(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<CreateParameterVersionRequest,ParameterVersion> createParameterVersionCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
CreateParameterVersionRequest request =
CreateParameterVersionRequest.newBuilder()
.setParent(ParameterName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]").toString())
.setParameterVersionId("parameterVersionId2070530666")
.setParameterVersion(ParameterVersion.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<ParameterVersion> future =
parameterManagerClient.createParameterVersionCallable().futureCall(request);
// Do something.
ParameterVersion response = future.get();
}
public final ParameterVersion updateParameterVersion(ParameterVersion parameterVersion, 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterVersion parameterVersion = ParameterVersion.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ParameterVersion response =
parameterManagerClient.updateParameterVersion(parameterVersion, updateMask);
}
parameterVersion - Required. The ParameterVersion resource being updatedupdateMask - Optional. Field mask is used to specify the fields to be overwritten in the
ParameterVersion resource by the update. The fields specified in the update_mask are
relative to the resource, not the full request. A mutable field will be overwritten if it
is in the mask. If the user does not provide a mask then all mutable fields present in the
request will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ParameterVersion updateParameterVersion(UpdateParameterVersionRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
UpdateParameterVersionRequest request =
UpdateParameterVersionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setParameterVersion(ParameterVersion.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ParameterVersion response = parameterManagerClient.updateParameterVersion(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<UpdateParameterVersionRequest,ParameterVersion> updateParameterVersionCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
UpdateParameterVersionRequest request =
UpdateParameterVersionRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setParameterVersion(ParameterVersion.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<ParameterVersion> future =
parameterManagerClient.updateParameterVersionCallable().futureCall(request);
// Do something.
ParameterVersion response = future.get();
}
public final void deleteParameterVersion(ParameterVersionName 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ParameterVersionName name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]");
parameterManagerClient.deleteParameterVersion(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*/versions/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteParameterVersion(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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
String name =
ParameterVersionName.of("[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString();
parameterManagerClient.deleteParameterVersion(name);
}
name - Required. Name of the resource in the format
`projects/*/locations/*/parameters/*/versions/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteParameterVersion(DeleteParameterVersionRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
DeleteParameterVersionRequest request =
DeleteParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.setRequestId("requestId693933066")
.build();
parameterManagerClient.deleteParameterVersion(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<DeleteParameterVersionRequest,com.google.protobuf.Empty> deleteParameterVersionCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
DeleteParameterVersionRequest request =
DeleteParameterVersionRequest.newBuilder()
.setName(
ParameterVersionName.of(
"[PROJECT]", "[LOCATION]", "[PARAMETER]", "[PARAMETER_VERSION]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Empty> future =
parameterManagerClient.deleteParameterVersionCallable().futureCall(request);
// Do something.
future.get();
}
public final ParameterManagerClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : parameterManagerClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
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<com.google.cloud.location.ListLocationsRequest,ParameterManagerClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
parameterManagerClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
parameterManagerClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest 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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = parameterManagerClient.getLocation(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<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (ParameterManagerClient parameterManagerClient = ParameterManagerClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = parameterManagerClient.getLocationCallable().futureCall(request);
// Do something.
Location response = 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 © 2025 Google LLC. All rights reserved.