Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.huaweicloud.sdk.obs.v1.ObsMeta Maven / Gradle / Ivy
package com.huaweicloud.sdk.obs.v1;
import com.huaweicloud.sdk.core.TypeCasts;
import com.huaweicloud.sdk.core.http.FieldExistence;
import com.huaweicloud.sdk.core.http.HttpMethod;
import com.huaweicloud.sdk.core.http.HttpRequestDef;
import com.huaweicloud.sdk.core.http.LocationType;
import com.huaweicloud.sdk.obs.v1.model.CopyObjectRequest;
import com.huaweicloud.sdk.obs.v1.model.CopyObjectResponse;
import com.huaweicloud.sdk.obs.v1.model.CreateBucketRequest;
import com.huaweicloud.sdk.obs.v1.model.CreateBucketRequestBody;
import com.huaweicloud.sdk.obs.v1.model.CreateBucketResponse;
import com.huaweicloud.sdk.obs.v1.model.DeleteBucketCustomdomainRequest;
import com.huaweicloud.sdk.obs.v1.model.DeleteBucketCustomdomainResponse;
import com.huaweicloud.sdk.obs.v1.model.DeleteBucketRequest;
import com.huaweicloud.sdk.obs.v1.model.DeleteBucketResponse;
import com.huaweicloud.sdk.obs.v1.model.DeleteObjectRequest;
import com.huaweicloud.sdk.obs.v1.model.DeleteObjectResponse;
import com.huaweicloud.sdk.obs.v1.model.DeleteObjectsRequest;
import com.huaweicloud.sdk.obs.v1.model.DeleteObjectsRequestBody;
import com.huaweicloud.sdk.obs.v1.model.DeleteObjectsResponse;
import com.huaweicloud.sdk.obs.v1.model.GetBucketAclRequest;
import com.huaweicloud.sdk.obs.v1.model.GetBucketAclResponse;
import com.huaweicloud.sdk.obs.v1.model.GetBucketCustomdomainRequest;
import com.huaweicloud.sdk.obs.v1.model.GetBucketCustomdomainResponse;
import com.huaweicloud.sdk.obs.v1.model.GetBucketMetadataRequest;
import com.huaweicloud.sdk.obs.v1.model.GetBucketMetadataResponse;
import com.huaweicloud.sdk.obs.v1.model.GetBucketNotificationRequest;
import com.huaweicloud.sdk.obs.v1.model.GetBucketNotificationResponse;
import com.huaweicloud.sdk.obs.v1.model.GetObjectMetadataRequest;
import com.huaweicloud.sdk.obs.v1.model.GetObjectMetadataResponse;
import com.huaweicloud.sdk.obs.v1.model.GetObjectRequest;
import com.huaweicloud.sdk.obs.v1.model.GetObjectResponse;
import com.huaweicloud.sdk.obs.v1.model.ListBucketsRequest;
import com.huaweicloud.sdk.obs.v1.model.ListBucketsResponse;
import com.huaweicloud.sdk.obs.v1.model.ListObjectsRequest;
import com.huaweicloud.sdk.obs.v1.model.ListObjectsResponse;
import com.huaweicloud.sdk.obs.v1.model.PutObjectRequest;
import com.huaweicloud.sdk.obs.v1.model.PutObjectResponse;
import com.huaweicloud.sdk.obs.v1.model.SetBucketAclRequest;
import com.huaweicloud.sdk.obs.v1.model.SetBucketAclRequestBody;
import com.huaweicloud.sdk.obs.v1.model.SetBucketAclResponse;
import com.huaweicloud.sdk.obs.v1.model.SetBucketCustomDomainBody;
import com.huaweicloud.sdk.obs.v1.model.SetBucketCustomedomainRequest;
import com.huaweicloud.sdk.obs.v1.model.SetBucketCustomedomainResponse;
import com.huaweicloud.sdk.obs.v1.model.SetBucketNotificationRequest;
import com.huaweicloud.sdk.obs.v1.model.SetBucketNotificationRequestBody;
import com.huaweicloud.sdk.obs.v1.model.SetBucketNotificationResponse;
@SuppressWarnings("unchecked")
public class ObsMeta {
public static final HttpRequestDef copyObject = genForCopyObject();
private static HttpRequestDef genForCopyObject() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.PUT, CopyObjectRequest.class, CopyObjectResponse.class)
.withName("CopyObject")
.withUri("/{object_key}")
.withContentType("application/json");
// requests
builder.withRequestField("object_key",
LocationType.Path,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getObjectKey, CopyObjectRequest::setObjectKey));
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getBucketName, CopyObjectRequest::setBucketName));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getDate, CopyObjectRequest::setDate));
builder.withRequestField("x-obs-acl",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsAcl, CopyObjectRequest::setXObsAcl));
builder.withRequestField("x-obs-grant-read",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsGrantRead, CopyObjectRequest::setXObsGrantRead));
builder.withRequestField("x-obs-grant-read-acp",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsGrantReadAcp, CopyObjectRequest::setXObsGrantReadAcp));
builder.withRequestField("x-obs-grant-write-acp",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsGrantWriteAcp, CopyObjectRequest::setXObsGrantWriteAcp));
builder.withRequestField("x-obs-grant-full-control",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsGrantFullControl,
CopyObjectRequest::setXObsGrantFullControl));
builder.withRequestField("x-obs-copy-source",
LocationType.Header,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySource, CopyObjectRequest::setXObsCopySource));
builder.withRequestField("x-obs-metadata-directive",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CopyObjectRequest.XObsMetadataDirectiveEnum.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsMetadataDirective,
CopyObjectRequest::setXObsMetadataDirective));
builder.withRequestField("x-obs-copy-source-if-match",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceIfMatch,
CopyObjectRequest::setXObsCopySourceIfMatch));
builder.withRequestField("x-obs-copy-source-if-none-match",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceIfNoneMatch,
CopyObjectRequest::setXObsCopySourceIfNoneMatch));
builder.withRequestField("x-obs-copy-source-if-unmodified-since",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceIfUnmodifiedSince,
CopyObjectRequest::setXObsCopySourceIfUnmodifiedSince));
builder.withRequestField("x-obs-copy-source-if-modified-since",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceIfModifiedSince,
CopyObjectRequest::setXObsCopySourceIfModifiedSince));
builder.withRequestField("x-obs-storage-class",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsStorageClass, CopyObjectRequest::setXObsStorageClass));
builder.withRequestField("x-obs-persistent-headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsPersistentHeaders,
CopyObjectRequest::setXObsPersistentHeaders));
builder.withRequestField("x-obs-website-redirect-location",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsWebsiteRedirectLocation,
CopyObjectRequest::setXObsWebsiteRedirectLocation));
builder.withRequestField("x-obs-server-side-encryption",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsServerSideEncryption,
CopyObjectRequest::setXObsServerSideEncryption));
builder.withRequestField("x-obs-server-side-encryption-kms-key-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsServerSideEncryptionKmsKeyId,
CopyObjectRequest::setXObsServerSideEncryptionKmsKeyId));
builder.withRequestField("x-obs-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsServerSideEncryptionCustomerAlgorithm,
CopyObjectRequest::setXObsServerSideEncryptionCustomerAlgorithm));
builder.withRequestField("x-obs-server-side-encryption-customer-key",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsServerSideEncryptionCustomerKey,
CopyObjectRequest::setXObsServerSideEncryptionCustomerKey));
builder.withRequestField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsServerSideEncryptionCustomerKeyMD5,
CopyObjectRequest::setXObsServerSideEncryptionCustomerKeyMD5));
builder.withRequestField("x-obs-copy-source-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceServerSideEncryptionCustomerAlgorithm,
CopyObjectRequest::setXObsCopySourceServerSideEncryptionCustomerAlgorithm));
builder.withRequestField("x-obs-copy-source-server-side-encryption-customer-key",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceServerSideEncryptionCustomerKey,
CopyObjectRequest::setXObsCopySourceServerSideEncryptionCustomerKey));
builder.withRequestField("x-obs-copy-source-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getXObsCopySourceServerSideEncryptionCustomerKeyMD5,
CopyObjectRequest::setXObsCopySourceServerSideEncryptionCustomerKeyMD5));
builder.withRequestField("success_action_redirect",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CopyObjectRequest::getSuccessActionRedirect,
CopyObjectRequest::setSuccessActionRedirect));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsId2, CopyObjectResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsRequestId, CopyObjectResponse::setXObsRequestId));
builder.withResponseField("x-obs-server-side-encryption",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsServerSideEncryption,
CopyObjectResponse::setXObsServerSideEncryption));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getConnection, CopyObjectResponse::setConnection));
builder.withResponseField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsServerSideEncryptionCustomerKeyMD5,
CopyObjectResponse::setXObsServerSideEncryptionCustomerKeyMD5));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getDate, CopyObjectResponse::setDate));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getEtag, CopyObjectResponse::setEtag));
builder.withResponseField("x-obs-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsServerSideEncryptionCustomerAlgorithm,
CopyObjectResponse::setXObsServerSideEncryptionCustomerAlgorithm));
builder.withResponseField("x-obs-copy-source-version-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsCopySourceVersionId,
CopyObjectResponse::setXObsCopySourceVersionId));
builder.withResponseField("x-obs-storage-class",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsStorageClass, CopyObjectResponse::setXObsStorageClass));
builder.withResponseField("x-obs-server-side-encryption-kms-key-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsServerSideEncryptionKmsKeyId,
CopyObjectResponse::setXObsServerSideEncryptionKmsKeyId));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getContentLength, CopyObjectResponse::setContentLength));
builder.withResponseField("x-obs-version-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CopyObjectResponse::getXObsVersionId, CopyObjectResponse::setXObsVersionId));
return builder.build();
}
public static final HttpRequestDef createBucket = genForCreateBucket();
private static HttpRequestDef genForCreateBucket() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.PUT, CreateBucketRequest.class, CreateBucketResponse.class)
.withName("CreateBucket")
.withUri("/")
.withContentType("application/xml");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getBucketName, CreateBucketRequest::setBucketName));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getDate, CreateBucketRequest::setDate));
builder.withRequestField("x-obs-acl",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsAcl, CreateBucketRequest::setXObsAcl));
builder.withRequestField("x-obs-storage-class",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CreateBucketRequest.XObsStorageClassEnum.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsStorageClass, CreateBucketRequest::setXObsStorageClass));
builder.withRequestField("x-obs-grant-read",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantRead, CreateBucketRequest::setXObsGrantRead));
builder.withRequestField("x-obs-grant-write",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantWrite, CreateBucketRequest::setXObsGrantWrite));
builder.withRequestField("x-obs-grant-read-acp",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantReadAcp, CreateBucketRequest::setXObsGrantReadAcp));
builder.withRequestField("x-obs-grant-write-acp",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantWriteAcp,
CreateBucketRequest::setXObsGrantWriteAcp));
builder.withRequestField("x-obs-grant-full-control",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantFullControl,
CreateBucketRequest::setXObsGrantFullControl));
builder.withRequestField("x-obs-grant-read-delivered",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantReadDelivered,
CreateBucketRequest::setXObsGrantReadDelivered));
builder.withRequestField("x-obs-grant-full-control-delivered",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsGrantFullControlDelivered,
CreateBucketRequest::setXObsGrantFullControlDelivered));
builder.withRequestField("x-obs-az-redundancy",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CreateBucketRequest.XObsAzRedundancyEnum.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsAzRedundancy, CreateBucketRequest::setXObsAzRedundancy));
builder.withRequestField("x-obs-fs-file-interface",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CreateBucketRequest.XObsFsFileInterfaceEnum.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsFsFileInterface,
CreateBucketRequest::setXObsFsFileInterface));
builder.withRequestField("x-obs-epid",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsEpid, CreateBucketRequest::setXObsEpid));
builder.withRequestField("x-obs-cluster-type",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CreateBucketRequest.XObsClusterTypeEnum.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsClusterType, CreateBucketRequest::setXObsClusterType));
builder.withRequestField("x-obs-location-clustergroup-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsLocationClustergroupId,
CreateBucketRequest::setXObsLocationClustergroupId));
builder.withRequestField("x-obs-ies-location",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(CreateBucketRequest::getXObsIesLocation, CreateBucketRequest::setXObsIesLocation));
builder.withRequestField("body",
LocationType.Body,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(CreateBucketRequestBody.class),
f -> f.withMarshaller(CreateBucketRequest::getBody, CreateBucketRequest::setBody));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getXObsId2, CreateBucketResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getXObsRequestId, CreateBucketResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getEtag, CreateBucketResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getConnection, CreateBucketResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getContentLength, CreateBucketResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(CreateBucketResponse::getDate, CreateBucketResponse::setDate));
return builder.build();
}
public static final HttpRequestDef deleteBucket = genForDeleteBucket();
private static HttpRequestDef genForDeleteBucket() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.DELETE, DeleteBucketRequest.class, DeleteBucketResponse.class)
.withName("DeleteBucket")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteBucketRequest::getBucketName, DeleteBucketRequest::setBucketName));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteBucketRequest::getDate, DeleteBucketRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getXObsId2, DeleteBucketResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getXObsRequestId, DeleteBucketResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getEtag, DeleteBucketResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getConnection, DeleteBucketResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getContentLength, DeleteBucketResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketResponse::getDate, DeleteBucketResponse::setDate));
return builder.build();
}
public static final HttpRequestDef deleteBucketCustomdomain =
genForDeleteBucketCustomdomain();
private static HttpRequestDef genForDeleteBucketCustomdomain() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef
.builder(HttpMethod.DELETE,
DeleteBucketCustomdomainRequest.class,
DeleteBucketCustomdomainResponse.class)
.withName("DeleteBucketCustomdomain")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteBucketCustomdomainRequest::getBucketName,
DeleteBucketCustomdomainRequest::setBucketName));
builder.withRequestField("customdomain",
LocationType.Query,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteBucketCustomdomainRequest::getCustomdomain,
DeleteBucketCustomdomainRequest::setCustomdomain));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteBucketCustomdomainRequest::getDate, DeleteBucketCustomdomainRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getXObsId2,
DeleteBucketCustomdomainResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getXObsRequestId,
DeleteBucketCustomdomainResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getEtag,
DeleteBucketCustomdomainResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getConnection,
DeleteBucketCustomdomainResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getContentLength,
DeleteBucketCustomdomainResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteBucketCustomdomainResponse::getDate,
DeleteBucketCustomdomainResponse::setDate));
return builder.build();
}
public static final HttpRequestDef deleteObject = genForDeleteObject();
private static HttpRequestDef genForDeleteObject() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.DELETE, DeleteObjectRequest.class, DeleteObjectResponse.class)
.withName("DeleteObject")
.withUri("/{object_key}")
.withContentType("application/json");
// requests
builder.withRequestField("object_key",
LocationType.Path,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectRequest::getObjectKey, DeleteObjectRequest::setObjectKey));
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectRequest::getBucketName, DeleteObjectRequest::setBucketName));
builder.withRequestField("versionId",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectRequest::getVersionId, DeleteObjectRequest::setVersionId));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectRequest::getDate, DeleteObjectRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getXObsId2, DeleteObjectResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getXObsRequestId, DeleteObjectResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getEtag, DeleteObjectResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getConnection, DeleteObjectResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getContentLength, DeleteObjectResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getDate, DeleteObjectResponse::setDate));
builder.withResponseField("x-obs-delete-marker",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getXObsDeleteMarker,
DeleteObjectResponse::setXObsDeleteMarker));
builder.withResponseField("x-obs-version-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectResponse::getXObsVersionId, DeleteObjectResponse::setXObsVersionId));
return builder.build();
}
public static final HttpRequestDef deleteObjects =
genForDeleteObjects();
private static HttpRequestDef genForDeleteObjects() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.POST, DeleteObjectsRequest.class, DeleteObjectsResponse.class)
.withName("DeleteObjects")
.withUri("/")
.withContentType("application/xml");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectsRequest::getBucketName, DeleteObjectsRequest::setBucketName));
builder.withRequestField("delete",
LocationType.Query,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectsRequest::getDelete, DeleteObjectsRequest::setDelete));
builder.withRequestField("Content-MD5",
LocationType.Header,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectsRequest::getContentMD5, DeleteObjectsRequest::setContentMD5));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(DeleteObjectsRequest::getDate, DeleteObjectsRequest::setDate));
builder.withRequestField("body",
LocationType.Body,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(DeleteObjectsRequestBody.class),
f -> f.withMarshaller(DeleteObjectsRequest::getBody, DeleteObjectsRequest::setBody));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getXObsId2, DeleteObjectsResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getXObsRequestId, DeleteObjectsResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getEtag, DeleteObjectsResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getConnection, DeleteObjectsResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getContentLength, DeleteObjectsResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(DeleteObjectsResponse::getDate, DeleteObjectsResponse::setDate));
return builder.build();
}
public static final HttpRequestDef getBucketAcl = genForGetBucketAcl();
private static HttpRequestDef genForGetBucketAcl() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.GET, GetBucketAclRequest.class, GetBucketAclResponse.class)
.withName("GetBucketAcl")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketAclRequest::getBucketName, GetBucketAclRequest::setBucketName));
builder.withRequestField("acl",
LocationType.Query,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketAclRequest::getAcl, GetBucketAclRequest::setAcl));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketAclRequest::getDate, GetBucketAclRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getXObsId2, GetBucketAclResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getXObsRequestId, GetBucketAclResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getEtag, GetBucketAclResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getConnection, GetBucketAclResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getContentLength, GetBucketAclResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketAclResponse::getDate, GetBucketAclResponse::setDate));
return builder.build();
}
public static final HttpRequestDef getBucketCustomdomain =
genForGetBucketCustomdomain();
private static HttpRequestDef genForGetBucketCustomdomain() {
// basic
HttpRequestDef.Builder builder = HttpRequestDef
.builder(HttpMethod.GET, GetBucketCustomdomainRequest.class, GetBucketCustomdomainResponse.class)
.withName("GetBucketCustomdomain")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketCustomdomainRequest::getBucketName,
GetBucketCustomdomainRequest::setBucketName));
builder.withRequestField("customdomain",
LocationType.Query,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketCustomdomainRequest::getCustomdomain,
GetBucketCustomdomainRequest::setCustomdomain));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketCustomdomainRequest::getDate, GetBucketCustomdomainRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getXObsId2,
GetBucketCustomdomainResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getXObsRequestId,
GetBucketCustomdomainResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getEtag, GetBucketCustomdomainResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getConnection,
GetBucketCustomdomainResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getContentLength,
GetBucketCustomdomainResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketCustomdomainResponse::getDate, GetBucketCustomdomainResponse::setDate));
return builder.build();
}
public static final HttpRequestDef getBucketMetadata =
genForGetBucketMetadata();
private static HttpRequestDef genForGetBucketMetadata() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.HEAD, GetBucketMetadataRequest.class, GetBucketMetadataResponse.class)
.withName("GetBucketMetadata")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketMetadataRequest::getBucketName, GetBucketMetadataRequest::setBucketName));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketMetadataRequest::getDate, GetBucketMetadataRequest::setDate));
builder.withRequestField("Origin",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketMetadataRequest::getOrigin, GetBucketMetadataRequest::setOrigin));
builder.withRequestField("Access-Control-Request-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketMetadataRequest::getAccessControlRequestHeaders,
GetBucketMetadataRequest::setAccessControlRequestHeaders));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsId2, GetBucketMetadataResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsRequestId,
GetBucketMetadataResponse::setXObsRequestId));
builder.withResponseField("x-obs-fs-file-interface",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsFsFileInterface,
GetBucketMetadataResponse::setXObsFsFileInterface));
builder.withResponseField("x-obs-version",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsVersion,
GetBucketMetadataResponse::setXObsVersion));
builder.withResponseField("Access-Control-Allow-Origin",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getAccessControlAllowOrigin,
GetBucketMetadataResponse::setAccessControlAllowOrigin));
builder.withResponseField("Access-Control-Allow-Methods",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getAccessControlAllowMethods,
GetBucketMetadataResponse::setAccessControlAllowMethods));
builder.withResponseField("x-obs-bucket-location",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsBucketLocation,
GetBucketMetadataResponse::setXObsBucketLocation));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getConnection, GetBucketMetadataResponse::setConnection));
builder.withResponseField("x-obs-epid",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsEpid, GetBucketMetadataResponse::setXObsEpid));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getDate, GetBucketMetadataResponse::setDate));
builder.withResponseField("Access-Control-Allow-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getAccessControlAllowHeaders,
GetBucketMetadataResponse::setAccessControlAllowHeaders));
builder.withResponseField("Access-Control-Expose-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getAccessControlExposeHeaders,
GetBucketMetadataResponse::setAccessControlExposeHeaders));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getEtag, GetBucketMetadataResponse::setEtag));
builder.withResponseField("x-obs-storage-class",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsStorageClass,
GetBucketMetadataResponse::setXObsStorageClass));
builder.withResponseField("x-obs-az-redundancy",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsAzRedundancy,
GetBucketMetadataResponse::setXObsAzRedundancy));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getContentLength,
GetBucketMetadataResponse::setContentLength));
builder.withResponseField("Access-Control-Max-Age",
LocationType.Header,
FieldExistence.NULL_IGNORE,
Integer.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getAccessControlMaxAge,
GetBucketMetadataResponse::setAccessControlMaxAge));
builder.withResponseField("x-obs-ies-location",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketMetadataResponse::getXObsIesLocation,
GetBucketMetadataResponse::setXObsIesLocation));
return builder.build();
}
public static final HttpRequestDef getBucketNotification =
genForGetBucketNotification();
private static HttpRequestDef genForGetBucketNotification() {
// basic
HttpRequestDef.Builder builder = HttpRequestDef
.builder(HttpMethod.GET, GetBucketNotificationRequest.class, GetBucketNotificationResponse.class)
.withName("GetBucketNotification")
.withUri("/")
.withContentType("application/json");
// requests
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketNotificationRequest::getBucketName,
GetBucketNotificationRequest::setBucketName));
builder.withRequestField("notification",
LocationType.Query,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketNotificationRequest::getNotification,
GetBucketNotificationRequest::setNotification));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetBucketNotificationRequest::getDate, GetBucketNotificationRequest::setDate));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getXObsId2,
GetBucketNotificationResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getXObsRequestId,
GetBucketNotificationResponse::setXObsRequestId));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getEtag, GetBucketNotificationResponse::setEtag));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getConnection,
GetBucketNotificationResponse::setConnection));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getContentLength,
GetBucketNotificationResponse::setContentLength));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetBucketNotificationResponse::getDate, GetBucketNotificationResponse::setDate));
return builder.build();
}
public static final HttpRequestDef getObject = genForGetObject();
private static HttpRequestDef genForGetObject() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.GET, GetObjectRequest.class, GetObjectResponse.class)
.withName("GetObject")
.withUri("/{object_key}")
.withContentType("application/json");
// requests
builder.withRequestField("object_key",
LocationType.Path,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getObjectKey, GetObjectRequest::setObjectKey));
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getBucketName, GetObjectRequest::setBucketName));
builder.withRequestField("response-content-type",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseContentType, GetObjectRequest::setResponseContentType));
builder.withRequestField("response-content-language",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseContentLanguage,
GetObjectRequest::setResponseContentLanguage));
builder.withRequestField("response-expires",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseExpires, GetObjectRequest::setResponseExpires));
builder.withRequestField("response-cache-control",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseCacheControl,
GetObjectRequest::setResponseCacheControl));
builder.withRequestField("response-content-disposition",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseContentDisposition,
GetObjectRequest::setResponseContentDisposition));
builder.withRequestField("response-content-encoding",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getResponseContentEncoding,
GetObjectRequest::setResponseContentEncoding));
builder.withRequestField("versionId",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getVersionId, GetObjectRequest::setVersionId));
builder.withRequestField("x-image-process",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getXImageProcess, GetObjectRequest::setXImageProcess));
builder.withRequestField("attname",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getAttname, GetObjectRequest::setAttname));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getDate, GetObjectRequest::setDate));
builder.withRequestField("Range",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getRange, GetObjectRequest::setRange));
builder.withRequestField("If-Modified-Since",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getIfModifiedSince, GetObjectRequest::setIfModifiedSince));
builder.withRequestField("If-Unmodified-Since",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getIfUnmodifiedSince, GetObjectRequest::setIfUnmodifiedSince));
builder.withRequestField("If-Match",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getIfMatch, GetObjectRequest::setIfMatch));
builder.withRequestField("If-None-Match",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getIfNoneMatch, GetObjectRequest::setIfNoneMatch));
builder.withRequestField("x-obs-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getXObsServerSideEncryptionCustomerAlgorithm,
GetObjectRequest::setXObsServerSideEncryptionCustomerAlgorithm));
builder.withRequestField("x-obs-server-side-encryption-customer-key",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getXObsServerSideEncryptionCustomerKey,
GetObjectRequest::setXObsServerSideEncryptionCustomerKey));
builder.withRequestField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectRequest::getXObsServerSideEncryptionCustomerKeyMD5,
GetObjectRequest::setXObsServerSideEncryptionCustomerKeyMD5));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsId2, GetObjectResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsRequestId, GetObjectResponse::setXObsRequestId));
builder.withResponseField("x-obs-server-side-encryption",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsServerSideEncryption,
GetObjectResponse::setXObsServerSideEncryption));
builder.withResponseField("x-obs-object-type",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsObjectType, GetObjectResponse::setXObsObjectType));
builder.withResponseField("x-obs-next-append-position",
LocationType.Header,
FieldExistence.NULL_IGNORE,
Integer.class,
f -> f.withMarshaller(GetObjectResponse::getXObsNextAppendPosition,
GetObjectResponse::setXObsNextAppendPosition));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getConnection, GetObjectResponse::setConnection));
builder.withResponseField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsServerSideEncryptionCustomerKeyMD5,
GetObjectResponse::setXObsServerSideEncryptionCustomerKeyMD5));
builder.withResponseField("x-obs-expiration",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsExpiration, GetObjectResponse::setXObsExpiration));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getDate, GetObjectResponse::setDate));
builder.withResponseField("ETag",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getEtag, GetObjectResponse::setEtag));
builder.withResponseField("x-obs-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsServerSideEncryptionCustomerAlgorithm,
GetObjectResponse::setXObsServerSideEncryptionCustomerAlgorithm));
builder.withResponseField("x-obs-server-side-encryption-kms-key-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsServerSideEncryptionKmsKeyId,
GetObjectResponse::setXObsServerSideEncryptionKmsKeyId));
builder.withResponseField("Content-Length",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getContentLength, GetObjectResponse::setContentLength));
builder.withResponseField("x-obs-website-redirect-location",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsWebsiteRedirectLocation,
GetObjectResponse::setXObsWebsiteRedirectLocation));
builder.withResponseField("x-obs-delete-marker",
LocationType.Header,
FieldExistence.NULL_IGNORE,
Boolean.class,
f -> f.withMarshaller(GetObjectResponse::getXObsDeleteMarker, GetObjectResponse::setXObsDeleteMarker));
builder.withResponseField("x-obs-version-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectResponse::getXObsVersionId, GetObjectResponse::setXObsVersionId));
return builder.build();
}
public static final HttpRequestDef getObjectMetadata =
genForGetObjectMetadata();
private static HttpRequestDef genForGetObjectMetadata() {
// basic
HttpRequestDef.Builder builder =
HttpRequestDef.builder(HttpMethod.HEAD, GetObjectMetadataRequest.class, GetObjectMetadataResponse.class)
.withName("GetObjectMetadata")
.withUri("/{object_key}")
.withContentType("application/json");
// requests
builder.withRequestField("object_key",
LocationType.Path,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getObjectKey, GetObjectMetadataRequest::setObjectKey));
builder.withRequestField("bucket_name",
LocationType.Cname,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getBucketName, GetObjectMetadataRequest::setBucketName));
builder.withRequestField("versionId",
LocationType.Query,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getVersionId, GetObjectMetadataRequest::setVersionId));
builder.withRequestField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getDate, GetObjectMetadataRequest::setDate));
builder.withRequestField("Origin",
LocationType.Header,
FieldExistence.NON_NULL_NON_EMPTY,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getOrigin, GetObjectMetadataRequest::setOrigin));
builder.withRequestField("Access-Control-Request-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getAccessControlRequestHeaders,
GetObjectMetadataRequest::setAccessControlRequestHeaders));
builder.withRequestField("x-obs-server-side-encryption-customer-algorithm",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getXObsServerSideEncryptionCustomerAlgorithm,
GetObjectMetadataRequest::setXObsServerSideEncryptionCustomerAlgorithm));
builder.withRequestField("x-obs-server-side-encryption-customer-key",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getXObsServerSideEncryptionCustomerKey,
GetObjectMetadataRequest::setXObsServerSideEncryptionCustomerKey));
builder.withRequestField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getXObsServerSideEncryptionCustomerKeyMD5,
GetObjectMetadataRequest::setXObsServerSideEncryptionCustomerKeyMD5));
builder.withRequestField("success-action-redirect",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(String.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getSuccessActionRedirect,
GetObjectMetadataRequest::setSuccessActionRedirect));
builder.withRequestField("x-obs-expires",
LocationType.Header,
FieldExistence.NULL_IGNORE,
TypeCasts.uncheckedConversion(Integer.class),
f -> f.withMarshaller(GetObjectMetadataRequest::getXObsExpires, GetObjectMetadataRequest::setXObsExpires));
// response
builder.withResponseField("x-obs-id-2",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsId2, GetObjectMetadataResponse::setXObsId2));
builder.withResponseField("x-obs-request-id",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsRequestId,
GetObjectMetadataResponse::setXObsRequestId));
builder.withResponseField("x-obs-hash-crc64ecma",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsHashCrc64ecma,
GetObjectMetadataResponse::setXObsHashCrc64ecma));
builder.withResponseField("Access-Control-Allow-Origin",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getAccessControlAllowOrigin,
GetObjectMetadataResponse::setAccessControlAllowOrigin));
builder.withResponseField("x-obs-server-side-encryption",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsServerSideEncryption,
GetObjectMetadataResponse::setXObsServerSideEncryption));
builder.withResponseField("x-obs-restore",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsRestore,
GetObjectMetadataResponse::setXObsRestore));
builder.withResponseField("x-obs-object-type",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsObjectType,
GetObjectMetadataResponse::setXObsObjectType));
builder.withResponseField("x-obs-next-append-position",
LocationType.Header,
FieldExistence.NULL_IGNORE,
Integer.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsNextAppendPosition,
GetObjectMetadataResponse::setXObsNextAppendPosition));
builder.withResponseField("Access-Control-Allow-Methods",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getAccessControlAllowMethods,
GetObjectMetadataResponse::setAccessControlAllowMethods));
builder.withResponseField("Connection",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getConnection, GetObjectMetadataResponse::setConnection));
builder.withResponseField("x-obs-server-side-encryption-customer-key-MD5",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsServerSideEncryptionCustomerKeyMD5,
GetObjectMetadataResponse::setXObsServerSideEncryptionCustomerKeyMD5));
builder.withResponseField("x-obs-expiration",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsExpiration,
GetObjectMetadataResponse::setXObsExpiration));
builder.withResponseField("Date",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getDate, GetObjectMetadataResponse::setDate));
builder.withResponseField("Access-Control-Allow-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getAccessControlAllowHeaders,
GetObjectMetadataResponse::setAccessControlAllowHeaders));
builder.withResponseField("x-obs-uploadId",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getXObsUploadId,
GetObjectMetadataResponse::setXObsUploadId));
builder.withResponseField("Access-Control-Expose-Headers",
LocationType.Header,
FieldExistence.NULL_IGNORE,
String.class,
f -> f.withMarshaller(GetObjectMetadataResponse::getAccessControlExposeHeaders,
GetObjectMetadataResponse::setAccessControlExposeHeaders));
builder.