1// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2// Code generated. DO NOT EDIT.
3
4// Object Storage Service API
5//
6// Common set of Object Storage and Archive Storage APIs for managing buckets, objects, and related resources.
7//
8
9package objectstorage
10
11import (
12	"github.com/oracle/oci-go-sdk/common"
13)
14
15// Bucket A bucket is a container for storing objects in a compartment within a namespace. A bucket is associated with a single compartment.
16// The compartment has policies that indicate what actions a user can perform on a bucket and all the objects in the bucket. For more
17// information, see Managing Buckets (https://docs.cloud.oracle.com/Content/Object/Tasks/managingbuckets.htm).
18// To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized,
19// talk to an administrator. If you are an administrator who needs to write policies to give users access, see
20// Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm).
21type Bucket struct {
22
23	// The Object Storage namespace in which the bucket lives.
24	Namespace *string `mandatory:"true" json:"namespace"`
25
26	// The name of the bucket. Avoid entering confidential information.
27	// Example: my-new-bucket1
28	Name *string `mandatory:"true" json:"name"`
29
30	// The compartment ID in which the bucket is authorized.
31	CompartmentId *string `mandatory:"true" json:"compartmentId"`
32
33	// Arbitrary string keys and values for user-defined metadata.
34	Metadata map[string]string `mandatory:"true" json:"metadata"`
35
36	// The OCID of the user who created the bucket.
37	CreatedBy *string `mandatory:"true" json:"createdBy"`
38
39	// The date and time the bucket was created, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29.
40	TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
41
42	// The entity tag (ETag) for the bucket.
43	Etag *string `mandatory:"true" json:"etag"`
44
45	// The type of public access enabled on this bucket.
46	// A bucket is set to `NoPublicAccess` by default, which only allows an authenticated caller to access the
47	// bucket and its contents. When `ObjectRead` is enabled on the bucket, public access is allowed for the
48	// `GetObject`, `HeadObject`, and `ListObjects` operations. When `ObjectReadWithoutList` is enabled on the
49	// bucket, public access is allowed for the `GetObject` and `HeadObject` operations.
50	PublicAccessType BucketPublicAccessTypeEnum `mandatory:"false" json:"publicAccessType,omitempty"`
51
52	// The storage tier type assigned to the bucket. A bucket is set to 'Standard' tier by default, which means
53	// objects uploaded or copied to the bucket will be in the standard storage tier. When the 'Archive' tier type
54	// is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage.
55	// The 'storageTier' property is immutable after bucket is created.
56	StorageTier BucketStorageTierEnum `mandatory:"false" json:"storageTier,omitempty"`
57
58	// A property that determines whether events will be generated for operations on objects in this bucket.
59	// This is false by default.
60	ObjectEventsEnabled *bool `mandatory:"false" json:"objectEventsEnabled"`
61
62	// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
63	// For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
64	// Example: `{"Department": "Finance"}`
65	FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
66
67	// Defined tags for this resource. Each key is predefined and scoped to a namespace.
68	// For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
69	// Example: `{"Operations": {"CostCenter": "42"}}`
70	DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
71
72	// The OCID of a KMS key id used to call KMS to generate data key or decrypt the encrypted data key.
73	KmsKeyId *string `mandatory:"false" json:"kmsKeyId"`
74
75	// The entity tag (ETag) for the live object lifecycle policy on the bucket.
76	ObjectLifecyclePolicyEtag *string `mandatory:"false" json:"objectLifecyclePolicyEtag"`
77
78	// The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a
79	// lag between what is displayed and the actual object count.
80	ApproximateCount *int64 `mandatory:"false" json:"approximateCount"`
81
82	// The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will
83	// see a lag between what is displayed and the actual size of the bucket.
84	ApproximateSize *int64 `mandatory:"false" json:"approximateSize"`
85}
86
87func (m Bucket) String() string {
88	return common.PointerString(m)
89}
90
91// BucketPublicAccessTypeEnum Enum with underlying type: string
92type BucketPublicAccessTypeEnum string
93
94// Set of constants representing the allowable values for BucketPublicAccessTypeEnum
95const (
96	BucketPublicAccessTypeNopublicaccess        BucketPublicAccessTypeEnum = "NoPublicAccess"
97	BucketPublicAccessTypeObjectread            BucketPublicAccessTypeEnum = "ObjectRead"
98	BucketPublicAccessTypeObjectreadwithoutlist BucketPublicAccessTypeEnum = "ObjectReadWithoutList"
99)
100
101var mappingBucketPublicAccessType = map[string]BucketPublicAccessTypeEnum{
102	"NoPublicAccess":        BucketPublicAccessTypeNopublicaccess,
103	"ObjectRead":            BucketPublicAccessTypeObjectread,
104	"ObjectReadWithoutList": BucketPublicAccessTypeObjectreadwithoutlist,
105}
106
107// GetBucketPublicAccessTypeEnumValues Enumerates the set of values for BucketPublicAccessTypeEnum
108func GetBucketPublicAccessTypeEnumValues() []BucketPublicAccessTypeEnum {
109	values := make([]BucketPublicAccessTypeEnum, 0)
110	for _, v := range mappingBucketPublicAccessType {
111		values = append(values, v)
112	}
113	return values
114}
115
116// BucketStorageTierEnum Enum with underlying type: string
117type BucketStorageTierEnum string
118
119// Set of constants representing the allowable values for BucketStorageTierEnum
120const (
121	BucketStorageTierStandard BucketStorageTierEnum = "Standard"
122	BucketStorageTierArchive  BucketStorageTierEnum = "Archive"
123)
124
125var mappingBucketStorageTier = map[string]BucketStorageTierEnum{
126	"Standard": BucketStorageTierStandard,
127	"Archive":  BucketStorageTierArchive,
128}
129
130// GetBucketStorageTierEnumValues Enumerates the set of values for BucketStorageTierEnum
131func GetBucketStorageTierEnumValues() []BucketStorageTierEnum {
132	values := make([]BucketStorageTierEnum, 0)
133	for _, v := range mappingBucketStorageTier {
134		values = append(values, v)
135	}
136	return values
137}
138