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