yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/huawei/obs/const.go (about)

     1  // Copyright 2019 Yunion
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Copyright 2019 Huawei Technologies Co.,Ltd.
    16  // Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    17  // this file except in compliance with the License.  You may obtain a copy of the
    18  // License at
    19  //
    20  // http://www.apache.org/licenses/LICENSE-2.0
    21  //
    22  // Unless required by applicable law or agreed to in writing, software distributed
    23  // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
    24  // CONDITIONS OF ANY KIND, either express or implied.  See the License for the
    25  // specific language governing permissions and limitations under the License.
    26  
    27  package obs
    28  
    29  const (
    30  	obs_sdk_version        = "3.20.1"
    31  	USER_AGENT             = "obs-sdk-go/" + obs_sdk_version
    32  	HEADER_PREFIX          = "x-amz-"
    33  	HEADER_PREFIX_META     = "x-amz-meta-"
    34  	HEADER_PREFIX_OBS      = "x-obs-"
    35  	HEADER_PREFIX_META_OBS = "x-obs-meta-"
    36  	HEADER_DATE_AMZ        = "x-amz-date"
    37  	HEADER_DATE_OBS        = "x-obs-date"
    38  	HEADER_STS_TOKEN_AMZ   = "x-amz-security-token"
    39  	HEADER_STS_TOKEN_OBS   = "x-obs-security-token"
    40  	HEADER_ACCESSS_KEY_AMZ = "AWSAccessKeyId"
    41  	PREFIX_META            = "meta-"
    42  
    43  	HEADER_CONTENT_SHA256_AMZ               = "x-amz-content-sha256"
    44  	HEADER_ACL_AMZ                          = "x-amz-acl"
    45  	HEADER_ACL_OBS                          = "x-obs-acl"
    46  	HEADER_ACL                              = "acl"
    47  	HEADER_LOCATION_AMZ                     = "location"
    48  	HEADER_BUCKET_LOCATION_OBS              = "bucket-location"
    49  	HEADER_COPY_SOURCE                      = "copy-source"
    50  	HEADER_COPY_SOURCE_RANGE                = "copy-source-range"
    51  	HEADER_RANGE                            = "Range"
    52  	HEADER_STORAGE_CLASS                    = "x-default-storage-class"
    53  	HEADER_STORAGE_CLASS_OBS                = "x-obs-storage-class"
    54  	HEADER_VERSION_OBS                      = "version"
    55  	HEADER_GRANT_READ_OBS                   = "grant-read"
    56  	HEADER_GRANT_WRITE_OBS                  = "grant-write"
    57  	HEADER_GRANT_READ_ACP_OBS               = "grant-read-acp"
    58  	HEADER_GRANT_WRITE_ACP_OBS              = "grant-write-acp"
    59  	HEADER_GRANT_FULL_CONTROL_OBS           = "grant-full-control"
    60  	HEADER_GRANT_READ_DELIVERED_OBS         = "grant-read-delivered"
    61  	HEADER_GRANT_FULL_CONTROL_DELIVERED_OBS = "grant-full-control-delivered"
    62  	HEADER_REQUEST_ID                       = "request-id"
    63  	HEADER_BUCKET_REGION                    = "bucket-region"
    64  	HEADER_ACCESS_CONRTOL_ALLOW_ORIGIN      = "access-control-allow-origin"
    65  	HEADER_ACCESS_CONRTOL_ALLOW_HEADERS     = "access-control-allow-headers"
    66  	HEADER_ACCESS_CONRTOL_MAX_AGE           = "access-control-max-age"
    67  	HEADER_ACCESS_CONRTOL_ALLOW_METHODS     = "access-control-allow-methods"
    68  	HEADER_ACCESS_CONRTOL_EXPOSE_HEADERS    = "access-control-expose-headers"
    69  	HEADER_EPID_HEADERS                     = "epid"
    70  	HEADER_VERSION_ID                       = "version-id"
    71  	HEADER_COPY_SOURCE_VERSION_ID           = "copy-source-version-id"
    72  	HEADER_DELETE_MARKER                    = "delete-marker"
    73  	HEADER_WEBSITE_REDIRECT_LOCATION        = "website-redirect-location"
    74  	HEADER_METADATA_DIRECTIVE               = "metadata-directive"
    75  	HEADER_EXPIRATION                       = "expiration"
    76  	HEADER_EXPIRES_OBS                      = "x-obs-expires"
    77  	HEADER_RESTORE                          = "restore"
    78  	HEADER_OBJECT_TYPE                      = "object-type"
    79  	HEADER_NEXT_APPEND_POSITION             = "next-append-position"
    80  	HEADER_STORAGE_CLASS2                   = "storage-class"
    81  	HEADER_CONTENT_LENGTH                   = "content-length"
    82  	HEADER_CONTENT_TYPE                     = "content-type"
    83  	HEADER_CONTENT_LANGUAGE                 = "content-language"
    84  	HEADER_EXPIRES                          = "expires"
    85  	HEADER_CACHE_CONTROL                    = "cache-control"
    86  	HEADER_CONTENT_DISPOSITION              = "content-disposition"
    87  	HEADER_CONTENT_ENCODING                 = "content-encoding"
    88  
    89  	HEADER_ETAG         = "etag"
    90  	HEADER_LASTMODIFIED = "last-modified"
    91  
    92  	HEADER_COPY_SOURCE_IF_MATCH            = "copy-source-if-match"
    93  	HEADER_COPY_SOURCE_IF_NONE_MATCH       = "copy-source-if-none-match"
    94  	HEADER_COPY_SOURCE_IF_MODIFIED_SINCE   = "copy-source-if-modified-since"
    95  	HEADER_COPY_SOURCE_IF_UNMODIFIED_SINCE = "copy-source-if-unmodified-since"
    96  
    97  	HEADER_IF_MATCH            = "If-Match"
    98  	HEADER_IF_NONE_MATCH       = "If-None-Match"
    99  	HEADER_IF_MODIFIED_SINCE   = "If-Modified-Since"
   100  	HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since"
   101  
   102  	HEADER_SSEC_ENCRYPTION = "server-side-encryption-customer-algorithm"
   103  	HEADER_SSEC_KEY        = "server-side-encryption-customer-key"
   104  	HEADER_SSEC_KEY_MD5    = "server-side-encryption-customer-key-MD5"
   105  
   106  	HEADER_SSEKMS_ENCRYPTION      = "server-side-encryption"
   107  	HEADER_SSEKMS_KEY             = "server-side-encryption-aws-kms-key-id"
   108  	HEADER_SSEKMS_ENCRYPT_KEY_OBS = "server-side-encryption-kms-key-id"
   109  
   110  	HEADER_SSEC_COPY_SOURCE_ENCRYPTION = "copy-source-server-side-encryption-customer-algorithm"
   111  	HEADER_SSEC_COPY_SOURCE_KEY        = "copy-source-server-side-encryption-customer-key"
   112  	HEADER_SSEC_COPY_SOURCE_KEY_MD5    = "copy-source-server-side-encryption-customer-key-MD5"
   113  
   114  	HEADER_SSEKMS_KEY_AMZ = "x-amz-server-side-encryption-aws-kms-key-id"
   115  
   116  	HEADER_SSEKMS_KEY_OBS = "x-obs-server-side-encryption-kms-key-id"
   117  
   118  	HEADER_SUCCESS_ACTION_REDIRECT = "success_action_redirect"
   119  
   120  	HEADER_DATE_CAMEL                          = "Date"
   121  	HEADER_HOST_CAMEL                          = "Host"
   122  	HEADER_HOST                                = "host"
   123  	HEADER_AUTH_CAMEL                          = "Authorization"
   124  	HEADER_MD5_CAMEL                           = "Content-MD5"
   125  	HEADER_LOCATION_CAMEL                      = "Location"
   126  	HEADER_CONTENT_LENGTH_CAMEL                = "Content-Length"
   127  	HEADER_CONTENT_TYPE_CAML                   = "Content-Type"
   128  	HEADER_USER_AGENT_CAMEL                    = "User-Agent"
   129  	HEADER_ORIGIN_CAMEL                        = "Origin"
   130  	HEADER_ACCESS_CONTROL_REQUEST_HEADER_CAMEL = "Access-Control-Request-Headers"
   131  	HEADER_CACHE_CONTROL_CAMEL                 = "Cache-Control"
   132  	HEADER_CONTENT_DISPOSITION_CAMEL           = "Content-Disposition"
   133  	HEADER_CONTENT_ENCODING_CAMEL              = "Content-Encoding"
   134  	HEADER_CONTENT_LANGUAGE_CAMEL              = "Content-Language"
   135  	HEADER_EXPIRES_CAMEL                       = "Expires"
   136  
   137  	PARAM_VERSION_ID                   = "versionId"
   138  	PARAM_RESPONSE_CONTENT_TYPE        = "response-content-type"
   139  	PARAM_RESPONSE_CONTENT_LANGUAGE    = "response-content-language"
   140  	PARAM_RESPONSE_EXPIRES             = "response-expires"
   141  	PARAM_RESPONSE_CACHE_CONTROL       = "response-cache-control"
   142  	PARAM_RESPONSE_CONTENT_DISPOSITION = "response-content-disposition"
   143  	PARAM_RESPONSE_CONTENT_ENCODING    = "response-content-encoding"
   144  	PARAM_IMAGE_PROCESS                = "x-image-process"
   145  
   146  	PARAM_ALGORITHM_AMZ_CAMEL     = "X-Amz-Algorithm"
   147  	PARAM_CREDENTIAL_AMZ_CAMEL    = "X-Amz-Credential"
   148  	PARAM_DATE_AMZ_CAMEL          = "X-Amz-Date"
   149  	PARAM_DATE_OBS_CAMEL          = "X-Obs-Date"
   150  	PARAM_EXPIRES_AMZ_CAMEL       = "X-Amz-Expires"
   151  	PARAM_SIGNEDHEADERS_AMZ_CAMEL = "X-Amz-SignedHeaders"
   152  	PARAM_SIGNATURE_AMZ_CAMEL     = "X-Amz-Signature"
   153  
   154  	DEFAULT_SIGNATURE            = SignatureV2
   155  	DEFAULT_REGION               = "region"
   156  	DEFAULT_CONNECT_TIMEOUT      = 60
   157  	DEFAULT_SOCKET_TIMEOUT       = 60
   158  	DEFAULT_HEADER_TIMEOUT       = 60
   159  	DEFAULT_IDLE_CONN_TIMEOUT    = 30
   160  	DEFAULT_MAX_RETRY_COUNT      = 3
   161  	DEFAULT_MAX_REDIRECT_COUNT   = 3
   162  	DEFAULT_MAX_CONN_PER_HOST    = 1000
   163  	EMPTY_CONTENT_SHA256         = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
   164  	UNSIGNED_PAYLOAD             = "UNSIGNED-PAYLOAD"
   165  	LONG_DATE_FORMAT             = "20060102T150405Z"
   166  	SHORT_DATE_FORMAT            = "20060102"
   167  	ISO8601_DATE_FORMAT          = "2006-01-02T15:04:05Z"
   168  	ISO8601_MIDNIGHT_DATE_FORMAT = "2006-01-02T00:00:00Z"
   169  	RFC1123_FORMAT               = "Mon, 02 Jan 2006 15:04:05 GMT"
   170  
   171  	V4_SERVICE_NAME   = "s3"
   172  	V4_SERVICE_SUFFIX = "aws4_request"
   173  
   174  	V2_HASH_PREFIX  = "AWS"
   175  	OBS_HASH_PREFIX = "OBS"
   176  
   177  	V4_HASH_PREFIX = "AWS4-HMAC-SHA256"
   178  	V4_HASH_PRE    = "AWS4"
   179  
   180  	DEFAULT_SSE_KMS_ENCRYPTION     = "aws:kms"
   181  	DEFAULT_SSE_KMS_ENCRYPTION_OBS = "kms"
   182  
   183  	DEFAULT_SSE_C_ENCRYPTION = "AES256"
   184  
   185  	HTTP_GET     = "GET"
   186  	HTTP_POST    = "POST"
   187  	HTTP_PUT     = "PUT"
   188  	HTTP_DELETE  = "DELETE"
   189  	HTTP_HEAD    = "HEAD"
   190  	HTTP_OPTIONS = "OPTIONS"
   191  )
   192  
   193  type SignatureType string
   194  
   195  const (
   196  	SignatureV2  SignatureType = "v2"
   197  	SignatureV4  SignatureType = "v4"
   198  	SignatureObs SignatureType = "OBS"
   199  )
   200  
   201  var (
   202  	interested_headers = []string{"content-md5", "content-type", "date"}
   203  
   204  	allowed_response_http_header_metadata_names = map[string]bool{
   205  		"content-type":                  true,
   206  		"content-md5":                   true,
   207  		"content-length":                true,
   208  		"content-language":              true,
   209  		"expires":                       true,
   210  		"origin":                        true,
   211  		"cache-control":                 true,
   212  		"content-disposition":           true,
   213  		"content-encoding":              true,
   214  		"x-default-storage-class":       true,
   215  		"location":                      true,
   216  		"date":                          true,
   217  		"etag":                          true,
   218  		"host":                          true,
   219  		"last-modified":                 true,
   220  		"content-range":                 true,
   221  		"x-reserved":                    true,
   222  		"x-reserved-indicator":          true,
   223  		"access-control-allow-origin":   true,
   224  		"access-control-allow-headers":  true,
   225  		"access-control-max-age":        true,
   226  		"access-control-allow-methods":  true,
   227  		"access-control-expose-headers": true,
   228  		"connection":                    true,
   229  	}
   230  
   231  	allowed_request_http_header_metadata_names = map[string]bool{
   232  		"content-type":                   true,
   233  		"content-md5":                    true,
   234  		"content-length":                 true,
   235  		"content-language":               true,
   236  		"expires":                        true,
   237  		"origin":                         true,
   238  		"cache-control":                  true,
   239  		"content-disposition":            true,
   240  		"content-encoding":               true,
   241  		"access-control-request-method":  true,
   242  		"access-control-request-headers": true,
   243  		"x-default-storage-class":        true,
   244  		"location":                       true,
   245  		"date":                           true,
   246  		"etag":                           true,
   247  		"range":                          true,
   248  		"host":                           true,
   249  		"if-modified-since":              true,
   250  		"if-unmodified-since":            true,
   251  		"if-match":                       true,
   252  		"if-none-match":                  true,
   253  		"last-modified":                  true,
   254  		"content-range":                  true,
   255  	}
   256  
   257  	allowed_resource_parameter_names = map[string]bool{
   258  		"acl":                          true,
   259  		"backtosource":                 true,
   260  		"policy":                       true,
   261  		"torrent":                      true,
   262  		"logging":                      true,
   263  		"location":                     true,
   264  		"storageinfo":                  true,
   265  		"quota":                        true,
   266  		"storageclass":                 true,
   267  		"storagepolicy":                true,
   268  		"requestpayment":               true,
   269  		"versions":                     true,
   270  		"versioning":                   true,
   271  		"versionid":                    true,
   272  		"uploads":                      true,
   273  		"uploadid":                     true,
   274  		"partnumber":                   true,
   275  		"website":                      true,
   276  		"notification":                 true,
   277  		"lifecycle":                    true,
   278  		"deletebucket":                 true,
   279  		"delete":                       true,
   280  		"cors":                         true,
   281  		"restore":                      true,
   282  		"tagging":                      true,
   283  		"append":                       true,
   284  		"position":                     true,
   285  		"replication":                  true,
   286  		"response-content-type":        true,
   287  		"response-content-language":    true,
   288  		"response-expires":             true,
   289  		"response-cache-control":       true,
   290  		"response-content-disposition": true,
   291  		"response-content-encoding":    true,
   292  		"x-image-process":              true,
   293  		"x-oss-process":                true,
   294  		"x-image-save-bucket":          true,
   295  		"x-image-save-object":          true,
   296  		"ignore-sign-in-query":         true,
   297  	}
   298  
   299  	mime_types = map[string]string{
   300  		"001":     "application/x-001",
   301  		"301":     "application/x-301",
   302  		"323":     "text/h323",
   303  		"7z":      "application/x-7z-compressed",
   304  		"906":     "application/x-906",
   305  		"907":     "drawing/907",
   306  		"IVF":     "video/x-ivf",
   307  		"a11":     "application/x-a11",
   308  		"aac":     "audio/x-aac",
   309  		"acp":     "audio/x-mei-aac",
   310  		"ai":      "application/postscript",
   311  		"aif":     "audio/aiff",
   312  		"aifc":    "audio/aiff",
   313  		"aiff":    "audio/aiff",
   314  		"anv":     "application/x-anv",
   315  		"apk":     "application/vnd.android.package-archive",
   316  		"asa":     "text/asa",
   317  		"asf":     "video/x-ms-asf",
   318  		"asp":     "text/asp",
   319  		"asx":     "video/x-ms-asf",
   320  		"atom":    "application/atom+xml",
   321  		"au":      "audio/basic",
   322  		"avi":     "video/avi",
   323  		"awf":     "application/vnd.adobe.workflow",
   324  		"biz":     "text/xml",
   325  		"bmp":     "application/x-bmp",
   326  		"bot":     "application/x-bot",
   327  		"bz2":     "application/x-bzip2",
   328  		"c4t":     "application/x-c4t",
   329  		"c90":     "application/x-c90",
   330  		"cal":     "application/x-cals",
   331  		"cat":     "application/vnd.ms-pki.seccat",
   332  		"cdf":     "application/x-netcdf",
   333  		"cdr":     "application/x-cdr",
   334  		"cel":     "application/x-cel",
   335  		"cer":     "application/x-x509-ca-cert",
   336  		"cg4":     "application/x-g4",
   337  		"cgm":     "application/x-cgm",
   338  		"cit":     "application/x-cit",
   339  		"class":   "java/*",
   340  		"cml":     "text/xml",
   341  		"cmp":     "application/x-cmp",
   342  		"cmx":     "application/x-cmx",
   343  		"cot":     "application/x-cot",
   344  		"crl":     "application/pkix-crl",
   345  		"crt":     "application/x-x509-ca-cert",
   346  		"csi":     "application/x-csi",
   347  		"css":     "text/css",
   348  		"csv":     "text/csv",
   349  		"cu":      "application/cu-seeme",
   350  		"cut":     "application/x-cut",
   351  		"dbf":     "application/x-dbf",
   352  		"dbm":     "application/x-dbm",
   353  		"dbx":     "application/x-dbx",
   354  		"dcd":     "text/xml",
   355  		"dcx":     "application/x-dcx",
   356  		"deb":     "application/x-debian-package",
   357  		"der":     "application/x-x509-ca-cert",
   358  		"dgn":     "application/x-dgn",
   359  		"dib":     "application/x-dib",
   360  		"dll":     "application/x-msdownload",
   361  		"doc":     "application/msword",
   362  		"docx":    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
   363  		"dot":     "application/msword",
   364  		"drw":     "application/x-drw",
   365  		"dtd":     "text/xml",
   366  		"dvi":     "application/x-dvi",
   367  		"dwf":     "application/x-dwf",
   368  		"dwg":     "application/x-dwg",
   369  		"dxb":     "application/x-dxb",
   370  		"dxf":     "application/x-dxf",
   371  		"edn":     "application/vnd.adobe.edn",
   372  		"emf":     "application/x-emf",
   373  		"eml":     "message/rfc822",
   374  		"ent":     "text/xml",
   375  		"eot":     "application/vnd.ms-fontobject",
   376  		"epi":     "application/x-epi",
   377  		"eps":     "application/postscript",
   378  		"epub":    "application/epub+zip",
   379  		"etd":     "application/x-ebx",
   380  		"etx":     "text/x-setext",
   381  		"exe":     "application/x-msdownload",
   382  		"fax":     "image/fax",
   383  		"fdf":     "application/vnd.fdf",
   384  		"fif":     "application/fractals",
   385  		"flac":    "audio/flac",
   386  		"flv":     "video/x-flv",
   387  		"fo":      "text/xml",
   388  		"frm":     "application/x-frm",
   389  		"g4":      "application/x-g4",
   390  		"gbr":     "application/x-gbr",
   391  		"gif":     "image/gif",
   392  		"gl2":     "application/x-gl2",
   393  		"gp4":     "application/x-gp4",
   394  		"gz":      "application/gzip",
   395  		"hgl":     "application/x-hgl",
   396  		"hmr":     "application/x-hmr",
   397  		"hpg":     "application/x-hpgl",
   398  		"hpl":     "application/x-hpl",
   399  		"hqx":     "application/mac-binhex40",
   400  		"hrf":     "application/x-hrf",
   401  		"hta":     "application/hta",
   402  		"htc":     "text/x-component",
   403  		"htm":     "text/html",
   404  		"html":    "text/html",
   405  		"htt":     "text/webviewhtml",
   406  		"htx":     "text/html",
   407  		"icb":     "application/x-icb",
   408  		"ico":     "application/x-ico",
   409  		"ics":     "text/calendar",
   410  		"iff":     "application/x-iff",
   411  		"ig4":     "application/x-g4",
   412  		"igs":     "application/x-igs",
   413  		"iii":     "application/x-iphone",
   414  		"img":     "application/x-img",
   415  		"ini":     "text/plain",
   416  		"ins":     "application/x-internet-signup",
   417  		"ipa":     "application/vnd.iphone",
   418  		"iso":     "application/x-iso9660-image",
   419  		"isp":     "application/x-internet-signup",
   420  		"jar":     "application/java-archive",
   421  		"java":    "java/*",
   422  		"jfif":    "image/jpeg",
   423  		"jpe":     "image/jpeg",
   424  		"jpeg":    "image/jpeg",
   425  		"jpg":     "image/jpeg",
   426  		"js":      "application/x-javascript",
   427  		"json":    "application/json",
   428  		"jsp":     "text/html",
   429  		"la1":     "audio/x-liquid-file",
   430  		"lar":     "application/x-laplayer-reg",
   431  		"latex":   "application/x-latex",
   432  		"lavs":    "audio/x-liquid-secure",
   433  		"lbm":     "application/x-lbm",
   434  		"lmsff":   "audio/x-la-lms",
   435  		"log":     "text/plain",
   436  		"ls":      "application/x-javascript",
   437  		"ltr":     "application/x-ltr",
   438  		"m1v":     "video/x-mpeg",
   439  		"m2v":     "video/x-mpeg",
   440  		"m3u":     "audio/mpegurl",
   441  		"m4a":     "audio/mp4",
   442  		"m4e":     "video/mpeg4",
   443  		"m4v":     "video/mp4",
   444  		"mac":     "application/x-mac",
   445  		"man":     "application/x-troff-man",
   446  		"math":    "text/xml",
   447  		"mdb":     "application/msaccess",
   448  		"mfp":     "application/x-shockwave-flash",
   449  		"mht":     "message/rfc822",
   450  		"mhtml":   "message/rfc822",
   451  		"mi":      "application/x-mi",
   452  		"mid":     "audio/mid",
   453  		"midi":    "audio/mid",
   454  		"mil":     "application/x-mil",
   455  		"mml":     "text/xml",
   456  		"mnd":     "audio/x-musicnet-download",
   457  		"mns":     "audio/x-musicnet-stream",
   458  		"mocha":   "application/x-javascript",
   459  		"mov":     "video/quicktime",
   460  		"movie":   "video/x-sgi-movie",
   461  		"mp1":     "audio/mp1",
   462  		"mp2":     "audio/mp2",
   463  		"mp2v":    "video/mpeg",
   464  		"mp3":     "audio/mp3",
   465  		"mp4":     "video/mpeg4",
   466  		"mp4a":    "audio/mp4",
   467  		"mp4v":    "video/mp4",
   468  		"mpa":     "video/x-mpg",
   469  		"mpd":     "application/vnd.ms-project",
   470  		"mpe":     "video/x-mpeg",
   471  		"mpeg":    "video/mpg",
   472  		"mpg":     "video/mpg",
   473  		"mpg4":    "video/mp4",
   474  		"mpga":    "audio/rn-mpeg",
   475  		"mpp":     "application/vnd.ms-project",
   476  		"mps":     "video/x-mpeg",
   477  		"mpt":     "application/vnd.ms-project",
   478  		"mpv":     "video/mpg",
   479  		"mpv2":    "video/mpeg",
   480  		"mpw":     "application/vnd.ms-project",
   481  		"mpx":     "application/vnd.ms-project",
   482  		"mtx":     "text/xml",
   483  		"mxp":     "application/x-mmxp",
   484  		"net":     "image/pnetvue",
   485  		"nrf":     "application/x-nrf",
   486  		"nws":     "message/rfc822",
   487  		"odc":     "text/x-ms-odc",
   488  		"oga":     "audio/ogg",
   489  		"ogg":     "audio/ogg",
   490  		"ogv":     "video/ogg",
   491  		"ogx":     "application/ogg",
   492  		"out":     "application/x-out",
   493  		"p10":     "application/pkcs10",
   494  		"p12":     "application/x-pkcs12",
   495  		"p7b":     "application/x-pkcs7-certificates",
   496  		"p7c":     "application/pkcs7-mime",
   497  		"p7m":     "application/pkcs7-mime",
   498  		"p7r":     "application/x-pkcs7-certreqresp",
   499  		"p7s":     "application/pkcs7-signature",
   500  		"pbm":     "image/x-portable-bitmap",
   501  		"pc5":     "application/x-pc5",
   502  		"pci":     "application/x-pci",
   503  		"pcl":     "application/x-pcl",
   504  		"pcx":     "application/x-pcx",
   505  		"pdf":     "application/pdf",
   506  		"pdx":     "application/vnd.adobe.pdx",
   507  		"pfx":     "application/x-pkcs12",
   508  		"pgl":     "application/x-pgl",
   509  		"pgm":     "image/x-portable-graymap",
   510  		"pic":     "application/x-pic",
   511  		"pko":     "application/vnd.ms-pki.pko",
   512  		"pl":      "application/x-perl",
   513  		"plg":     "text/html",
   514  		"pls":     "audio/scpls",
   515  		"plt":     "application/x-plt",
   516  		"png":     "image/png",
   517  		"pnm":     "image/x-portable-anymap",
   518  		"pot":     "application/vnd.ms-powerpoint",
   519  		"ppa":     "application/vnd.ms-powerpoint",
   520  		"ppm":     "application/x-ppm",
   521  		"pps":     "application/vnd.ms-powerpoint",
   522  		"ppt":     "application/vnd.ms-powerpoint",
   523  		"pptx":    "application/vnd.openxmlformats-officedocument.presentationml.presentation",
   524  		"pr":      "application/x-pr",
   525  		"prf":     "application/pics-rules",
   526  		"prn":     "application/x-prn",
   527  		"prt":     "application/x-prt",
   528  		"ps":      "application/postscript",
   529  		"ptn":     "application/x-ptn",
   530  		"pwz":     "application/vnd.ms-powerpoint",
   531  		"qt":      "video/quicktime",
   532  		"r3t":     "text/vnd.rn-realtext3d",
   533  		"ra":      "audio/vnd.rn-realaudio",
   534  		"ram":     "audio/x-pn-realaudio",
   535  		"rar":     "application/x-rar-compressed",
   536  		"ras":     "application/x-ras",
   537  		"rat":     "application/rat-file",
   538  		"rdf":     "text/xml",
   539  		"rec":     "application/vnd.rn-recording",
   540  		"red":     "application/x-red",
   541  		"rgb":     "application/x-rgb",
   542  		"rjs":     "application/vnd.rn-realsystem-rjs",
   543  		"rjt":     "application/vnd.rn-realsystem-rjt",
   544  		"rlc":     "application/x-rlc",
   545  		"rle":     "application/x-rle",
   546  		"rm":      "application/vnd.rn-realmedia",
   547  		"rmf":     "application/vnd.adobe.rmf",
   548  		"rmi":     "audio/mid",
   549  		"rmj":     "application/vnd.rn-realsystem-rmj",
   550  		"rmm":     "audio/x-pn-realaudio",
   551  		"rmp":     "application/vnd.rn-rn_music_package",
   552  		"rms":     "application/vnd.rn-realmedia-secure",
   553  		"rmvb":    "application/vnd.rn-realmedia-vbr",
   554  		"rmx":     "application/vnd.rn-realsystem-rmx",
   555  		"rnx":     "application/vnd.rn-realplayer",
   556  		"rp":      "image/vnd.rn-realpix",
   557  		"rpm":     "audio/x-pn-realaudio-plugin",
   558  		"rsml":    "application/vnd.rn-rsml",
   559  		"rss":     "application/rss+xml",
   560  		"rt":      "text/vnd.rn-realtext",
   561  		"rtf":     "application/x-rtf",
   562  		"rv":      "video/vnd.rn-realvideo",
   563  		"sam":     "application/x-sam",
   564  		"sat":     "application/x-sat",
   565  		"sdp":     "application/sdp",
   566  		"sdw":     "application/x-sdw",
   567  		"sgm":     "text/sgml",
   568  		"sgml":    "text/sgml",
   569  		"sis":     "application/vnd.symbian.install",
   570  		"sisx":    "application/vnd.symbian.install",
   571  		"sit":     "application/x-stuffit",
   572  		"slb":     "application/x-slb",
   573  		"sld":     "application/x-sld",
   574  		"slk":     "drawing/x-slk",
   575  		"smi":     "application/smil",
   576  		"smil":    "application/smil",
   577  		"smk":     "application/x-smk",
   578  		"snd":     "audio/basic",
   579  		"sol":     "text/plain",
   580  		"sor":     "text/plain",
   581  		"spc":     "application/x-pkcs7-certificates",
   582  		"spl":     "application/futuresplash",
   583  		"spp":     "text/xml",
   584  		"ssm":     "application/streamingmedia",
   585  		"sst":     "application/vnd.ms-pki.certstore",
   586  		"stl":     "application/vnd.ms-pki.stl",
   587  		"stm":     "text/html",
   588  		"sty":     "application/x-sty",
   589  		"svg":     "image/svg+xml",
   590  		"swf":     "application/x-shockwave-flash",
   591  		"tar":     "application/x-tar",
   592  		"tdf":     "application/x-tdf",
   593  		"tg4":     "application/x-tg4",
   594  		"tga":     "application/x-tga",
   595  		"tif":     "image/tiff",
   596  		"tiff":    "image/tiff",
   597  		"tld":     "text/xml",
   598  		"top":     "drawing/x-top",
   599  		"torrent": "application/x-bittorrent",
   600  		"tsd":     "text/xml",
   601  		"ttf":     "application/x-font-ttf",
   602  		"txt":     "text/plain",
   603  		"uin":     "application/x-icq",
   604  		"uls":     "text/iuls",
   605  		"vcf":     "text/x-vcard",
   606  		"vda":     "application/x-vda",
   607  		"vdx":     "application/vnd.visio",
   608  		"vml":     "text/xml",
   609  		"vpg":     "application/x-vpeg005",
   610  		"vsd":     "application/vnd.visio",
   611  		"vss":     "application/vnd.visio",
   612  		"vst":     "application/x-vst",
   613  		"vsw":     "application/vnd.visio",
   614  		"vsx":     "application/vnd.visio",
   615  		"vtx":     "application/vnd.visio",
   616  		"vxml":    "text/xml",
   617  		"wav":     "audio/wav",
   618  		"wax":     "audio/x-ms-wax",
   619  		"wb1":     "application/x-wb1",
   620  		"wb2":     "application/x-wb2",
   621  		"wb3":     "application/x-wb3",
   622  		"wbmp":    "image/vnd.wap.wbmp",
   623  		"webm":    "video/webm",
   624  		"wiz":     "application/msword",
   625  		"wk3":     "application/x-wk3",
   626  		"wk4":     "application/x-wk4",
   627  		"wkq":     "application/x-wkq",
   628  		"wks":     "application/x-wks",
   629  		"wm":      "video/x-ms-wm",
   630  		"wma":     "audio/x-ms-wma",
   631  		"wmd":     "application/x-ms-wmd",
   632  		"wmf":     "application/x-wmf",
   633  		"wml":     "text/vnd.wap.wml",
   634  		"wmv":     "video/x-ms-wmv",
   635  		"wmx":     "video/x-ms-wmx",
   636  		"wmz":     "application/x-ms-wmz",
   637  		"woff":    "application/x-font-woff",
   638  		"wp6":     "application/x-wp6",
   639  		"wpd":     "application/x-wpd",
   640  		"wpg":     "application/x-wpg",
   641  		"wpl":     "application/vnd.ms-wpl",
   642  		"wq1":     "application/x-wq1",
   643  		"wr1":     "application/x-wr1",
   644  		"wri":     "application/x-wri",
   645  		"wrk":     "application/x-wrk",
   646  		"ws":      "application/x-ws",
   647  		"ws2":     "application/x-ws",
   648  		"wsc":     "text/scriptlet",
   649  		"wsdl":    "text/xml",
   650  		"wvx":     "video/x-ms-wvx",
   651  		"x_b":     "application/x-x_b",
   652  		"x_t":     "application/x-x_t",
   653  		"xap":     "application/x-silverlight-app",
   654  		"xbm":     "image/x-xbitmap",
   655  		"xdp":     "application/vnd.adobe.xdp",
   656  		"xdr":     "text/xml",
   657  		"xfd":     "application/vnd.adobe.xfd",
   658  		"xfdf":    "application/vnd.adobe.xfdf",
   659  		"xhtml":   "text/html",
   660  		"xls":     "application/vnd.ms-excel",
   661  		"xlsx":    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
   662  		"xlw":     "application/x-xlw",
   663  		"xml":     "text/xml",
   664  		"xpl":     "audio/scpls",
   665  		"xpm":     "image/x-xpixmap",
   666  		"xq":      "text/xml",
   667  		"xql":     "text/xml",
   668  		"xquery":  "text/xml",
   669  		"xsd":     "text/xml",
   670  		"xsl":     "text/xml",
   671  		"xslt":    "text/xml",
   672  		"xwd":     "application/x-xwd",
   673  		"yaml":    "text/yaml",
   674  		"yml":     "text/yaml",
   675  		"zip":     "application/zip",
   676  	}
   677  )
   678  
   679  type HttpMethodType string
   680  
   681  const (
   682  	HttpMethodGet     HttpMethodType = HTTP_GET
   683  	HttpMethodPut     HttpMethodType = HTTP_PUT
   684  	HttpMethodPost    HttpMethodType = HTTP_POST
   685  	HttpMethodDelete  HttpMethodType = HTTP_DELETE
   686  	HttpMethodHead    HttpMethodType = HTTP_HEAD
   687  	HttpMethodOptions HttpMethodType = HTTP_OPTIONS
   688  )
   689  
   690  type SubResourceType string
   691  
   692  const (
   693  	SubResourceStoragePolicy SubResourceType = "storagePolicy"
   694  	SubResourceStorageClass  SubResourceType = "storageClass"
   695  	SubResourceQuota         SubResourceType = "quota"
   696  	SubResourceStorageInfo   SubResourceType = "storageinfo"
   697  	SubResourceLocation      SubResourceType = "location"
   698  	SubResourceAcl           SubResourceType = "acl"
   699  	SubResourcePolicy        SubResourceType = "policy"
   700  	SubResourceCors          SubResourceType = "cors"
   701  	SubResourceVersioning    SubResourceType = "versioning"
   702  	SubResourceWebsite       SubResourceType = "website"
   703  	SubResourceLogging       SubResourceType = "logging"
   704  	SubResourceLifecycle     SubResourceType = "lifecycle"
   705  	SubResourceNotification  SubResourceType = "notification"
   706  	SubResourceTagging       SubResourceType = "tagging"
   707  	SubResourceDelete        SubResourceType = "delete"
   708  	SubResourceVersions      SubResourceType = "versions"
   709  	SubResourceUploads       SubResourceType = "uploads"
   710  	SubResourceRestore       SubResourceType = "restore"
   711  	SubResourceMetadata      SubResourceType = "metadata"
   712  )
   713  
   714  type AclType string
   715  
   716  const (
   717  	AclPrivate                 AclType = "private"
   718  	AclPublicRead              AclType = "public-read"
   719  	AclPublicReadWrite         AclType = "public-read-write"
   720  	AclAuthenticatedRead       AclType = "authenticated-read"
   721  	AclBucketOwnerRead         AclType = "bucket-owner-read"
   722  	AclBucketOwnerFullControl  AclType = "bucket-owner-full-control"
   723  	AclLogDeliveryWrite        AclType = "log-delivery-write"
   724  	AclPublicReadDelivery      AclType = "public-read-delivered"
   725  	AclPublicReadWriteDelivery AclType = "public-read-write-delivered"
   726  )
   727  
   728  type StorageClassType string
   729  
   730  const (
   731  	StorageClassStandard   StorageClassType = "STANDARD"
   732  	StorageClassWarm       StorageClassType = "WARM"
   733  	StorageClassCold       StorageClassType = "COLD"
   734  	storageClassStandardIA StorageClassType = "STANDARD_IA"
   735  	storageClassGlacier    StorageClassType = "GLACIER"
   736  )
   737  
   738  type PermissionType string
   739  
   740  const (
   741  	PermissionRead        PermissionType = "READ"
   742  	PermissionWrite       PermissionType = "WRITE"
   743  	PermissionReadAcp     PermissionType = "READ_ACP"
   744  	PermissionWriteAcp    PermissionType = "WRITE_ACP"
   745  	PermissionFullControl PermissionType = "FULL_CONTROL"
   746  )
   747  
   748  type GranteeType string
   749  
   750  const (
   751  	GranteeGroup GranteeType = "Group"
   752  	GranteeUser  GranteeType = "CanonicalUser"
   753  )
   754  
   755  type GroupUriType string
   756  
   757  const (
   758  	GroupAllUsers           GroupUriType = "AllUsers"
   759  	GroupAuthenticatedUsers GroupUriType = "AuthenticatedUsers"
   760  	GroupLogDelivery        GroupUriType = "LogDelivery"
   761  )
   762  
   763  type VersioningStatusType string
   764  
   765  const (
   766  	VersioningStatusEnabled   VersioningStatusType = "Enabled"
   767  	VersioningStatusSuspended VersioningStatusType = "Suspended"
   768  )
   769  
   770  type ProtocolType string
   771  
   772  const (
   773  	ProtocolHttp  ProtocolType = "http"
   774  	ProtocolHttps ProtocolType = "https"
   775  )
   776  
   777  type RuleStatusType string
   778  
   779  const (
   780  	RuleStatusEnabled  RuleStatusType = "Enabled"
   781  	RuleStatusDisabled RuleStatusType = "Disabled"
   782  )
   783  
   784  type RestoreTierType string
   785  
   786  const (
   787  	RestoreTierExpedited RestoreTierType = "Expedited"
   788  	RestoreTierStandard  RestoreTierType = "Standard"
   789  	RestoreTierBulk      RestoreTierType = "Bulk"
   790  )
   791  
   792  type MetadataDirectiveType string
   793  
   794  const (
   795  	CopyMetadata    MetadataDirectiveType = "COPY"
   796  	ReplaceNew      MetadataDirectiveType = "REPLACE_NEW"
   797  	ReplaceMetadata MetadataDirectiveType = "REPLACE"
   798  )
   799  
   800  type EventType string
   801  
   802  const (
   803  	ObjectCreatedAll  EventType = "ObjectCreated:*"
   804  	ObjectCreatedPut  EventType = "ObjectCreated:Put"
   805  	ObjectCreatedPost EventType = "ObjectCreated:Post"
   806  
   807  	ObjectCreatedCopy                    EventType = "ObjectCreated:Copy"
   808  	ObjectCreatedCompleteMultipartUpload EventType = "ObjectCreated:CompleteMultipartUpload"
   809  	ObjectRemovedAll                     EventType = "ObjectRemoved:*"
   810  	ObjectRemovedDelete                  EventType = "ObjectRemoved:Delete"
   811  	ObjectRemovedDeleteMarkerCreated     EventType = "ObjectRemoved:DeleteMarkerCreated"
   812  )