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// CreateRetentionRuleRequest wrapper for the CreateRetentionRule operation
13type CreateRetentionRuleRequest 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 retention rule to create for the bucket.
23	CreateRetentionRuleDetails `contributesTo:"body"`
24
25	// The client request ID for tracing.
26	OpcClientRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-client-request-id"`
27
28	// Metadata about the request. This information will not be transmitted to the service, but
29	// represents information that the SDK will consume to drive retry behavior.
30	RequestMetadata common.RequestMetadata
31}
32
33func (request CreateRetentionRuleRequest) String() string {
34	return common.PointerString(request)
35}
36
37// HTTPRequest implements the OCIRequest interface
38func (request CreateRetentionRuleRequest) HTTPRequest(method, path string) (http.Request, error) {
39	return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
40}
41
42// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
43func (request CreateRetentionRuleRequest) RetryPolicy() *common.RetryPolicy {
44	return request.RequestMetadata.RetryPolicy
45}
46
47// CreateRetentionRuleResponse wrapper for the CreateRetentionRule operation
48type CreateRetentionRuleResponse struct {
49
50	// The underlying http response
51	RawResponse *http.Response
52
53	// The RetentionRule instance
54	RetentionRule `presentIn:"body"`
55
56	// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, provide this request ID.
57	OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
58
59	// Echoes back the value passed in the opc-client-request-id header, for use by clients when debugging.
60	OpcClientRequestId *string `presentIn:"header" name:"opc-client-request-id"`
61
62	// The entity tag (ETag) for the retention rule that was created.
63	Etag *string `presentIn:"header" name:"etag"`
64}
65
66func (response CreateRetentionRuleResponse) String() string {
67	return common.PointerString(response)
68}
69
70// HTTPResponse implements the OCIResponse interface
71func (response CreateRetentionRuleResponse) HTTPResponse() *http.Response {
72	return response.RawResponse
73}
74