1// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. 2// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 3// Code generated. DO NOT EDIT. 4 5package objectstorage 6 7import ( 8 "github.com/oracle/oci-go-sdk/common" 9 "net/http" 10) 11 12// HeadObjectRequest wrapper for the HeadObject operation 13type HeadObjectRequest struct { 14 15 // The Object Storage namespace used for the request. 16 NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` 17 18 // The name of the bucket. Avoid entering confidential information. 19 // Example: `my-new-bucket1` 20 BucketName *string `mandatory:"true" contributesTo:"path" name:"bucketName"` 21 22 // The name of the object. Avoid entering confidential information. 23 // Example: `test/object1.log` 24 ObjectName *string `mandatory:"true" contributesTo:"path" name:"objectName"` 25 26 // VersionId used to identify a particular version of the object 27 VersionId *string `mandatory:"false" contributesTo:"query" name:"versionId"` 28 29 // The entity tag (ETag) to match. For creating and committing a multipart upload to an object, this is the entity tag of the target object. 30 // For uploading a part, this is the entity tag of the target part. 31 IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` 32 33 // The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object 34 // already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a 35 // part, this is the entity tag of the target part. 36 IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"` 37 38 // The client request ID for tracing. 39 OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"` 40 41 // The optional header that specifies "AES256" as the encryption algorithm. For more information, see 42 // Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). 43 OpcSseCustomerAlgorithm *string `mandatory:"false" contributesTo:"header" name:"opc-sse-customer-algorithm"` 44 45 // The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or 46 // decrypt the data. For more information, see 47 // Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). 48 OpcSseCustomerKey *string `mandatory:"false" contributesTo:"header" name:"opc-sse-customer-key"` 49 50 // The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This 51 // value is used to check the integrity of the encryption key. For more information, see 52 // Using Your Own Keys for Server-Side Encryption (https://docs.cloud.oracle.com/Content/Object/Tasks/usingyourencryptionkeys.htm). 53 OpcSseCustomerKeySha256 *string `mandatory:"false" contributesTo:"header" name:"opc-sse-customer-key-sha256"` 54 55 // Metadata about the request. This information will not be transmitted to the service, but 56 // represents information that the SDK will consume to drive retry behavior. 57 RequestMetadata common.RequestMetadata 58} 59 60func (request HeadObjectRequest) String() string { 61 return common.PointerString(request) 62} 63 64// HTTPRequest implements the OCIRequest interface 65func (request HeadObjectRequest) HTTPRequest(method, path string) (http.Request, error) { 66 return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) 67} 68 69// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. 70func (request HeadObjectRequest) RetryPolicy() *common.RetryPolicy { 71 return request.RequestMetadata.RetryPolicy 72} 73 74// HeadObjectResponse wrapper for the HeadObject operation 75type HeadObjectResponse struct { 76 77 // The underlying http response 78 RawResponse *http.Response 79 80 // Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging. 81 OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"` 82 83 // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular 84 // request, provide this request ID. 85 OpcRequestId *string `presentIn:"header" name:"opc-request-id"` 86 87 // The entity tag (ETag) for the object. 88 ETag *string `presentIn:"header" name:"etag"` 89 90 // The user-defined metadata for the object. 91 OpcMeta map[string]string `presentIn:"header-collection" prefix:"opc-meta-"` 92 93 // The object size in bytes. 94 ContentLength *int64 `presentIn:"header" name:"content-length"` 95 96 // Content-MD5 header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.15). 97 // Unavailable for objects uploaded using multipart upload. 98 ContentMd5 *string `presentIn:"header" name:"content-md5"` 99 100 // Only applicable to objects uploaded using multipart upload. 101 // Base-64 representation of the multipart object hash. 102 // The multipart object hash is calculated by taking the MD5 hashes of the parts, 103 // concatenating the binary representation of those hashes in order of their part numbers, 104 // and then calculating the MD5 hash of the concatenated values. 105 OpcMultipartMd5 *string `presentIn:"header" name:"opc-multipart-md5"` 106 107 // Content-Type header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.17). 108 ContentType *string `presentIn:"header" name:"content-type"` 109 110 // Content-Language header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.12). 111 ContentLanguage *string `presentIn:"header" name:"content-language"` 112 113 // Content-Encoding header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.11). 114 ContentEncoding *string `presentIn:"header" name:"content-encoding"` 115 116 // Cache-Control header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.9). 117 CacheControl *string `presentIn:"header" name:"cache-control"` 118 119 // Content-Disposition header, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-19.5.1). 120 ContentDisposition *string `presentIn:"header" name:"content-disposition"` 121 122 // The object modification time, as described in RFC 2616 (https://tools.ietf.org/html/rfc2616#section-14.29). 123 LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` 124 125 // The current state of the object. 126 ArchivalState HeadObjectArchivalStateEnum `presentIn:"header" name:"archival-state"` 127 128 // Time that the object is returned to the archived state. This field is only present for restored objects. 129 TimeOfArchival *common.SDKTime `presentIn:"header" name:"time-of-archival"` 130 131 // VersionId of the object requested 132 VersionId *string `presentIn:"header" name:"version-id"` 133 134 // Flag to indicate whether or not the object was modified. If this is true, 135 // the getter for the object itself will return null. Callers should check this 136 // if they specified one of the request params that might result in a conditional 137 // response (like 'if-match'/'if-none-match'). 138 IsNotModified bool 139} 140 141func (response HeadObjectResponse) String() string { 142 return common.PointerString(response) 143} 144 145// HTTPResponse implements the OCIResponse interface 146func (response HeadObjectResponse) HTTPResponse() *http.Response { 147 return response.RawResponse 148} 149 150// HeadObjectArchivalStateEnum Enum with underlying type: string 151type HeadObjectArchivalStateEnum string 152 153// Set of constants representing the allowable values for HeadObjectArchivalStateEnum 154const ( 155 HeadObjectArchivalStateAvailable HeadObjectArchivalStateEnum = "AVAILABLE" 156 HeadObjectArchivalStateArchived HeadObjectArchivalStateEnum = "ARCHIVED" 157 HeadObjectArchivalStateRestoring HeadObjectArchivalStateEnum = "RESTORING" 158 HeadObjectArchivalStateRestored HeadObjectArchivalStateEnum = "RESTORED" 159) 160 161var mappingHeadObjectArchivalState = map[string]HeadObjectArchivalStateEnum{ 162 "AVAILABLE": HeadObjectArchivalStateAvailable, 163 "ARCHIVED": HeadObjectArchivalStateArchived, 164 "RESTORING": HeadObjectArchivalStateRestoring, 165 "RESTORED": HeadObjectArchivalStateRestored, 166} 167 168// GetHeadObjectArchivalStateEnumValues Enumerates the set of values for HeadObjectArchivalStateEnum 169func GetHeadObjectArchivalStateEnumValues() []HeadObjectArchivalStateEnum { 170 values := make([]HeadObjectArchivalStateEnum, 0) 171 for _, v := range mappingHeadObjectArchivalState { 172 values = append(values, v) 173 } 174 return values 175} 176