1# coding: utf-8 2# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. 3# 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. 4 5 6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401 7from oci.decorators import init_model_state_from_kwargs 8 9 10@init_model_state_from_kwargs 11class ObjectSummary(object): 12 """ 13 To use any of the API operations, you must be authorized in an IAM policy. If you are not authorized, 14 talk to an administrator. If you are an administrator who needs to write policies to give users access, see 15 `Getting Started with Policies`__. 16 17 __ https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm 18 """ 19 20 #: A constant which can be used with the storage_tier property of a ObjectSummary. 21 #: This constant has a value of "Standard" 22 STORAGE_TIER_STANDARD = "Standard" 23 24 #: A constant which can be used with the storage_tier property of a ObjectSummary. 25 #: This constant has a value of "InfrequentAccess" 26 STORAGE_TIER_INFREQUENT_ACCESS = "InfrequentAccess" 27 28 #: A constant which can be used with the storage_tier property of a ObjectSummary. 29 #: This constant has a value of "Archive" 30 STORAGE_TIER_ARCHIVE = "Archive" 31 32 #: A constant which can be used with the archival_state property of a ObjectSummary. 33 #: This constant has a value of "Archived" 34 ARCHIVAL_STATE_ARCHIVED = "Archived" 35 36 #: A constant which can be used with the archival_state property of a ObjectSummary. 37 #: This constant has a value of "Restoring" 38 ARCHIVAL_STATE_RESTORING = "Restoring" 39 40 #: A constant which can be used with the archival_state property of a ObjectSummary. 41 #: This constant has a value of "Restored" 42 ARCHIVAL_STATE_RESTORED = "Restored" 43 44 def __init__(self, **kwargs): 45 """ 46 Initializes a new ObjectSummary object with values from keyword arguments. 47 The following keyword arguments are supported (corresponding to the getters/setters of this class): 48 49 :param name: 50 The value to assign to the name property of this ObjectSummary. 51 :type name: str 52 53 :param size: 54 The value to assign to the size property of this ObjectSummary. 55 :type size: int 56 57 :param md5: 58 The value to assign to the md5 property of this ObjectSummary. 59 :type md5: str 60 61 :param time_created: 62 The value to assign to the time_created property of this ObjectSummary. 63 :type time_created: datetime 64 65 :param etag: 66 The value to assign to the etag property of this ObjectSummary. 67 :type etag: str 68 69 :param storage_tier: 70 The value to assign to the storage_tier property of this ObjectSummary. 71 Allowed values for this property are: "Standard", "InfrequentAccess", "Archive", 'UNKNOWN_ENUM_VALUE'. 72 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 73 :type storage_tier: str 74 75 :param archival_state: 76 The value to assign to the archival_state property of this ObjectSummary. 77 Allowed values for this property are: "Archived", "Restoring", "Restored", 'UNKNOWN_ENUM_VALUE'. 78 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 79 :type archival_state: str 80 81 :param time_modified: 82 The value to assign to the time_modified property of this ObjectSummary. 83 :type time_modified: datetime 84 85 """ 86 self.swagger_types = { 87 'name': 'str', 88 'size': 'int', 89 'md5': 'str', 90 'time_created': 'datetime', 91 'etag': 'str', 92 'storage_tier': 'str', 93 'archival_state': 'str', 94 'time_modified': 'datetime' 95 } 96 97 self.attribute_map = { 98 'name': 'name', 99 'size': 'size', 100 'md5': 'md5', 101 'time_created': 'timeCreated', 102 'etag': 'etag', 103 'storage_tier': 'storageTier', 104 'archival_state': 'archivalState', 105 'time_modified': 'timeModified' 106 } 107 108 self._name = None 109 self._size = None 110 self._md5 = None 111 self._time_created = None 112 self._etag = None 113 self._storage_tier = None 114 self._archival_state = None 115 self._time_modified = None 116 117 @property 118 def name(self): 119 """ 120 **[Required]** Gets the name of this ObjectSummary. 121 The name of the object. Avoid entering confidential information. 122 Example: test/object1.log 123 124 125 :return: The name of this ObjectSummary. 126 :rtype: str 127 """ 128 return self._name 129 130 @name.setter 131 def name(self, name): 132 """ 133 Sets the name of this ObjectSummary. 134 The name of the object. Avoid entering confidential information. 135 Example: test/object1.log 136 137 138 :param name: The name of this ObjectSummary. 139 :type: str 140 """ 141 self._name = name 142 143 @property 144 def size(self): 145 """ 146 Gets the size of this ObjectSummary. 147 Size of the object in bytes. 148 149 150 :return: The size of this ObjectSummary. 151 :rtype: int 152 """ 153 return self._size 154 155 @size.setter 156 def size(self, size): 157 """ 158 Sets the size of this ObjectSummary. 159 Size of the object in bytes. 160 161 162 :param size: The size of this ObjectSummary. 163 :type: int 164 """ 165 self._size = size 166 167 @property 168 def md5(self): 169 """ 170 Gets the md5 of this ObjectSummary. 171 Base64-encoded MD5 hash of the object data. 172 173 174 :return: The md5 of this ObjectSummary. 175 :rtype: str 176 """ 177 return self._md5 178 179 @md5.setter 180 def md5(self, md5): 181 """ 182 Sets the md5 of this ObjectSummary. 183 Base64-encoded MD5 hash of the object data. 184 185 186 :param md5: The md5 of this ObjectSummary. 187 :type: str 188 """ 189 self._md5 = md5 190 191 @property 192 def time_created(self): 193 """ 194 Gets the time_created of this ObjectSummary. 195 The date and time the object was created, as described in `RFC 2616`__. 196 197 __ https://tools.ietf.org/html/rfc2616#section-14.29 198 199 200 :return: The time_created of this ObjectSummary. 201 :rtype: datetime 202 """ 203 return self._time_created 204 205 @time_created.setter 206 def time_created(self, time_created): 207 """ 208 Sets the time_created of this ObjectSummary. 209 The date and time the object was created, as described in `RFC 2616`__. 210 211 __ https://tools.ietf.org/html/rfc2616#section-14.29 212 213 214 :param time_created: The time_created of this ObjectSummary. 215 :type: datetime 216 """ 217 self._time_created = time_created 218 219 @property 220 def etag(self): 221 """ 222 Gets the etag of this ObjectSummary. 223 The current entity tag (ETag) for the object. 224 225 226 :return: The etag of this ObjectSummary. 227 :rtype: str 228 """ 229 return self._etag 230 231 @etag.setter 232 def etag(self, etag): 233 """ 234 Sets the etag of this ObjectSummary. 235 The current entity tag (ETag) for the object. 236 237 238 :param etag: The etag of this ObjectSummary. 239 :type: str 240 """ 241 self._etag = etag 242 243 @property 244 def storage_tier(self): 245 """ 246 Gets the storage_tier of this ObjectSummary. 247 The storage tier that the object is stored in. 248 249 Allowed values for this property are: "Standard", "InfrequentAccess", "Archive", 'UNKNOWN_ENUM_VALUE'. 250 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 251 252 253 :return: The storage_tier of this ObjectSummary. 254 :rtype: str 255 """ 256 return self._storage_tier 257 258 @storage_tier.setter 259 def storage_tier(self, storage_tier): 260 """ 261 Sets the storage_tier of this ObjectSummary. 262 The storage tier that the object is stored in. 263 264 265 :param storage_tier: The storage_tier of this ObjectSummary. 266 :type: str 267 """ 268 allowed_values = ["Standard", "InfrequentAccess", "Archive"] 269 if not value_allowed_none_or_none_sentinel(storage_tier, allowed_values): 270 storage_tier = 'UNKNOWN_ENUM_VALUE' 271 self._storage_tier = storage_tier 272 273 @property 274 def archival_state(self): 275 """ 276 Gets the archival_state of this ObjectSummary. 277 Archival state of an object. This field is set only for objects in Archive tier. 278 279 Allowed values for this property are: "Archived", "Restoring", "Restored", 'UNKNOWN_ENUM_VALUE'. 280 Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'. 281 282 283 :return: The archival_state of this ObjectSummary. 284 :rtype: str 285 """ 286 return self._archival_state 287 288 @archival_state.setter 289 def archival_state(self, archival_state): 290 """ 291 Sets the archival_state of this ObjectSummary. 292 Archival state of an object. This field is set only for objects in Archive tier. 293 294 295 :param archival_state: The archival_state of this ObjectSummary. 296 :type: str 297 """ 298 allowed_values = ["Archived", "Restoring", "Restored"] 299 if not value_allowed_none_or_none_sentinel(archival_state, allowed_values): 300 archival_state = 'UNKNOWN_ENUM_VALUE' 301 self._archival_state = archival_state 302 303 @property 304 def time_modified(self): 305 """ 306 Gets the time_modified of this ObjectSummary. 307 The date and time the object was modified, as described in `RFC 2616`__, section 14.29. 308 309 __ https://tools.ietf.org/rfc/rfc2616 310 311 312 :return: The time_modified of this ObjectSummary. 313 :rtype: datetime 314 """ 315 return self._time_modified 316 317 @time_modified.setter 318 def time_modified(self, time_modified): 319 """ 320 Sets the time_modified of this ObjectSummary. 321 The date and time the object was modified, as described in `RFC 2616`__, section 14.29. 322 323 __ https://tools.ietf.org/rfc/rfc2616 324 325 326 :param time_modified: The time_modified of this ObjectSummary. 327 :type: datetime 328 """ 329 self._time_modified = time_modified 330 331 def __repr__(self): 332 return formatted_flat_dict(self) 333 334 def __eq__(self, other): 335 if other is None: 336 return False 337 338 return self.__dict__ == other.__dict__ 339 340 def __ne__(self, other): 341 return not self == other 342