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 CreateZoneBaseDetails(object):
12    """
13    The body for either defining a new zone or migrating a zone from migrationSource. This is determined by the migrationSource discriminator.
14    NONE indicates creation of a new zone (default). DYNECT indicates migration from a DynECT zone.
15
16    **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
17    """
18
19    #: A constant which can be used with the migration_source property of a CreateZoneBaseDetails.
20    #: This constant has a value of "NONE"
21    MIGRATION_SOURCE_NONE = "NONE"
22
23    #: A constant which can be used with the migration_source property of a CreateZoneBaseDetails.
24    #: This constant has a value of "DYNECT"
25    MIGRATION_SOURCE_DYNECT = "DYNECT"
26
27    def __init__(self, **kwargs):
28        """
29        Initializes a new CreateZoneBaseDetails object with values from keyword arguments. This class has the following subclasses and if you are using this class as input
30        to a service operations then you should favor using a subclass over the base class:
31
32        * :class:`~oci.dns.models.CreateZoneDetails`
33        * :class:`~oci.dns.models.CreateMigratedDynectZoneDetails`
34
35        The following keyword arguments are supported (corresponding to the getters/setters of this class):
36
37        :param migration_source:
38            The value to assign to the migration_source property of this CreateZoneBaseDetails.
39            Allowed values for this property are: "NONE", "DYNECT"
40        :type migration_source: str
41
42        :param name:
43            The value to assign to the name property of this CreateZoneBaseDetails.
44        :type name: str
45
46        :param compartment_id:
47            The value to assign to the compartment_id property of this CreateZoneBaseDetails.
48        :type compartment_id: str
49
50        :param freeform_tags:
51            The value to assign to the freeform_tags property of this CreateZoneBaseDetails.
52        :type freeform_tags: dict(str, str)
53
54        :param defined_tags:
55            The value to assign to the defined_tags property of this CreateZoneBaseDetails.
56        :type defined_tags: dict(str, dict(str, object))
57
58        """
59        self.swagger_types = {
60            'migration_source': 'str',
61            'name': 'str',
62            'compartment_id': 'str',
63            'freeform_tags': 'dict(str, str)',
64            'defined_tags': 'dict(str, dict(str, object))'
65        }
66
67        self.attribute_map = {
68            'migration_source': 'migrationSource',
69            'name': 'name',
70            'compartment_id': 'compartmentId',
71            'freeform_tags': 'freeformTags',
72            'defined_tags': 'definedTags'
73        }
74
75        self._migration_source = None
76        self._name = None
77        self._compartment_id = None
78        self._freeform_tags = None
79        self._defined_tags = None
80
81    @staticmethod
82    def get_subtype(object_dictionary):
83        """
84        Given the hash representation of a subtype of this class,
85        use the info in the hash to return the class of the subtype.
86        """
87        type = object_dictionary['migrationSource']
88
89        if type == 'NONE':
90            return 'CreateZoneDetails'
91
92        if type == 'DYNECT':
93            return 'CreateMigratedDynectZoneDetails'
94        else:
95            return 'CreateZoneBaseDetails'
96
97    @property
98    def migration_source(self):
99        """
100        Gets the migration_source of this CreateZoneBaseDetails.
101        Discriminator that is used to determine whether to create a new zone (NONE) or to migrate an existing DynECT zone (DYNECT).
102
103        Allowed values for this property are: "NONE", "DYNECT"
104
105
106        :return: The migration_source of this CreateZoneBaseDetails.
107        :rtype: str
108        """
109        return self._migration_source
110
111    @migration_source.setter
112    def migration_source(self, migration_source):
113        """
114        Sets the migration_source of this CreateZoneBaseDetails.
115        Discriminator that is used to determine whether to create a new zone (NONE) or to migrate an existing DynECT zone (DYNECT).
116
117
118        :param migration_source: The migration_source of this CreateZoneBaseDetails.
119        :type: str
120        """
121        allowed_values = ["NONE", "DYNECT"]
122        if not value_allowed_none_or_none_sentinel(migration_source, allowed_values):
123            raise ValueError(
124                "Invalid value for `migration_source`, must be None or one of {0}"
125                .format(allowed_values)
126            )
127        self._migration_source = migration_source
128
129    @property
130    def name(self):
131        """
132        **[Required]** Gets the name of this CreateZoneBaseDetails.
133        The name of the zone.
134
135
136        :return: The name of this CreateZoneBaseDetails.
137        :rtype: str
138        """
139        return self._name
140
141    @name.setter
142    def name(self, name):
143        """
144        Sets the name of this CreateZoneBaseDetails.
145        The name of the zone.
146
147
148        :param name: The name of this CreateZoneBaseDetails.
149        :type: str
150        """
151        self._name = name
152
153    @property
154    def compartment_id(self):
155        """
156        **[Required]** Gets the compartment_id of this CreateZoneBaseDetails.
157        The OCID of the compartment containing the zone.
158
159
160        :return: The compartment_id of this CreateZoneBaseDetails.
161        :rtype: str
162        """
163        return self._compartment_id
164
165    @compartment_id.setter
166    def compartment_id(self, compartment_id):
167        """
168        Sets the compartment_id of this CreateZoneBaseDetails.
169        The OCID of the compartment containing the zone.
170
171
172        :param compartment_id: The compartment_id of this CreateZoneBaseDetails.
173        :type: str
174        """
175        self._compartment_id = compartment_id
176
177    @property
178    def freeform_tags(self):
179        """
180        Gets the freeform_tags of this CreateZoneBaseDetails.
181        Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
182        For more information, see `Resource Tags`__.
183
184
185        **Example:** `{\"Department\": \"Finance\"}`
186
187        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
188
189
190        :return: The freeform_tags of this CreateZoneBaseDetails.
191        :rtype: dict(str, str)
192        """
193        return self._freeform_tags
194
195    @freeform_tags.setter
196    def freeform_tags(self, freeform_tags):
197        """
198        Sets the freeform_tags of this CreateZoneBaseDetails.
199        Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
200        For more information, see `Resource Tags`__.
201
202
203        **Example:** `{\"Department\": \"Finance\"}`
204
205        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
206
207
208        :param freeform_tags: The freeform_tags of this CreateZoneBaseDetails.
209        :type: dict(str, str)
210        """
211        self._freeform_tags = freeform_tags
212
213    @property
214    def defined_tags(self):
215        """
216        Gets the defined_tags of this CreateZoneBaseDetails.
217        Defined tags for this resource. Each key is predefined and scoped to a namespace.
218        For more information, see `Resource Tags`__.
219
220
221        **Example:** `{\"Operations\": {\"CostCenter\": \"42\"}}`
222
223        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
224
225
226        :return: The defined_tags of this CreateZoneBaseDetails.
227        :rtype: dict(str, dict(str, object))
228        """
229        return self._defined_tags
230
231    @defined_tags.setter
232    def defined_tags(self, defined_tags):
233        """
234        Sets the defined_tags of this CreateZoneBaseDetails.
235        Defined tags for this resource. Each key is predefined and scoped to a namespace.
236        For more information, see `Resource Tags`__.
237
238
239        **Example:** `{\"Operations\": {\"CostCenter\": \"42\"}}`
240
241        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
242
243
244        :param defined_tags: The defined_tags of this CreateZoneBaseDetails.
245        :type: dict(str, dict(str, object))
246        """
247        self._defined_tags = defined_tags
248
249    def __repr__(self):
250        return formatted_flat_dict(self)
251
252    def __eq__(self, other):
253        if other is None:
254            return False
255
256        return self.__dict__ == other.__dict__
257
258    def __ne__(self, other):
259        return not self == other
260