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// UploadPartRequest wrapper for the UploadPart operation
13type UploadPartRequest 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 upload ID for a multipart upload.
27	UploadId *string `mandatory:"true" contributesTo:"query" name:"uploadId"`
28
29	// The part number that identifies the object part currently being uploaded.
30	UploadPartNum *int `mandatory:"true" contributesTo:"query" name:"uploadPartNum"`
31
32	// The content length of the body.
33	ContentLength *int64 `mandatory:"true" contributesTo:"header" name:"Content-Length"`
34
35	// The part being uploaded to the Object Storage service.
36	UploadPartBody io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"`
37
38	// The client request ID for tracing.
39	OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"`
40
41	// 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.
42	// For uploading a part, this is the entity tag of the target part.
43	IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"`
44
45	// The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the object
46	// already exists. For creating and committing a multipart upload, this is the entity tag of the target object. For uploading a
47	// part, this is the entity tag of the target part.
48	IfNoneMatch *string `mandatory:"false" contributesTo:"header" name:"if-none-match"`
49
50	// 100-continue
51	Expect *string `mandatory:"false" contributesTo:"header" name:"Expect"`
52
53	// The base-64 encoded MD5 hash of the body. If the Content-MD5 header is present, Object Storage performs an integrity check
54	// 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.
55	// If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message:
56	// "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)"
57	ContentMD5 *string `mandatory:"false" contributesTo:"header" name:"Content-MD5"`
58
59	// Metadata about the request. This information will not be transmitted to the service, but
60	// represents information that the SDK will consume to drive retry behavior.
61	RequestMetadata common.RequestMetadata
62}
63
64func (request UploadPartRequest) String() string {
65	return common.PointerString(request)
66}
67
68// HTTPRequest implements the OCIRequest interface
69func (request UploadPartRequest) HTTPRequest(method, path string) (http.Request, error) {
70	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
71}
72
73// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
74func (request UploadPartRequest) RetryPolicy() *common.RetryPolicy {
75	return request.RequestMetadata.RetryPolicy
76}
77
78// UploadPartResponse wrapper for the UploadPart operation
79type UploadPartResponse struct {
80
81	// The underlying http response
82	RawResponse *http.Response
83
84	// Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging.
85	OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"`
86
87	// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular
88	// request, provide this request ID.
89	OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
90
91	// The base64-encoded MD5 hash of the request body, as computed by the server.
92	OpcContentMd5 *string `presentIn:"header" name:"opc-content-md5"`
93
94	// The entity tag (ETag) for the object.
95	ETag *string `presentIn:"header" name:"etag"`
96}
97
98func (response UploadPartResponse) String() string {
99	return common.PointerString(response)
100}
101
102// HTTPResponse implements the OCIResponse interface
103func (response UploadPartResponse) HTTPResponse() *http.Response {
104	return response.RawResponse
105}
106