github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/obs/model_object.go (about)

     1  package obs
     2  
     3  import (
     4  	"encoding/xml"
     5  	"io"
     6  	"time"
     7  )
     8  
     9  // ListObjsInput defines parameters for listing objects
    10  type ListObjsInput struct {
    11  	Prefix        string
    12  	MaxKeys       int
    13  	Delimiter     string
    14  	Origin        string
    15  	RequestHeader string
    16  }
    17  
    18  // ListObjectsInput is the input parameter of ListObjects function
    19  type ListObjectsInput struct {
    20  	ListObjsInput
    21  	Bucket string
    22  	Marker string
    23  }
    24  
    25  // ListObjectsOutput is the result of ListObjects function
    26  type ListObjectsOutput struct {
    27  	BaseModel
    28  	XMLName        xml.Name  `xml:"ListBucketResult"`
    29  	Delimiter      string    `xml:"Delimiter"`
    30  	IsTruncated    bool      `xml:"IsTruncated"`
    31  	Marker         string    `xml:"Marker"`
    32  	NextMarker     string    `xml:"NextMarker"`
    33  	MaxKeys        int       `xml:"MaxKeys"`
    34  	Name           string    `xml:"Name"`
    35  	Prefix         string    `xml:"Prefix"`
    36  	Contents       []Content `xml:"Contents"`
    37  	CommonPrefixes []string  `xml:"CommonPrefixes>Prefix"`
    38  	Location       string    `xml:"-"`
    39  }
    40  
    41  // ListVersionsInput is the input parameter of ListVersions function
    42  type ListVersionsInput struct {
    43  	ListObjsInput
    44  	Bucket          string
    45  	KeyMarker       string
    46  	VersionIdMarker string
    47  }
    48  
    49  // ListVersionsOutput is the result of ListVersions function
    50  type ListVersionsOutput struct {
    51  	BaseModel
    52  	XMLName             xml.Name       `xml:"ListVersionsResult"`
    53  	Delimiter           string         `xml:"Delimiter"`
    54  	IsTruncated         bool           `xml:"IsTruncated"`
    55  	KeyMarker           string         `xml:"KeyMarker"`
    56  	NextKeyMarker       string         `xml:"NextKeyMarker"`
    57  	VersionIdMarker     string         `xml:"VersionIdMarker"`
    58  	NextVersionIdMarker string         `xml:"NextVersionIdMarker"`
    59  	MaxKeys             int            `xml:"MaxKeys"`
    60  	Name                string         `xml:"Name"`
    61  	Prefix              string         `xml:"Prefix"`
    62  	Versions            []Version      `xml:"Version"`
    63  	DeleteMarkers       []DeleteMarker `xml:"DeleteMarker"`
    64  	CommonPrefixes      []string       `xml:"CommonPrefixes>Prefix"`
    65  	Location            string         `xml:"-"`
    66  }
    67  
    68  // DeleteObjectInput is the input parameter of DeleteObject function
    69  type DeleteObjectInput struct {
    70  	Bucket    string
    71  	Key       string
    72  	VersionId string
    73  }
    74  
    75  // DeleteObjectOutput is the result of DeleteObject function
    76  type DeleteObjectOutput struct {
    77  	BaseModel
    78  	VersionId    string
    79  	DeleteMarker bool
    80  }
    81  
    82  // DeleteObjectsInput is the input parameter of DeleteObjects function
    83  type DeleteObjectsInput struct {
    84  	Bucket  string           `xml:"-"`
    85  	XMLName xml.Name         `xml:"Delete"`
    86  	Quiet   bool             `xml:"Quiet,omitempty"`
    87  	Objects []ObjectToDelete `xml:"Object"`
    88  }
    89  
    90  // DeleteObjectsOutput is the result of DeleteObjects function
    91  type DeleteObjectsOutput struct {
    92  	BaseModel
    93  	XMLName  xml.Name  `xml:"DeleteResult"`
    94  	Deleteds []Deleted `xml:"Deleted"`
    95  	Errors   []Error   `xml:"Error"`
    96  }
    97  
    98  // SetObjectAclInput is the input parameter of SetObjectAcl function
    99  type SetObjectAclInput struct {
   100  	Bucket    string  `xml:"-"`
   101  	Key       string  `xml:"-"`
   102  	VersionId string  `xml:"-"`
   103  	ACL       AclType `xml:"-"`
   104  	AccessControlPolicy
   105  }
   106  
   107  // GetObjectAclInput is the input parameter of GetObjectAcl function
   108  type GetObjectAclInput struct {
   109  	Bucket    string
   110  	Key       string
   111  	VersionId string
   112  }
   113  
   114  // GetObjectAclOutput is the result of GetObjectAcl function
   115  type GetObjectAclOutput struct {
   116  	BaseModel
   117  	VersionId string
   118  	AccessControlPolicy
   119  }
   120  
   121  // RestoreObjectInput is the input parameter of RestoreObject function
   122  type RestoreObjectInput struct {
   123  	Bucket    string          `xml:"-"`
   124  	Key       string          `xml:"-"`
   125  	VersionId string          `xml:"-"`
   126  	XMLName   xml.Name        `xml:"RestoreRequest"`
   127  	Days      int             `xml:"Days"`
   128  	Tier      RestoreTierType `xml:"GlacierJobParameters>Tier,omitempty"`
   129  }
   130  
   131  // GetObjectMetadataInput is the input parameter of GetObjectMetadata function
   132  type GetObjectMetadataInput struct {
   133  	Bucket        string
   134  	Key           string
   135  	VersionId     string
   136  	Origin        string
   137  	RequestHeader string
   138  	SseHeader     ISseHeader
   139  }
   140  
   141  // GetObjectMetadataOutput is the result of GetObjectMetadata function
   142  type GetObjectMetadataOutput struct {
   143  	BaseModel
   144  	VersionId               string
   145  	WebsiteRedirectLocation string
   146  	Expiration              string
   147  	Restore                 string
   148  	ObjectType              string
   149  	NextAppendPosition      string
   150  	StorageClass            StorageClassType
   151  	ContentLength           int64
   152  	ContentType             string
   153  	ETag                    string
   154  	AllowOrigin             string
   155  	AllowHeader             string
   156  	AllowMethod             string
   157  	ExposeHeader            string
   158  	MaxAgeSeconds           int
   159  	LastModified            time.Time
   160  	SseHeader               ISseHeader
   161  	Metadata                map[string]string
   162  }
   163  
   164  // GetObjectInput is the input parameter of GetObject function
   165  type GetObjectInput struct {
   166  	GetObjectMetadataInput
   167  	IfMatch                    string
   168  	IfNoneMatch                string
   169  	IfUnmodifiedSince          time.Time
   170  	IfModifiedSince            time.Time
   171  	RangeStart                 int64
   172  	RangeEnd                   int64
   173  	ImageProcess               string
   174  	ResponseCacheControl       string
   175  	ResponseContentDisposition string
   176  	ResponseContentEncoding    string
   177  	ResponseContentLanguage    string
   178  	ResponseContentType        string
   179  	ResponseExpires            string
   180  }
   181  
   182  // GetObjectOutput is the result of GetObject function
   183  type GetObjectOutput struct {
   184  	GetObjectMetadataOutput
   185  	DeleteMarker       bool
   186  	CacheControl       string
   187  	ContentDisposition string
   188  	ContentEncoding    string
   189  	ContentLanguage    string
   190  	Expires            string
   191  	Body               io.ReadCloser
   192  }
   193  
   194  // ObjectOperationInput defines the object operation properties
   195  type ObjectOperationInput struct {
   196  	Bucket                  string
   197  	Key                     string
   198  	ACL                     AclType
   199  	GrantReadId             string
   200  	GrantReadAcpId          string
   201  	GrantWriteAcpId         string
   202  	GrantFullControlId      string
   203  	StorageClass            StorageClassType
   204  	WebsiteRedirectLocation string
   205  	Expires                 int64
   206  	SseHeader               ISseHeader
   207  	Metadata                map[string]string
   208  }
   209  
   210  // PutObjectBasicInput defines the basic object operation properties
   211  type PutObjectBasicInput struct {
   212  	ObjectOperationInput
   213  	ContentType   string
   214  	ContentMD5    string
   215  	ContentLength int64
   216  }
   217  
   218  // PutObjectInput is the input parameter of PutObject function
   219  type PutObjectInput struct {
   220  	PutObjectBasicInput
   221  	Body io.Reader
   222  }
   223  
   224  // PutFileInput is the input parameter of PutFile function
   225  type PutFileInput struct {
   226  	PutObjectBasicInput
   227  	SourceFile string
   228  }
   229  
   230  // PutObjectOutput is the result of PutObject function
   231  type PutObjectOutput struct {
   232  	BaseModel
   233  	VersionId    string
   234  	SseHeader    ISseHeader
   235  	StorageClass StorageClassType
   236  	ETag         string
   237  }
   238  
   239  // CopyObjectInput is the input parameter of CopyObject function
   240  type CopyObjectInput struct {
   241  	ObjectOperationInput
   242  	CopySourceBucket            string
   243  	CopySourceKey               string
   244  	CopySourceVersionId         string
   245  	CopySourceIfMatch           string
   246  	CopySourceIfNoneMatch       string
   247  	CopySourceIfUnmodifiedSince time.Time
   248  	CopySourceIfModifiedSince   time.Time
   249  	SourceSseHeader             ISseHeader
   250  	CacheControl                string
   251  	ContentDisposition          string
   252  	ContentEncoding             string
   253  	ContentLanguage             string
   254  	ContentType                 string
   255  	Expires                     string
   256  	MetadataDirective           MetadataDirectiveType
   257  	SuccessActionRedirect       string
   258  }
   259  
   260  // CopyObjectOutput is the result of CopyObject function
   261  type CopyObjectOutput struct {
   262  	BaseModel
   263  	CopySourceVersionId string     `xml:"-"`
   264  	VersionId           string     `xml:"-"`
   265  	SseHeader           ISseHeader `xml:"-"`
   266  	XMLName             xml.Name   `xml:"CopyObjectResult"`
   267  	LastModified        time.Time  `xml:"LastModified"`
   268  	ETag                string     `xml:"ETag"`
   269  }
   270  
   271  // UploadFileInput is the input parameter of UploadFile function
   272  type UploadFileInput struct {
   273  	ObjectOperationInput
   274  	ContentType      string
   275  	UploadFile       string
   276  	PartSize         int64
   277  	TaskNum          int
   278  	EnableCheckpoint bool
   279  	CheckpointFile   string
   280  	EncodingType     string
   281  }
   282  
   283  // DownloadFileInput is the input parameter of DownloadFile function
   284  type DownloadFileInput struct {
   285  	GetObjectMetadataInput
   286  	IfMatch           string
   287  	IfNoneMatch       string
   288  	IfModifiedSince   time.Time
   289  	IfUnmodifiedSince time.Time
   290  	DownloadFile      string
   291  	PartSize          int64
   292  	TaskNum           int
   293  	EnableCheckpoint  bool
   294  	CheckpointFile    string
   295  }
   296  
   297  // HeadObjectInput is the input parameter of HeadObject function
   298  type HeadObjectInput struct {
   299  	Bucket    string
   300  	Key       string
   301  	VersionId string
   302  }