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 BootVolumeReplica(object):
12    """
13    An asynchronous replica of a boot volume that can then be used to create
14    a new boot volume or recover a boot volume. For more information, see `Overview
15    of Cross-Region Volume Replication`__
16    To use any of the API operations, you must be authorized in an IAM policy.
17    If you're not authorized, talk to an administrator. If you're an administrator
18    who needs to write policies to give users access, see `Getting Started with
19    Policies`__.
20
21    **Warning:** Oracle recommends that you avoid using any confidential information when you
22    supply string values using the API.
23
24    __ https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/volumereplication.htm
25    __ https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm
26    """
27
28    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
29    #: This constant has a value of "PROVISIONING"
30    LIFECYCLE_STATE_PROVISIONING = "PROVISIONING"
31
32    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
33    #: This constant has a value of "AVAILABLE"
34    LIFECYCLE_STATE_AVAILABLE = "AVAILABLE"
35
36    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
37    #: This constant has a value of "ACTIVATING"
38    LIFECYCLE_STATE_ACTIVATING = "ACTIVATING"
39
40    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
41    #: This constant has a value of "TERMINATING"
42    LIFECYCLE_STATE_TERMINATING = "TERMINATING"
43
44    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
45    #: This constant has a value of "TERMINATED"
46    LIFECYCLE_STATE_TERMINATED = "TERMINATED"
47
48    #: A constant which can be used with the lifecycle_state property of a BootVolumeReplica.
49    #: This constant has a value of "FAULTY"
50    LIFECYCLE_STATE_FAULTY = "FAULTY"
51
52    def __init__(self, **kwargs):
53        """
54        Initializes a new BootVolumeReplica object with values from keyword arguments.
55        The following keyword arguments are supported (corresponding to the getters/setters of this class):
56
57        :param availability_domain:
58            The value to assign to the availability_domain property of this BootVolumeReplica.
59        :type availability_domain: str
60
61        :param compartment_id:
62            The value to assign to the compartment_id property of this BootVolumeReplica.
63        :type compartment_id: str
64
65        :param defined_tags:
66            The value to assign to the defined_tags property of this BootVolumeReplica.
67        :type defined_tags: dict(str, dict(str, object))
68
69        :param display_name:
70            The value to assign to the display_name property of this BootVolumeReplica.
71        :type display_name: str
72
73        :param freeform_tags:
74            The value to assign to the freeform_tags property of this BootVolumeReplica.
75        :type freeform_tags: dict(str, str)
76
77        :param id:
78            The value to assign to the id property of this BootVolumeReplica.
79        :type id: str
80
81        :param lifecycle_state:
82            The value to assign to the lifecycle_state property of this BootVolumeReplica.
83            Allowed values for this property are: "PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY", 'UNKNOWN_ENUM_VALUE'.
84            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
85        :type lifecycle_state: str
86
87        :param size_in_gbs:
88            The value to assign to the size_in_gbs property of this BootVolumeReplica.
89        :type size_in_gbs: int
90
91        :param time_created:
92            The value to assign to the time_created property of this BootVolumeReplica.
93        :type time_created: datetime
94
95        :param time_last_synced:
96            The value to assign to the time_last_synced property of this BootVolumeReplica.
97        :type time_last_synced: datetime
98
99        :param boot_volume_id:
100            The value to assign to the boot_volume_id property of this BootVolumeReplica.
101        :type boot_volume_id: str
102
103        :param image_id:
104            The value to assign to the image_id property of this BootVolumeReplica.
105        :type image_id: str
106
107        :param total_data_transferred_in_gbs:
108            The value to assign to the total_data_transferred_in_gbs property of this BootVolumeReplica.
109        :type total_data_transferred_in_gbs: int
110
111        """
112        self.swagger_types = {
113            'availability_domain': 'str',
114            'compartment_id': 'str',
115            'defined_tags': 'dict(str, dict(str, object))',
116            'display_name': 'str',
117            'freeform_tags': 'dict(str, str)',
118            'id': 'str',
119            'lifecycle_state': 'str',
120            'size_in_gbs': 'int',
121            'time_created': 'datetime',
122            'time_last_synced': 'datetime',
123            'boot_volume_id': 'str',
124            'image_id': 'str',
125            'total_data_transferred_in_gbs': 'int'
126        }
127
128        self.attribute_map = {
129            'availability_domain': 'availabilityDomain',
130            'compartment_id': 'compartmentId',
131            'defined_tags': 'definedTags',
132            'display_name': 'displayName',
133            'freeform_tags': 'freeformTags',
134            'id': 'id',
135            'lifecycle_state': 'lifecycleState',
136            'size_in_gbs': 'sizeInGBs',
137            'time_created': 'timeCreated',
138            'time_last_synced': 'timeLastSynced',
139            'boot_volume_id': 'bootVolumeId',
140            'image_id': 'imageId',
141            'total_data_transferred_in_gbs': 'totalDataTransferredInGBs'
142        }
143
144        self._availability_domain = None
145        self._compartment_id = None
146        self._defined_tags = None
147        self._display_name = None
148        self._freeform_tags = None
149        self._id = None
150        self._lifecycle_state = None
151        self._size_in_gbs = None
152        self._time_created = None
153        self._time_last_synced = None
154        self._boot_volume_id = None
155        self._image_id = None
156        self._total_data_transferred_in_gbs = None
157
158    @property
159    def availability_domain(self):
160        """
161        **[Required]** Gets the availability_domain of this BootVolumeReplica.
162        The availability domain of the boot volume replica.
163
164        Example: `Uocm:PHX-AD-1`
165
166
167        :return: The availability_domain of this BootVolumeReplica.
168        :rtype: str
169        """
170        return self._availability_domain
171
172    @availability_domain.setter
173    def availability_domain(self, availability_domain):
174        """
175        Sets the availability_domain of this BootVolumeReplica.
176        The availability domain of the boot volume replica.
177
178        Example: `Uocm:PHX-AD-1`
179
180
181        :param availability_domain: The availability_domain of this BootVolumeReplica.
182        :type: str
183        """
184        self._availability_domain = availability_domain
185
186    @property
187    def compartment_id(self):
188        """
189        **[Required]** Gets the compartment_id of this BootVolumeReplica.
190        The OCID of the compartment that contains the boot volume replica.
191
192
193        :return: The compartment_id of this BootVolumeReplica.
194        :rtype: str
195        """
196        return self._compartment_id
197
198    @compartment_id.setter
199    def compartment_id(self, compartment_id):
200        """
201        Sets the compartment_id of this BootVolumeReplica.
202        The OCID of the compartment that contains the boot volume replica.
203
204
205        :param compartment_id: The compartment_id of this BootVolumeReplica.
206        :type: str
207        """
208        self._compartment_id = compartment_id
209
210    @property
211    def defined_tags(self):
212        """
213        Gets the defined_tags of this BootVolumeReplica.
214        Defined tags for this resource. Each key is predefined and scoped to a
215        namespace. For more information, see `Resource Tags`__.
216
217        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
218
219        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm
220
221
222        :return: The defined_tags of this BootVolumeReplica.
223        :rtype: dict(str, dict(str, object))
224        """
225        return self._defined_tags
226
227    @defined_tags.setter
228    def defined_tags(self, defined_tags):
229        """
230        Sets the defined_tags of this BootVolumeReplica.
231        Defined tags for this resource. Each key is predefined and scoped to a
232        namespace. For more information, see `Resource Tags`__.
233
234        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
235
236        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm
237
238
239        :param defined_tags: The defined_tags of this BootVolumeReplica.
240        :type: dict(str, dict(str, object))
241        """
242        self._defined_tags = defined_tags
243
244    @property
245    def display_name(self):
246        """
247        **[Required]** Gets the display_name of this BootVolumeReplica.
248        A user-friendly name. Does not have to be unique, and it's changeable.
249        Avoid entering confidential information.
250
251
252        :return: The display_name of this BootVolumeReplica.
253        :rtype: str
254        """
255        return self._display_name
256
257    @display_name.setter
258    def display_name(self, display_name):
259        """
260        Sets the display_name of this BootVolumeReplica.
261        A user-friendly name. Does not have to be unique, and it's changeable.
262        Avoid entering confidential information.
263
264
265        :param display_name: The display_name of this BootVolumeReplica.
266        :type: str
267        """
268        self._display_name = display_name
269
270    @property
271    def freeform_tags(self):
272        """
273        Gets the freeform_tags of this BootVolumeReplica.
274        Free-form tags for this resource. Each tag is a simple key-value pair with no
275        predefined name, type, or namespace. For more information, see `Resource Tags`__.
276
277        Example: `{\"Department\": \"Finance\"}`
278
279        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm
280
281
282        :return: The freeform_tags of this BootVolumeReplica.
283        :rtype: dict(str, str)
284        """
285        return self._freeform_tags
286
287    @freeform_tags.setter
288    def freeform_tags(self, freeform_tags):
289        """
290        Sets the freeform_tags of this BootVolumeReplica.
291        Free-form tags for this resource. Each tag is a simple key-value pair with no
292        predefined name, type, or namespace. For more information, see `Resource Tags`__.
293
294        Example: `{\"Department\": \"Finance\"}`
295
296        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm
297
298
299        :param freeform_tags: The freeform_tags of this BootVolumeReplica.
300        :type: dict(str, str)
301        """
302        self._freeform_tags = freeform_tags
303
304    @property
305    def id(self):
306        """
307        **[Required]** Gets the id of this BootVolumeReplica.
308        The boot volume replica's Oracle ID (OCID).
309
310
311        :return: The id of this BootVolumeReplica.
312        :rtype: str
313        """
314        return self._id
315
316    @id.setter
317    def id(self, id):
318        """
319        Sets the id of this BootVolumeReplica.
320        The boot volume replica's Oracle ID (OCID).
321
322
323        :param id: The id of this BootVolumeReplica.
324        :type: str
325        """
326        self._id = id
327
328    @property
329    def lifecycle_state(self):
330        """
331        **[Required]** Gets the lifecycle_state of this BootVolumeReplica.
332        The current state of a boot volume replica.
333
334        Allowed values for this property are: "PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY", 'UNKNOWN_ENUM_VALUE'.
335        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
336
337
338        :return: The lifecycle_state of this BootVolumeReplica.
339        :rtype: str
340        """
341        return self._lifecycle_state
342
343    @lifecycle_state.setter
344    def lifecycle_state(self, lifecycle_state):
345        """
346        Sets the lifecycle_state of this BootVolumeReplica.
347        The current state of a boot volume replica.
348
349
350        :param lifecycle_state: The lifecycle_state of this BootVolumeReplica.
351        :type: str
352        """
353        allowed_values = ["PROVISIONING", "AVAILABLE", "ACTIVATING", "TERMINATING", "TERMINATED", "FAULTY"]
354        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
355            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
356        self._lifecycle_state = lifecycle_state
357
358    @property
359    def size_in_gbs(self):
360        """
361        **[Required]** Gets the size_in_gbs of this BootVolumeReplica.
362        The size of the source boot volume, in GBs.
363
364
365        :return: The size_in_gbs of this BootVolumeReplica.
366        :rtype: int
367        """
368        return self._size_in_gbs
369
370    @size_in_gbs.setter
371    def size_in_gbs(self, size_in_gbs):
372        """
373        Sets the size_in_gbs of this BootVolumeReplica.
374        The size of the source boot volume, in GBs.
375
376
377        :param size_in_gbs: The size_in_gbs of this BootVolumeReplica.
378        :type: int
379        """
380        self._size_in_gbs = size_in_gbs
381
382    @property
383    def time_created(self):
384        """
385        **[Required]** Gets the time_created of this BootVolumeReplica.
386        The date and time the boot volume replica was created. Format defined
387        by `RFC3339`__.
388
389        __ https://tools.ietf.org/html/rfc3339
390
391
392        :return: The time_created of this BootVolumeReplica.
393        :rtype: datetime
394        """
395        return self._time_created
396
397    @time_created.setter
398    def time_created(self, time_created):
399        """
400        Sets the time_created of this BootVolumeReplica.
401        The date and time the boot volume replica was created. Format defined
402        by `RFC3339`__.
403
404        __ https://tools.ietf.org/html/rfc3339
405
406
407        :param time_created: The time_created of this BootVolumeReplica.
408        :type: datetime
409        """
410        self._time_created = time_created
411
412    @property
413    def time_last_synced(self):
414        """
415        **[Required]** Gets the time_last_synced of this BootVolumeReplica.
416        The date and time the boot volume replica was last synced from the source boot volume.
417        Format defined by `RFC3339`__.
418
419        __ https://tools.ietf.org/html/rfc3339
420
421
422        :return: The time_last_synced of this BootVolumeReplica.
423        :rtype: datetime
424        """
425        return self._time_last_synced
426
427    @time_last_synced.setter
428    def time_last_synced(self, time_last_synced):
429        """
430        Sets the time_last_synced of this BootVolumeReplica.
431        The date and time the boot volume replica was last synced from the source boot volume.
432        Format defined by `RFC3339`__.
433
434        __ https://tools.ietf.org/html/rfc3339
435
436
437        :param time_last_synced: The time_last_synced of this BootVolumeReplica.
438        :type: datetime
439        """
440        self._time_last_synced = time_last_synced
441
442    @property
443    def boot_volume_id(self):
444        """
445        **[Required]** Gets the boot_volume_id of this BootVolumeReplica.
446        The OCID of the source boot volume.
447
448
449        :return: The boot_volume_id of this BootVolumeReplica.
450        :rtype: str
451        """
452        return self._boot_volume_id
453
454    @boot_volume_id.setter
455    def boot_volume_id(self, boot_volume_id):
456        """
457        Sets the boot_volume_id of this BootVolumeReplica.
458        The OCID of the source boot volume.
459
460
461        :param boot_volume_id: The boot_volume_id of this BootVolumeReplica.
462        :type: str
463        """
464        self._boot_volume_id = boot_volume_id
465
466    @property
467    def image_id(self):
468        """
469        Gets the image_id of this BootVolumeReplica.
470        The image OCID used to create the boot volume the replica is replicated from.
471
472
473        :return: The image_id of this BootVolumeReplica.
474        :rtype: str
475        """
476        return self._image_id
477
478    @image_id.setter
479    def image_id(self, image_id):
480        """
481        Sets the image_id of this BootVolumeReplica.
482        The image OCID used to create the boot volume the replica is replicated from.
483
484
485        :param image_id: The image_id of this BootVolumeReplica.
486        :type: str
487        """
488        self._image_id = image_id
489
490    @property
491    def total_data_transferred_in_gbs(self):
492        """
493        Gets the total_data_transferred_in_gbs of this BootVolumeReplica.
494        The total size of the data transferred from the source boot volume to the boot volume replica, in GBs.
495
496
497        :return: The total_data_transferred_in_gbs of this BootVolumeReplica.
498        :rtype: int
499        """
500        return self._total_data_transferred_in_gbs
501
502    @total_data_transferred_in_gbs.setter
503    def total_data_transferred_in_gbs(self, total_data_transferred_in_gbs):
504        """
505        Sets the total_data_transferred_in_gbs of this BootVolumeReplica.
506        The total size of the data transferred from the source boot volume to the boot volume replica, in GBs.
507
508
509        :param total_data_transferred_in_gbs: The total_data_transferred_in_gbs of this BootVolumeReplica.
510        :type: int
511        """
512        self._total_data_transferred_in_gbs = total_data_transferred_in_gbs
513
514    def __repr__(self):
515        return formatted_flat_dict(self)
516
517    def __eq__(self, other):
518        if other is None:
519            return False
520
521        return self.__dict__ == other.__dict__
522
523    def __ne__(self, other):
524        return not self == other
525