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	"io"
9	"net/http"
10)
11
12// PutObjectRequest wrapper for the PutObject operation
13type PutObjectRequest 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	// The content length of the body.
27	ContentLength *int64 `mandatory:"true" contributesTo:"header" name:"Content-Length"`
28
29	// The object to upload to the object store.
30	PutObjectBody io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"`
31
32	// 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.
33	// For uploading a part, this is the entity tag of the target part.
34	IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`
35
36	// The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object
37	// already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a
38	// part, this is the entity tag of the target part.
39	IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"`
40
41	// The client request ID for tracing.
42	OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"`
43
44	// 100-continue
45	Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"`
46
47	// The base-64 encoded MD5 hash of the body. If the Content-MD5 header is present, Object Storage performs an integrity check
48	// on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header.
49	// If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message:
50	// "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)"
51	ContentMD5 *string `mandatory:"false" contributesTo:"header" name:"Content-MD5"`
52
53	// The content type of the object.  Defaults to 'application/octet-stream' if not overridden during the PutObject call.
54	ContentType *string `mandatory:"false" contributesTo:"header" name:"Content-Type"`
55
56	// The content language of the object.
57	ContentLanguage *string `mandatory:"false" contributesTo:"header" name:"Content-Language"`
58
59	// The content encoding of the object.
60	ContentEncoding *string `mandatory:"false" contributesTo:"header" name:"Content-Encoding"`
61
62	// Optional user-defined metadata key and value.
63	OpcMeta map[string]string `mandatory:"false" contributesTo:"header-collection" prefix:"opc-meta-"`
64
65	// Metadata about the request. This information will not be transmitted to the service, but
66	// represents information that the SDK will consume to drive retry behavior.
67	RequestMetadata common.RequestMetadata
68}
69
70func (request PutObjectRequest) String() string {
71	return common.PointerString(request)
72}
73
74// HTTPRequest implements the OCIRequest interface
75func (request PutObjectRequest) HTTPRequest(method, path string) (http.Request, error) {
76	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
77}
78
79// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
80func (request PutObjectRequest) RetryPolicy() *common.RetryPolicy {
81	return request.RequestMetadata.RetryPolicy
82}
83
84// PutObjectResponse wrapper for the PutObject operation
85type PutObjectResponse struct {
86
87	// The underlying http response
88	RawResponse *http.Response
89
90	// Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging.
91	OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"`
92
93	// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular
94	// request, provide this request ID.
95	OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
96
97	// The base-64 encoded MD5 hash of the request body as computed by the server.
98	OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"`
99
100	// The entity tag (ETag) for the object.
101	ETag *string `presentIn:"header" name:"etag"`
102
103	// The time the object was modified, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29.
104	LastModified *common.SDKTime `presentIn:"header" name:"last-modified"`
105}
106
107func (response PutObjectResponse) String() string {
108	return common.PointerString(response)
109}
110
111// HTTPResponse implements the OCIResponse interface
112func (response PutObjectResponse) HTTPResponse() *http.Response {
113	return response.RawResponse
114}
115