/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(ScheduleVaultDeletionRequest o) { vaultId(o.getVaultId()); scheduleVaultDeletionDetails(o.getScheduleVaultDeletionDetails()); ifMatch(o.getIfMatch()); opcRequestId(o.getOpcRequestId()); opcRetryToken(o.getOpcRetryToken()); invocationCallback(o.getInvocationCallback()); return this; }
/** * Build the instance of ScheduleVaultDeletionRequest as configured by this builder * * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, * while the method {@link Builder#buildWithoutInvocationCallback} does not. * * This is the preferred method to build an instance. * * @return instance of ScheduleVaultDeletionRequest */ public ScheduleVaultDeletionRequest build() { ScheduleVaultDeletionRequest request = buildWithoutInvocationCallback(); request.setInvocationCallback(invocationCallback); return request; } }
@Override public ScheduleVaultDeletionResponse scheduleVaultDeletion( ScheduleVaultDeletionRequest request) { LOG.trace("Called scheduleVaultDeletion"); request = ScheduleVaultDeletionConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ScheduleVaultDeletionConverter.fromRequest(client, request); com.google.common.base.Function<javax.ws.rs.core.Response, ScheduleVaultDeletionResponse> transformer = ScheduleVaultDeletionConverter.fromResponse(); int attempts = 0; while (true) { try { javax.ws.rs.core.Response response = client.post(ib, request.getScheduleVaultDeletionDetails(), request); return transformer.apply(response); } catch (com.oracle.bmc.model.BmcException e) { if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS && canRetryRequestIfRefreshableAuthTokenUsed(e)) { continue; } else { throw e; } } } }
public static void scheduleVaultDeletionTest(KmsVaultClient kmsVaultClient, String vaultId) { System.out.println("ScheduleVaultDeletion Test: "); ScheduleVaultDeletionDetails scheduleVaultDeletionDetails = ScheduleVaultDeletionDetails.builder().timeOfDeletion(null).build(); ScheduleVaultDeletionRequest scheduleVaultDeletionRequest = ScheduleVaultDeletionRequest.builder() .scheduleVaultDeletionDetails(scheduleVaultDeletionDetails) .vaultId(vaultId) .build(); ScheduleVaultDeletionResponse response = kmsVaultClient.scheduleVaultDeletion(scheduleVaultDeletionRequest); System.out.println("Deletion Scheduled Successfully, Updated Vault: "); System.out.println(response.getVault()); System.out.println(); }
client.post( ib, interceptedRequest.getScheduleVaultDeletionDetails(), interceptedRequest, onSuccess,
public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( com.oracle.bmc.http.internal.RestClient client, ScheduleVaultDeletionRequest request) { Validate.notNull(request, "request instance is required"); Validate.notBlank(request.getVaultId(), "vaultId must not be blank"); Validate.notNull( request.getScheduleVaultDeletionDetails(), "scheduleVaultDeletionDetails is required"); com.oracle.bmc.http.internal.WrappedWebTarget target = client.getBaseTarget() .path("/20180608") .path("vaults") .path( com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( request.getVaultId())) .path("actions") .path("scheduleDeletion"); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); if (request.getIfMatch() != null) { ib.header("if-match", request.getIfMatch()); } if (request.getOpcRequestId() != null) { ib.header("opc-request-id", request.getOpcRequestId()); } if (request.getOpcRetryToken() != null) { ib.header("opc-retry-token", request.getOpcRetryToken()); } return ib; }