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 SecretBundle(object):
12    """
13    The contents of the secret, properties of the secret (and secret version), and user-provided contextual metadata for the secret.
14    """
15
16    #: A constant which can be used with the stages property of a SecretBundle.
17    #: This constant has a value of "CURRENT"
18    STAGES_CURRENT = "CURRENT"
19
20    #: A constant which can be used with the stages property of a SecretBundle.
21    #: This constant has a value of "PENDING"
22    STAGES_PENDING = "PENDING"
23
24    #: A constant which can be used with the stages property of a SecretBundle.
25    #: This constant has a value of "LATEST"
26    STAGES_LATEST = "LATEST"
27
28    #: A constant which can be used with the stages property of a SecretBundle.
29    #: This constant has a value of "PREVIOUS"
30    STAGES_PREVIOUS = "PREVIOUS"
31
32    #: A constant which can be used with the stages property of a SecretBundle.
33    #: This constant has a value of "DEPRECATED"
34    STAGES_DEPRECATED = "DEPRECATED"
35
36    def __init__(self, **kwargs):
37        """
38        Initializes a new SecretBundle object with values from keyword arguments.
39        The following keyword arguments are supported (corresponding to the getters/setters of this class):
40
41        :param secret_id:
42            The value to assign to the secret_id property of this SecretBundle.
43        :type secret_id: str
44
45        :param time_created:
46            The value to assign to the time_created property of this SecretBundle.
47        :type time_created: datetime
48
49        :param version_number:
50            The value to assign to the version_number property of this SecretBundle.
51        :type version_number: int
52
53        :param version_name:
54            The value to assign to the version_name property of this SecretBundle.
55        :type version_name: str
56
57        :param secret_bundle_content:
58            The value to assign to the secret_bundle_content property of this SecretBundle.
59        :type secret_bundle_content: oci.secrets.models.SecretBundleContentDetails
60
61        :param time_of_deletion:
62            The value to assign to the time_of_deletion property of this SecretBundle.
63        :type time_of_deletion: datetime
64
65        :param time_of_expiry:
66            The value to assign to the time_of_expiry property of this SecretBundle.
67        :type time_of_expiry: datetime
68
69        :param stages:
70            The value to assign to the stages property of this SecretBundle.
71            Allowed values for items in this list are: "CURRENT", "PENDING", "LATEST", "PREVIOUS", "DEPRECATED", 'UNKNOWN_ENUM_VALUE'.
72            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
73        :type stages: list[str]
74
75        :param metadata:
76            The value to assign to the metadata property of this SecretBundle.
77        :type metadata: dict(str, object)
78
79        """
80        self.swagger_types = {
81            'secret_id': 'str',
82            'time_created': 'datetime',
83            'version_number': 'int',
84            'version_name': 'str',
85            'secret_bundle_content': 'SecretBundleContentDetails',
86            'time_of_deletion': 'datetime',
87            'time_of_expiry': 'datetime',
88            'stages': 'list[str]',
89            'metadata': 'dict(str, object)'
90        }
91
92        self.attribute_map = {
93            'secret_id': 'secretId',
94            'time_created': 'timeCreated',
95            'version_number': 'versionNumber',
96            'version_name': 'versionName',
97            'secret_bundle_content': 'secretBundleContent',
98            'time_of_deletion': 'timeOfDeletion',
99            'time_of_expiry': 'timeOfExpiry',
100            'stages': 'stages',
101            'metadata': 'metadata'
102        }
103
104        self._secret_id = None
105        self._time_created = None
106        self._version_number = None
107        self._version_name = None
108        self._secret_bundle_content = None
109        self._time_of_deletion = None
110        self._time_of_expiry = None
111        self._stages = None
112        self._metadata = None
113
114    @property
115    def secret_id(self):
116        """
117        **[Required]** Gets the secret_id of this SecretBundle.
118        The OCID of the secret.
119
120
121        :return: The secret_id of this SecretBundle.
122        :rtype: str
123        """
124        return self._secret_id
125
126    @secret_id.setter
127    def secret_id(self, secret_id):
128        """
129        Sets the secret_id of this SecretBundle.
130        The OCID of the secret.
131
132
133        :param secret_id: The secret_id of this SecretBundle.
134        :type: str
135        """
136        self._secret_id = secret_id
137
138    @property
139    def time_created(self):
140        """
141        Gets the time_created of this SecretBundle.
142        The time when the secret bundle was created.
143
144
145        :return: The time_created of this SecretBundle.
146        :rtype: datetime
147        """
148        return self._time_created
149
150    @time_created.setter
151    def time_created(self, time_created):
152        """
153        Sets the time_created of this SecretBundle.
154        The time when the secret bundle was created.
155
156
157        :param time_created: The time_created of this SecretBundle.
158        :type: datetime
159        """
160        self._time_created = time_created
161
162    @property
163    def version_number(self):
164        """
165        **[Required]** Gets the version_number of this SecretBundle.
166        The version number of the secret.
167
168
169        :return: The version_number of this SecretBundle.
170        :rtype: int
171        """
172        return self._version_number
173
174    @version_number.setter
175    def version_number(self, version_number):
176        """
177        Sets the version_number of this SecretBundle.
178        The version number of the secret.
179
180
181        :param version_number: The version_number of this SecretBundle.
182        :type: int
183        """
184        self._version_number = version_number
185
186    @property
187    def version_name(self):
188        """
189        Gets the version_name of this SecretBundle.
190        The name of the secret version. Labels are unique across the different versions of a particular secret.
191
192
193        :return: The version_name of this SecretBundle.
194        :rtype: str
195        """
196        return self._version_name
197
198    @version_name.setter
199    def version_name(self, version_name):
200        """
201        Sets the version_name of this SecretBundle.
202        The name of the secret version. Labels are unique across the different versions of a particular secret.
203
204
205        :param version_name: The version_name of this SecretBundle.
206        :type: str
207        """
208        self._version_name = version_name
209
210    @property
211    def secret_bundle_content(self):
212        """
213        Gets the secret_bundle_content of this SecretBundle.
214
215        :return: The secret_bundle_content of this SecretBundle.
216        :rtype: oci.secrets.models.SecretBundleContentDetails
217        """
218        return self._secret_bundle_content
219
220    @secret_bundle_content.setter
221    def secret_bundle_content(self, secret_bundle_content):
222        """
223        Sets the secret_bundle_content of this SecretBundle.
224
225        :param secret_bundle_content: The secret_bundle_content of this SecretBundle.
226        :type: oci.secrets.models.SecretBundleContentDetails
227        """
228        self._secret_bundle_content = secret_bundle_content
229
230    @property
231    def time_of_deletion(self):
232        """
233        Gets the time_of_deletion of this SecretBundle.
234        An optional property indicating when to delete the secret version, expressed in `RFC 3339`__ timestamp format.
235        Example: `2019-04-03T21:10:29.600Z`
236
237        __ https://tools.ietf.org/html/rfc3339
238
239
240        :return: The time_of_deletion of this SecretBundle.
241        :rtype: datetime
242        """
243        return self._time_of_deletion
244
245    @time_of_deletion.setter
246    def time_of_deletion(self, time_of_deletion):
247        """
248        Sets the time_of_deletion of this SecretBundle.
249        An optional property indicating when to delete the secret version, expressed in `RFC 3339`__ timestamp format.
250        Example: `2019-04-03T21:10:29.600Z`
251
252        __ https://tools.ietf.org/html/rfc3339
253
254
255        :param time_of_deletion: The time_of_deletion of this SecretBundle.
256        :type: datetime
257        """
258        self._time_of_deletion = time_of_deletion
259
260    @property
261    def time_of_expiry(self):
262        """
263        Gets the time_of_expiry of this SecretBundle.
264        An optional property indicating when the secret version will expire, expressed in `RFC 3339`__ timestamp format.
265        Example: `2019-04-03T21:10:29.600Z`
266
267        __ https://tools.ietf.org/html/rfc3339
268
269
270        :return: The time_of_expiry of this SecretBundle.
271        :rtype: datetime
272        """
273        return self._time_of_expiry
274
275    @time_of_expiry.setter
276    def time_of_expiry(self, time_of_expiry):
277        """
278        Sets the time_of_expiry of this SecretBundle.
279        An optional property indicating when the secret version will expire, expressed in `RFC 3339`__ timestamp format.
280        Example: `2019-04-03T21:10:29.600Z`
281
282        __ https://tools.ietf.org/html/rfc3339
283
284
285        :param time_of_expiry: The time_of_expiry of this SecretBundle.
286        :type: datetime
287        """
288        self._time_of_expiry = time_of_expiry
289
290    @property
291    def stages(self):
292        """
293        Gets the stages of this SecretBundle.
294        A list of possible rotation states for the secret version.
295
296        Allowed values for items in this list are: "CURRENT", "PENDING", "LATEST", "PREVIOUS", "DEPRECATED", 'UNKNOWN_ENUM_VALUE'.
297        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
298
299
300        :return: The stages of this SecretBundle.
301        :rtype: list[str]
302        """
303        return self._stages
304
305    @stages.setter
306    def stages(self, stages):
307        """
308        Sets the stages of this SecretBundle.
309        A list of possible rotation states for the secret version.
310
311
312        :param stages: The stages of this SecretBundle.
313        :type: list[str]
314        """
315        allowed_values = ["CURRENT", "PENDING", "LATEST", "PREVIOUS", "DEPRECATED"]
316        if stages:
317            stages[:] = ['UNKNOWN_ENUM_VALUE' if not value_allowed_none_or_none_sentinel(x, allowed_values) else x for x in stages]
318        self._stages = stages
319
320    @property
321    def metadata(self):
322        """
323        Gets the metadata of this SecretBundle.
324        Customer-provided contextual metadata for the secret.
325
326
327        :return: The metadata of this SecretBundle.
328        :rtype: dict(str, object)
329        """
330        return self._metadata
331
332    @metadata.setter
333    def metadata(self, metadata):
334        """
335        Sets the metadata of this SecretBundle.
336        Customer-provided contextual metadata for the secret.
337
338
339        :param metadata: The metadata of this SecretBundle.
340        :type: dict(str, object)
341        """
342        self._metadata = metadata
343
344    def __repr__(self):
345        return formatted_flat_dict(self)
346
347    def __eq__(self, other):
348        if other is None:
349            return False
350
351        return self.__dict__ == other.__dict__
352
353    def __ne__(self, other):
354        return not self == other
355