Class: OCI::ObjectStorage::Models::CreateBucketDetails
- Inherits:
-
Object
- Object
- OCI::ObjectStorage::Models::CreateBucketDetails
- Defined in:
- lib/oci/object_storage/models/create_bucket_details.rb
Constant Summary collapse
- PUBLIC_ACCESS_TYPE_ENUM =
[PUBLIC_ACCESS_TYPE_NO_PUBLIC_ACCESS = 'NoPublicAccess', PUBLIC_ACCESS_TYPE_OBJECT_READ = 'ObjectRead']
- STORAGE_TIER_ENUM =
[STORAGE_TIER_STANDARD = 'Standard', STORAGE_TIER_ARCHIVE = 'Archive']
Instance Attribute Summary collapse
-
#compartment_id ⇒ String
The ID of the compartment in which to create the bucket.
-
#metadata ⇒ Hash<String, String>
Arbitrary string, up to 4KB, of keys and values for user-defined metadata.
-
#name ⇒ String
The name of the bucket.
-
#public_access_type ⇒ String
The type of public access enabled on this bucket.
-
#storage_tier ⇒ String
The type of storage tier of this bucket.
Instance Method Summary collapse
-
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other_object) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CreateBucketDetails
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CreateBucketDetails
Initializes the object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 49 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes[:'name'] self.name = attributes[:'name'] end if attributes[:'compartmentId'] self.compartment_id = attributes[:'compartmentId'] end if attributes[:'metadata'] self. = attributes[:'metadata'] end if attributes[:'publicAccessType'] self.public_access_type = attributes[:'publicAccessType'] end if attributes[:'storageTier'] self.storage_tier = attributes[:'storageTier'] end end |
Instance Attribute Details
#compartment_id ⇒ String
The ID of the compartment in which to create the bucket.
24 25 26 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 24 def compartment_id @compartment_id end |
#metadata ⇒ Hash<String, String>
Arbitrary string, up to 4KB, of keys and values for user-defined metadata.
28 29 30 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 28 def end |
#name ⇒ String
The name of the bucket. Valid characters are uppercase or lowercase letters, numbers, and dashes. Bucket names must be unique within the namespace. Avoid entering confidential information. example: Example: my-new-bucket1
20 21 22 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 20 def name @name end |
#public_access_type ⇒ String
The type of public access enabled on this bucket. A bucket is set to ‘NoPublicAccess` by default, which only allows an authenticated caller to access the bucket and its contents. When `ObjectRead` is enabled on the bucket, public access is allowed for the `GetObject`, `HeadObject`, and `ListObjects` operations.
36 37 38 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 36 def public_access_type @public_access_type end |
#storage_tier ⇒ String
The type of storage tier of this bucket. A bucket is set to ‘Standard’ tier by default, which means the bucket will be put in the standard storage tier. When ‘Archive’ tier type is set explicitly, the bucket is put in the Archive Storage tier. The ‘storageTier’ property is immutable after bucket is created.
44 45 46 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 44 def storage_tier @storage_tier end |
Instance Method Details
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
99 100 101 102 103 104 105 106 107 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 99 def ==(other_object) return true if self.equal?(other_object) self.class == other_object.class && name == other_object.name && compartment_id == other_object.compartment_id && == other_object. && public_access_type == other_object.public_access_type && storage_tier == other_object.storage_tier end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 124 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other_object) ⇒ Boolean
111 112 113 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 111 def eql?(other_object) self == other_object end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
117 118 119 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 117 def hash [name, compartment_id, , public_access_type, storage_tier].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
149 150 151 152 153 154 155 156 157 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 149 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
143 144 145 |
# File 'lib/oci/object_storage/models/create_bucket_details.rb', line 143 def to_s to_hash.to_s end |