package io.wdd.func.oss.config;


import com.amazonaws.services.s3.model.Owner;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.net.URI;
import java.util.Date;

/**
 * 参考 com.amazonaws.services.s3.model.S3ObjectSummary
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
@ApiModel("Octopus项目使用的对象存储的标准模型")
public class OctopusObjectSummary {

    /**
     * The name of the bucket in which this object is stored
     */
    String bucketName;

    /**
     * The key under which this object is stored
     */
    String key;

    /**
     * Hex encoded MD5 hash of this object's contents, as computed by Amazon S3
     */
    String eTag;

    /**
     * The size of this object, in bytes
     */
    long size;

    /**
     * The date, according to Amazon S3, when this object was last modified
     */
    Date lastModified;

    /**
     * The class of storage used by Amazon S3 to store this object
     */
    String storageClass;

    String contentType;

    /**
     * The owner of this object - can be null if the requester doesn't have
     * permission to view object ownership information
     */
    Owner owner;

    AccessDTO access;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @SuperBuilder(toBuilder = true)
    public static class AccessDTO {
        URI originUrl;

        String cloudflareUrl;

    }
}
