@Override public RestoreObjectsResponse restoreObjects(RestoreObjectsRequest request) { LOG.trace("Called restoreObjects"); request = RestoreObjectsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = RestoreObjectsConverter.fromRequest(client, request); com.google.common.base.Function<javax.ws.rs.core.Response, RestoreObjectsResponse> transformer = RestoreObjectsConverter.fromResponse(); int attempts = 0; while (true) { try { javax.ws.rs.core.Response response = client.post(ib, request.getRestoreObjectsDetails(), 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; } } } }
/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(RestoreObjectsRequest o) { namespaceName(o.getNamespaceName()); bucketName(o.getBucketName()); restoreObjectsDetails(o.getRestoreObjectsDetails()); opcClientRequestId(o.getOpcClientRequestId()); invocationCallback(o.getInvocationCallback()); return this; }
public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( com.oracle.bmc.http.internal.RestClient client, RestoreObjectsRequest request) { Validate.notNull(request, "request instance is required"); Validate.notBlank(request.getNamespaceName(), "namespaceName must not be blank"); Validate.notBlank(request.getBucketName(), "bucketName must not be blank"); Validate.notNull(request.getRestoreObjectsDetails(), "restoreObjectsDetails is required"); com.oracle.bmc.http.internal.WrappedWebTarget target = client.getBaseTarget() .path("/") .path("n") .path( com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( request.getNamespaceName())) .path("b") .path( com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( request.getBucketName())) .path("actions") .path("restoreObjects"); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); if (request.getOpcClientRequestId() != null) { ib.header("opc-client-request-id", request.getOpcClientRequestId()); } return ib; }
client.post( ib, interceptedRequest.getRestoreObjectsDetails(), interceptedRequest, onSuccess,