/** * Copy method to populate the builder with values from the given instance. * @return this builder instance */ public Builder copy(CreateMultipartUploadRequest o) { namespaceName(o.getNamespaceName()); bucketName(o.getBucketName()); createMultipartUploadDetails(o.getCreateMultipartUploadDetails()); ifMatch(o.getIfMatch()); ifNoneMatch(o.getIfNoneMatch()); opcClientRequestId(o.getOpcClientRequestId()); invocationCallback(o.getInvocationCallback()); return this; }
/** * Build the instance of CreateMultipartUploadRequest 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 CreateMultipartUploadRequest */ public CreateMultipartUploadRequest build() { CreateMultipartUploadRequest request = buildWithoutInvocationCallback(); request.setInvocationCallback(invocationCallback); return request; } }
public static CreateMultipartUploadRequest intercept(CreateMultipartUploadRequest request) { Map<String, String> newMetadata = toServiceMeta(request.getCreateMultipartUploadDetails().getMetadata()); CreateMultipartUploadDetails newDetails = CreateMultipartUploadDetails.builder() .copy(request.getCreateMultipartUploadDetails()) .metadata(newMetadata) .build(); return CreateMultipartUploadRequest.builder() .copy(request) .createMultipartUploadDetails(newDetails) .build(); }
CreateMultipartUploadResponse createUploadResponse = service.createMultipartUpload( CreateMultipartUploadRequest.builder() .bucketName(bucketName) .ifNoneMatch(ifNoneMatch)
@Override public CreateMultipartUploadResponse createMultipartUpload( CreateMultipartUploadRequest request) { LOG.trace("Called createMultipartUpload"); request = CreateMultipartUploadConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateMultipartUploadConverter.fromRequest(client, request); com.google.common.base.Function<javax.ws.rs.core.Response, CreateMultipartUploadResponse> transformer = CreateMultipartUploadConverter.fromResponse(); int attempts = 0; while (true) { try { javax.ws.rs.core.Response response = client.post(ib, request.getCreateMultipartUploadDetails(), 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; } } } }
client.post( ib, interceptedRequest.getCreateMultipartUploadDetails(), interceptedRequest, onSuccess,
public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( com.oracle.bmc.http.internal.RestClient client, CreateMultipartUploadRequest 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.getCreateMultipartUploadDetails(), "createMultipartUploadDetails is required"); .path( com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( request.getNamespaceName())) .path("b") .path( com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( request.getBucketName())) .path("u"); if (request.getIfMatch() != null) { ib.header("if-match", request.getIfMatch()); if (request.getIfNoneMatch() != null) { ib.header("if-none-match", request.getIfNoneMatch()); if (request.getOpcClientRequestId() != null) { ib.header("opc-client-request-id", request.getOpcClientRequestId());